Subject: Re: databases.mk (new mk for packages using
To: Juan RP <juan@xtraeme.unixbsd.org>
From: Julio M. Merino Vidal <jmmv@menta.net>
List: tech-pkg
Date: 06/10/2004 09:54:06
On Thu, 10 Jun 2004 07:45:06 +0200
Juan RP <juan@xtraeme.unixbsd.org> wrote:

> 
> Hey there,
> 
> I just finished "databases.mk" for pkgsrc, it's based on the file
> pkgsrc/mk/krb5.buildlink3.mk by Johnny C. Lam.
> 
> And this file will be useful for packages requiring
> mysql*-client/postgresql*-lib, because actually we cannot install
> databases/php4-pgsql with postgresql74-lib (the newest branch) without editing
> the Makefile and changing the include.

Then the "abstraction" is wrong.  Why a package like php4-pgsql has to deal
with mysql stuff?  I.e., that package is pgsql specific, so it has to include
a "pgsql specific file", not something generic.

It seems to me it could be better to have a "version.mk" makefile in
databases/postgresql and another one in databases/mysql (no need to be in
mk/; it has already a lot of files...), similar to what the python
packages do.

Even though...  for what grant suggested, like having exim3 use different
databases (through USE_DB="mysql postgresql"), a file in mk makes sense
(because it's providing a "general abstraction" for database support).

If done this way, mk/databases.mk could simply need to inspect the variable
value and then include databases/{mysql,postgresql}/version.mk depending on
it.  And the file in mk/ could only be used by packages accepting _both_
databases.  Packages using only one could simply include the right version.mk
directly...

Cheers

-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/