Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ports/89023: USE_BDB doesn't set name of Berkely dB, or location of the include directory



The db-bsd.database.mk-diff updates the functionality of USE_BDB to
return with the BDB_INCLUDE_DIR, BDB_LIB_NAME.

The db-ports.gz is a patch to all of the ports that were not using the
bsd.database.mk to include the Berkeley, MySQL, and SQLITE ports.

I have tested that all of these ports will build using
bsd.database.mk.  Maintainers please send in your approval for these
changes.

NOTE:
1. A few of the ports have additional patches that allow them to build
with newer version of Berkeley DB.
2. Create the security/xca/files directory before applying patch the
db-ports patch

Thanks,

Scot W. Hetzel
============================================================
Index: KNOBS
- Add BDB to KNOBS

Index: Mk/bsd.database.mk
  USE_BDB will return the first BDB version found, when it is defined as either:

  USE_BDB=yes
  USE_BDB=3+

  So when you have db41 and db43 installed, USE_BDB will set the port to db41.
  By defining WITH_BDB_HIGHEST when building the port, USE_BDB will
set the port to db43.

- Added BROKEN_WITH_BDB
  - var to set the version(s) of Berkeley DB that the port won't use/compile

- Added WANT_BDB_VAR
  - var that MAINTAINER can set to specify that the port will only use
a specific BDB port

- Added WITH_BDB_VER and <UNIQUENAME>_WITH_BDB_VER
  - WITH_BDB_VER is a global port variable to select the version of
BDB all ports will use
  - <UNIQUENAME>_WITH_BDB_VER is a port specific variable that
overrides WITH_BDB_VER
  NOTE: If a port uses WITH_BDB_VER after a '.include bsd.port.pre.mk' to select
  BDB version, then the port must add:

  .if defined(${UNIQUENAME:U:S,-,_,}_WITH_BDB_VER)
  WITH_BDB_VER=	${${UNIQUENAME:U:S,-,_,}_WITH_BDB_VER}
  .endif

  before '.include bsd.port.pre.mk'

- Added BDB_LIB_NAME and BDB_LIB_CXX_NAME
  - used to define the BDB library (i.e. db-4.2, db_cxx-4.2)

- Added BDB_INCLUDE_DIR and BDB_LIB_DIR
  - used to specify the location of the BDB headers and libraries

- Added OBSOLETE_BDB_VAR
  - used to define old variables that no longer select BDB or the BDB version.
    If a variable was used to select a BDB version, and is defined
when making the port,
    then the following message is displayed:

    Obsolete variable(s) ${BAD_VAR} use WITH_BDB_VER or
${UNIQUENAME:U:S,-,_,}_WITH_BDB_VER
    to select the Berkeley DB version

    If the variable was used to add BDB as an option to LIB_DEPENDS
    (.i.e. OPTIONS=, WITH_BERKELEYDB), then the port defines IGNORE as either:

    Use 'make config' to enable Berkeley DB support.
	or
    Use WITH_BDB to enable Berkeley DB support.

    then bsd.database.mk adds the "Obsolete variable..." to IGNORE.

NOTE:  When creating a new port, try to minimize the use of:

USE_BDB=	yes
WITH_BDB_VER?=	3
.if ${WITH_BDB_VER} == 3
SET_SOME_VAR=	x
.elif ${WITH_BDB_VER} > 3
SET_SOME_VAR=	y
.endif

As it prevents the port from automatically detecting the available BDB
version that is installed
examples of ports that do require this are:

mail/lmtpd
mail/popular
misc/libhome
net/openldap22-server
net/openldap23-server

As they set variables to different values (i.e CONFIGURE_ARGS)

============================================================

Index: archivers/rpm4/Makefile
glewis@xxxxxxxxxxx

	M archivers/rpm4/Makefile

Index: astro/roadmap/Makefile
nick@xxxxxxxxxx

	M astro/roadmap/Makefile

Index: audio/libsndfile/Makefile
ahze@xxxxxxxxxxx

	M audio/libsndfile/Makefile

Index: audio/lplayer/Makefile
sylvioc@xxxxxxxxx

	M audio/lplayer/Makefile

Index: audio/xmms-imms/Makefile
green@xxxxxxxxxxx

	M audio/xmms-imms/Makefile

Index: chinese/libtabe/Makefile
kcwu@xxxxxxxxxxxx

	M chinese/libtabe/Makefile

Index: chinese/p5-Lingua-ZH-TaBE/Makefile
clsung@xxxxxxxxxxx

	M chinese/p5-Lingua-ZH-TaBE/Makefile

Index: chinese/xcin25/Makefile
kcwu@xxxxxxxxxxxx

	M chinese/xcin25/Makefile

Index: chinese/xsim/Makefile
ports@xxxxxxxxxxx

	M chinese/xsim/Makefile
	A chinese/xsim/files/patch-configure

Index: comms/kpsk/Makefile	1.0	http://kpsk.sourceforge.net
ports@xxxxxxxxxxx

	M comms/kpsk/Makefile
   	A comms/kpsk/files/patch-kpsk_logcore.cpp - fix for Berkeley DB 4.1+

Index: databases/dbtool/Makefile	1.6	http://www.daemon.de/DBTOOL/
ports@xxxxxxxxxxx
  - removed unneeded REINPLACE_CMDS
    - Author changed all occurances of stdin to from_stdin in version 1.5.
    - No '==' in configure script
  - Fails to build with Berkeley DB, caused by DB variable being
defined in dbtool.h
    and then used in <db.h> when <db_cxx.h> is included.
    FIXED: renamed DB and PW to DB_ENV_VAR and PW_ENV_VAR.

	M databases/dbtool/Makefile
	A databases/dbtool/files/patch-config.cc - fix Berkeley DB build
	A databases/dbtool/files/patch-dbtool.cc - fix Berkeley DB build
	A databases/dbtool/files/patch-dbtool.h - fix Berkeley DB build
	A databases/dbtool/files/patch-engine.cc - fix for Berkeley DB 4.1+

Index: databases/p5-BerkeleyDB/Makefile
clsung@xxxxxxxxxxx

	M databases/p5-BerkeleyDB/Makefile

Index: databases/py-bsddb/Makefile
perky@xxxxxxxxxxx

	M databases/py-bsddb/Makefile
	M databases/py-bsddb/files/setup.py

Index: databases/py-bsddb3/Makefile
perky@xxxxxxxxxxx

	M databases/py-bsddb3/Makefile
	M databases/py-bsddb3/distinfo

Index: databases/rdfdb/Makefile	0.46	http://www.guha.com/rdfdb
ports@xxxxxxxxxxx

	M databases/rdfdb/Makefile
	A databases/rdfdb/files/patch-librdf::db.c - fix for Berkeley DB 4.1+
	M databases/rdfdb/files/patch-makefile

Index: databases/ruby-bdb/Makefile
knu@xxxxxxxxxxx

	M databases/ruby-bdb/Makefile

Index: deskutils/gtkjournal/Makefile
adamw@xxxxxxxxxxx

	M deskutils/gtkjournal/Makefile

Index: deskutils/ktagebuch/Makefile
markus@xxxxxxxxxxx

	M deskutils/ktagebuch/Makefile

Index: deskutils/logjam/Makefile
mike.patterson@xxxxxx

	M deskutils/logjam/Makefile

Index: deskutils/mcatalog/Makefile
bsd-sharp-list@xxxxxxxxxxxxxxxx

	M deskutils/mcatalog/Makefile

Index: devel/apr/Makefile	1.2.2	http://apr.apache.org
rodrigc@xxxxxxxxxxxxxx
 - the configure script for apr-util, fails to find gdbm.
   FIXED: added APR_UTIL_CONF_ARGS+=--with_gdbm=${LOCALBASE},
 - side effect - causes the detection of Berkeley DB to use db4.3
   instead of db4.2 when both db4.2 and db4.3 are installed. Caused
   by the gdbm detection adding -I/usr/local/include to CPPFLAGS.
   FIXED: patched the gdbm detection routine to save the old CPPFLAGS,
   and then restoring the old CPPFLAGS, before trying to detect the next
   library (patch-apr-util_build_dbm.m4, patch-apr-util_configure).

	M devel/apr/Makefile
	A devel/apr/files/patch-apr-util_build_dbm.m4
	A devel/apr/files/patch-apr-util_configure

Index: devel/cvstrac/Makefile
bms@xxxxxxxxxxx

	M devel/cvstrac/Makefile

Index: devel/ice/Makefile
shoesoft@xxxxxxx

	M devel/ice/Makefile
	M devel/ice/files/patch-Make.rules

Index: devel/kdesdk3/Makefile
kde@xxxxxxxxxxx

	M devel/kdesdk3/Makefile

Index: devel/libopensync/Makefile
ahze@xxxxxxxxxxx

	M devel/libopensync/Makefile

Index: devel/tcl-neo/Makefile
mi@xxxxxxxxxxxxxxxxx

	M devel/tcl-neo/Makefile

Index: dns/bind9-dlz/Makefile
dinoex@xxxxxxxxxxx

	M dns/bind9-dlz/Makefile
	M dns/bind9-dlz/files/configure.bind9-dlz
	M dns/bind9-dlz/files/db42-bind922.patch - update to db43
	M dns/bind9-dlz/files/db42-bind931.patch - update to db43

Index: dns/fastresolve/Makefile
martin@xxxxxxxxxxx

	M dns/fastresolve/Makefile

Index: dns/powerdns/Makefile
tremere@xxxxxxxxxxxx

	M dns/powerdns/Makefile

Index: editors/nvi-devel/Makefile
dd@xxxxxxxxxxx

	M editors/nvi-devel/Makefile

Index: editors/poedit/Makefile
ports@xxxxxxxxxxx

	M editors/poedit/Makefile

Index: finance/gnucash/Makefile
ports@xxxxxxxxxxx
 - configure script fails to detect the db library, but does detect headers
   FIXED: Hard coded DB_LIBS in configure script, and then used post-patch
   to set DB_LIBS to the correct BDB_LIB_NAME.

	M finance/gnucash/Makefile
	M finance/gnucash/files/patch-configure

Index: finance/qhacc/Makefile
ports@xxxxxxxxxxx

	M finance/qhacc/Makefile

Index: finance/qtstalker/Makefile
lioux@xxxxxxxxxxx

	M finance/qtstalker/Makefile

Index: games/amy/Makefile
thorsten@xxxxxxxxxxxx

	M games/amy/Makefile

Index: games/gcompris2/Makefile
gnome@xxxxxxxxxxx

	M games/gcompris2/Makefile

Index: graphics/f-spot/Makefile
bsd-sharp-list@xxxxxxxxxxxxxxxx

	M graphics/f-spot/Makefile

Index: lang/gambas/Makefile
thierry@xxxxxxxxxxx

	M lang/gambas/Makefile

Index: lang/munger/Makefile
jimmy@xxxxxxxxxxxxxxx

	M lang/munger/Makefile

Index: lang/pike72/Makefile	7.2.570	http://pike.roxen.com
kiwi@xxxxxxx

	M lang/pike72/Makefile
	A lang/pike72/files/patch-modules_Mysql_mysql.c - fix for MySQL 4.1+

Index: lang/scriba/Makefile	2.0b0	http://www.scriptbasic.com
ports@xxxxxxxxxxx

	M lang/scriba/Makefile
	M lang/scriba/files/patch-extensions-bdb-interface.c - fix for BDB 4.1+
	A lang/scriba/files/patch-extensions-mysql-interface.c - fix for MySQL 4.1+
	M lang/scriba/files/patch-make_gcc.jim

Index: lang/tinycobol/Makefile
ports@xxxxxxxxxxx

	M lang/tinycobol/Makefile
	A lang/tinycobol/files/patch-configure

Index: mail/avenger/Makefile
dm+bugs+avenger@xxxxxxxxxxxxxxx

	M mail/avenger/Makefile

Index: mail/bmf/Makefile
seanc@xxxxxxxxxxx

	M mail/bmf/Makefile

Index: mail/bogofilter/Makefile
matthias.andree@xxxxxx

	M mail/bogofilter/Makefile

Index: mail/bogofilter-qdbm/Makefile
matthias.andree@xxxxxx

	M mail/bogofilter-qdbm/Makefile

Index: mail/bogofilter-sqlite/Makefile
matthias.andree@xxxxxx

	M mail/bogofilter-sqlite/Makefile

Index: mail/drac/Makefile
ports@xxxxxxxxxxx

	M mail/drac/Makefile
	M mail/drac/files/patch-aa

Index: mail/dspam/Makefile
itetcu@xxxxxxxxxxxxxxxxxxx

	M mail/dspam/Makefile

Index: mail/dspam-devel/Makefile
itetcu@xxxxxxxxxxxxxxxxxxx

	M mail/dspam-devel/Makefile

Index: mail/exim/Makefile
krion@xxxxxxxxxxx

	M mail/exim/Makefile

Index: mail/isync/Makefile
ports@xxxxxxxxxxx

	M mail/isync/Makefile

Index: mail/kiltdown/Makefile
ports@xxxxxxxxxxx

	M mail/kiltdown/Makefile

Index: mail/lmtpd/Makefile
kiwi@xxxxxxx
 - if BDB is in libhome, and BDB is selected in lmtpd, setting WITH_BDB_VER has
   no effect as the version used in libhome is used.
 - if no BDB is in libhome, and BDB is selected in lmtpd, the compile will fail.
   FIXED
 - changed default BDB from db3 to db41, makes WITH_BDB_HIGHEST work
with this port.

	M mail/lmtpd/Makefile

Index: mail/mutt-devel/Makefile
udo.schweigert@xxxxxxxxxxx
 - When multiple versions of BDB 4.x are installed, and WITH_BDB_VER > 4, the
   library is set to -ldb4 instead of requested library. FIXED
 - unneeded patch files/patch-hcache-db, replaced by REINPLACE_CMD in post-patch

	M mail/mutt-devel/Makefile
	R mail/mutt-devel/patch-hcache-db

Index: mail/mutt-ng/Makefile
vsevolod@xxxxxxxxxxx
 - When multiple versions of BDB 4.x are installed, and WITH_BDB_VER > 4, the
   library is set to -ldb4 instead of requested library.
   FIXED replaced by REINPLACE_CMD in post-patch

	M mail/mutt-ng/Makefile
	M mail/mutt-ng/files/patch-configure

Index: mail/perdition/Makefile
clement@xxxxxxxxxxx
 - Add BDB_INCLUDE_DIR to CFLAGS
 - Set db library in post-patch
 - remove no longer needed patches

	M mail/perdition/Makefile
	R mail/perdition/files/patch-makebdb-Makefile.in
	R mail/perdition/files/patch-makebdb-makebdb.c
	R mail/perdition/files/patch-perdition-db-bdb-Makefile.in
	R mail/perdition/files/patch-perdition-db-bdb-perditiondb_bdb.h

Index: mail/popular/Makefile
pav@xxxxxxxxxxx

	M mail/popular/Makefile
	M mail/popular/pkg-plist
	M mail/popular/files/patch-configure

Index: mail/postfix-current/Makefile
mnag@xxxxxxxxxxx

	M mail/postfix-current/Makefile

Index: mail/prayer/Makefile
ports@xxxxxxxxxxx

	M mail/prayer/Makefile

Index: mail/qsf/Makefile
ports@xxxxxxxxxxx

	M mail/qsf/Makefile

Index: mail/sendmail/Makefile
dinoex@xxxxxxxxxxx

	M mail/sendmail/Makefile

Index: mail/smx/Makefile
dinoex@xxxxxxxxxxx

	M mail/smx/Makefile

Index: mail/spamprobe/Makefile
ports@xxxxxxxxxxx

	M mail/spamprobe/Makefile

Index: misc/hotkeys/Makefile
amp0928@xxxxxxx

	M misc/hotkeys/Makefile

Index: misc/krecipes/Makefile
hank@xxxxxxxxxxxxxx

	M misc/krecipes/Makefile

Index: misc/libhome/Makefile
kiwi@xxxxxxx
 - changed default BDB from db3 to db41, makes WITH_BDB_HIGHEST work
with this port.

	M misc/libhome/Makefile

Index: net/cdonkey/Makefile	0.9.0	http://cdonkey.suche.org
ports@xxxxxxxxxxx

	M net/cdonkey/Makefile
	A net/cdonkey/files/patch-db_macro.h - fix for BDB 4.2+

Index: net/dctc/Makefile	0.84.1	http://ac2i.homelinux.com/dctc
ports@xxxxxxxxxxx
 - Fails to find db41 library. FIXED
 - Fails to find db_env_create in db-4.2. (db-4.2 port built with uniquenames)
   FIXED - added post-patch to change db_env_create to
db_env_create_4002 in configure

	M net/dctc/Makefile
	  net/dctc/files/fix-configure.in - add check for db$major$minor
	A net/dctc/files/patch-configure - add check for db$major$minor

Index: net/dctc-gui/Makefile	0.66	http://ac2i.homelinux.com/dctc
lioux@xxxxxxxxxxx
 - Fails to find db41 library. FIXED
 - Fails to find db_env_create in db-4.2. (db-4.2 port built with uniquenames)
   FIXED - added post-patch to change db_env_create to
db_env_create_4002 in configure

	M net/dctc-gui/Makefile
	  net/dctc-gui/files/fix-configure.in - add check for db$major$minor
	A net/dctc-gui/files/patch-configure - add check for db$major$minor

Index: net/gift-openft/Makefile
shoesoft@xxxxxxx

	M net/gift-openft/Makefile
	M net/gift-openft/files/patch-configure

Index: net/gnunet/Makefile
ports@xxxxxxxxxxx

	M net/gnunet/Makefile

Index: net/netatalk/Makefile	2.0.3	http://netatalk.sourceforge.net
marcus@xxxxxxxxxxx

	M net/netatalk/Makefile
	  net/netatalk/files/fix-macros_db3-check.m4	- fix for BDB 4.3+
	A net/netatalk/files/patch-bin_cnid_cnid_index.c	- fix for BDB 4.3+
	M net/netatalk/files/patch-configure	- fix for BDB 4.3+
	A net/netatalk/files/patch-etc_cnid_dbd_dbif.c	- fix for BDB 4.3+

Index: net/openldap22-server/Makefile
vsevolod@xxxxxxxxxxx

	M net/openldap22-server/Makefile

Index: net/openldap23-server/Makefile
vsevolod@xxxxxxxxxxx

	M net/openldap23-server/Makefile

Index: net/rtg/Makefile
so14k@xxxxxxxxx

	M net/rtg/Makefile

Index: net/torrentflux/Makefile
ports@xxxxxxxxxxx

	M net/torrentflux/Makefile

Index: net-im/jabberd/Makefile
kirk@xxxxxxxxxxxx

	M net-im/jabberd/Makefile

Index: net-im/sulci/Makefile
dsh@xxxxxxxx

	M net-im/sulci/Makefile

Index: news/inn/Makefile	2.4.1	http://www.isc.org/products/INN
clement@xxxxxxxxxxx

	M news/inn/Makefile
	M news/inn/files/patch-configure
	A news/inn/files/patch-frontends::ovdb_stat.c	- fix for BDB 4.3+
	A news/inn/files/patch-storage::ovdb::ovdb-private.h	- fix for BDB 4.2+
	A news/inn/files/patch-storage::ovdb::ovdb.c	- fix for BDB 4.3+

Index: news/inn-current/Makefile	20040118	http://www.isc.org/products/INN
clement@xxxxxxxxxxx

	M news/inn-current/Makefile
	M news/inn-current/files/patch-configure
	A news/inn-current/files/patch-frontends::ovdb_stat.c	- fix for BDB 4.3+
	A news/inn-current/files/patch-storage::ovdb::ovdb.c	- fix for BDB 4.3+

Index: news/inn-stable/Makefile	20040707	http://www.isc.org/products/INN
clement@xxxxxxxxxxx

	M news/inn-stable/Makefile
	M news/inn-stable/files/patch-configure
	A news/inn-stable/files/patch-frontends::ovdb_stat.c	- fix for BDB 4.3+
	A news/inn-stable/files/patch-storage::ovdb::ovdb.c	- fix for BDB 4.3+

Index: news/klibido/Makefile
conrads@xxxxxxx

	M news/klibido/Makefile

Index: print/panda/Makefile
ports@xxxxxxxxxxx
 - Fails to find db_create in db-4.2. (db-4.2 port built with uniquenames)
   FIXED - added post-patch to change db_create to db_create_4002 in configure
 - Add BDB_INCLUDE_DIR to CPPFLAGS and BDB_LIB_DIR to LDFLAGS
 - No longer need to patch the configure script, due to post-patch
replacing -ldb

	M print/panda/Makefile
	R print/panda/files/patch-configure

Index: security/cyrus-sasl2/Makefile
ume@xxxxxxxxxxx

	M security/cyrus-sasl2/Makefile

Index: security/cyrus-sasl2-saslauthd/Makefile
ume@xxxxxxxxxxx

	M security/cyrus-sasl2-saslauthd/Makefile

Index: security/finger_mysql/Makefile
onatan@xxxxxxxxx

	M security/finger_mysql/Makefile

Index: security/pks/Makefile
gtodd@xxxxxxxxxxxx

	M security/pks/Makefile

Index: security/sks/Makefile
johans@xxxxxxxx

	M security/sks/Makefile

Index: security/xca/Makefile	0.5.1	http://www.hohnstaedt.de/xca.html
curly@xxxxxxxxx

	M security/xca/Makefile
	A security/xca/files/patch-widgets::MainWindow.cpp - fix for BDB 4.3+
	A security/xca/files/patch-widgets::MainWindow.h - fix for BDB 4.3+

Index: sysutils/bacula-server/Makefile
Lars.Koeller@xxxxxxxxxxxxxxxx

	M sysutils/bacula-server/Makefile

Index: sysutils/cfengine2/Makefile
sergei@xxxxxxxxxxx
 - when multiple db* are installed, port would link with db41 and db
   specified by WITH_BDB_VER.
   FIXED: Fixed with post-patch of configure script

	M sysutils/cfengine2/Makefile

Index: sysutils/sge/Makefile
brooks@xxxxxxxxxxx
 - fix build for other versions of Berkeley DB besides 4.2

	M sysutils/sge/Makefile
	M sysutils/sge/pkg-plist
	M sysutils/sge/files/aimk.private
	M sysutils/sge/files/patch-scripts_distinst

Index: textproc/modlogan/Makefile
netchild@xxxxxxxxxxx

	M textproc/modlogan/Makefile

Index: textproc/redland/Makefile
chuck@xxxxxxxx

	M textproc/redland/Makefile

Index: textproc/refdb/Makefile
paulh@xxxxxxxxxxxxxx

	M textproc/refdb/Makefile

Index: www/crawl/Makefile
petef@xxxxxxxxxxx
 - crawl wasn't building with any version of db*, due to it patching
   wrong file (configure.in instead of configure). FIXED

	M www/crawl/Makefile

Index: www/dpsearch/Makefile
ports@xxxxxxxxxxx

	M www/dpsearch/Makefile

Index: www/mnogosearch/Makefile
lawrance@xxxxxxxxxxx

	M www/mnogosearch/Makefile

Index: www/mnogosearch31/Makefile
ports@xxxxxxxxxxx

	M www/mnogosearch31/Makefile

Index: www/mod_mysqluserdir/Makefile
apache@xxxxxxxxxxx

	M www/mod_mysqluserdir/Makefile

Index: www/mod_v2h/Makefile
apache@xxxxxxxxxxx

	M www/mod_v2h/Makefile

Index: www/oops/Makefile
marck@xxxxxxxxxxx

	M www/oops/Makefile

Index: www/squidguard/Makefile	1.2.0	http://www.squidguard.org/
ports@xxxxxxxxx
 - Fails to find db_version in db-4.2. (db-4.2 port built with uniquenames)
   FIXED - added post-patch to change db_version to db_version_4002 in configure
 - Use post-patch target to replace db library with BDB_LIB_NAME in configure

	M www/squidguard/Makefile
	R www/squidguard/files/patch-ab
	A www/squidguard/files/patch-src_main.c - fix for BDB 4.2
	A www/squidguard/files/patch-src_sgDB.c - fix for BDB 4.1+
Index: KNOBS
===================================================================
RCS file: /home/ncvs/ports/KNOBS,v
retrieving revision 1.6
diff -u -r1.6 KNOBS
--- KNOBS	1 Jan 2006 20:14:14 -0000	1.6
+++ KNOBS	4 Jan 2006 05:17:58 -0000
@@ -23,6 +23,7 @@
 ARTS			aRts support via the KDE sound daemon
 APACHE2			Use www/apache2 port
 AVIFILE			Adds support for avi multimedia
+BDB			Adds Berkeley DB Support
 CACA			Libcaca colored ASCII graphics
 CDDB			CDDB support
 CDPARANOIA		Support for cdparanoia CD extraction
Index: Mk/bsd.database.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.database.mk,v
retrieving revision 1.3
diff -u -r1.3 bsd.database.mk
--- Mk/bsd.database.mk	4 Dec 2005 14:05:14 -0000	1.3
+++ Mk/bsd.database.mk	6 Jan 2006 03:21:49 -0000
@@ -47,11 +47,29 @@
 #				- This variable can be defined if the ports doesn't support
 #				  one or more versions of PostgreSQL.
 ##
-# USE_BDB		- Add Berkley DB library dependency.
+# USE_BDB		- Add Berkeley DB library dependency.
 #                 If no version is given (by the maintainer via the port or
 #                 by the user via defined variable), try to find the
 #                 currently installed version.  Fall back to default if
 #                 necessary (db41+).
+# BROKEN_WITH_BDB	- This variable can be defined when the port doesn't
+#			  support one or more versions of Berkeley DB.
+# WANT_BDB_VER		- Maintainer can set a version of Berkeley DB to always
+#			  build this port with (overrides WITH_BDB_VER).
+# WITH_BDB_VER		- User defined global variable to set Berkeley DB version
+# <UNIQUENAME>_WITH_BDB_VER - User defined port specific variable to set
+#			  Berkeley DB version
+# WITH_BDB_HIGHEST	- Use the highest installed version of Berkeley DB
+# BDB_LIB_NAME		- This variable is automatically set to the name of the
+#			  Berkeley DB library (default: db41)
+# BDB_LIB_CXX_NAME	- This variable is automatically set to the name of the
+#			  Berkeley DB c++ library (default: db41_cxx)
+# BDB_INCLUDE_DIR	- This variable is automatically set to the location of
+#			  the Berkeley DB include directory.
+#			  (default: ${LOCALBASE}/include/db41)
+# BDB_LIB_DIR		- This variable is automatically set to the location of
+#			  the Berkeley DB library directory.
+#
 ##
 # USE_SQLITE	- Add dependency on sqlite library. Valid values are:
 #				  3 and 2. If version is not specified directly then
@@ -151,7 +169,7 @@
 
 .if defined(USE_BDB)
 
-_DB_PORTS=	2 3 40 41 42 43 40+ 41+ 42+ 43+
+_DB_PORTS=	2 3 40 41 42 43 44 3+ 40+ 41+ 42+ 43+ 44+
 # Dependence lines for different db versions
 db2_DEPENDS=	db2.0:${PORTSDIR}/databases/db2
 db3_DEPENDS=	db3.3:${PORTSDIR}/databases/db3
@@ -159,17 +177,35 @@
 db41_DEPENDS=	db41.1:${PORTSDIR}/databases/db41
 db42_DEPENDS=	db-4.2.2:${PORTSDIR}/databases/db42
 db43_DEPENDS=	db-4.3.0:${PORTSDIR}/databases/db43
-# Detect db4 versions by finding some files
+db44_DEPENDS=	db-4.4.0:${PORTSDIR}/databases/db44
+# Detect db versions by finding some files
+db3_FIND=	${PREFIX}/include/db3/db.h
 db40_FIND=	${PREFIX}/include/db4/db.h
 db41_FIND=	${PREFIX}/include/db41/db.h
 db42_FIND=	${PREFIX}/include/db42/db.h
 db43_FIND=	${PREFIX}/include/db43/db.h
+db44_FIND=	${PREFIX}/include/db44/db.h
 
-# For specifying 40+ 41+ 42+
-_DB_40P=	40 41 42 43
-_DB_41P=	41 42 43
-_DB_42P=	42 43
-
+# For specifying [3, 40, 41, ..]+
+_DB_3P=		3 40 41 42 43 44
+_DB_40P=	40 41 42 43 44
+_DB_41P=	41 42 43 44
+_DB_42P=	42 43 44
+_DB_43P=	43 44
+
+# Override the global WITH_BDB_VER with the
+# port specific <UNIQUENAME>_WITH_BDB_VER
+.if defined(${UNIQUENAME:U:S,-,_,}_WITH_BDB_VER)
+WITH_BDB_VER=	${${UNIQUENAME:U:S,-,_,}_WITH_BDB_VER}
+.endif
+
+.if defined(WITH_BDB_VER)
+. if ${WITH_BDB_VER} == 4
+USE_BDB=	40
+. elif ${WITH_BDB_VER} != 1
+USE_BDB=	${WITH_BDB_VER}
+. endif
+.endif
 _WANT_BDB_VER=	${USE_BDB}
 
 # Assume the default bdb version as 41
@@ -179,34 +215,125 @@
 
 # Detect bdb version
 _FOUND=	no
+_BDB_BROKEN=	no
 
+# Override the user defined WITH_BDB_VER with the WANT_BDB_VER
+.if defined(WANT_BDB_VER)
+.for bdb in ${_DB_PORTS}
+.if ${WANT_BDB_VER} == "${bdb}" && ${_FOUND} == "no"
+_FOUND=	${WANT_BDB_VER}
+.endif
+.endfor
+USE_BDB=	${WANT_BDB_VER}
+.else
 .for bdb in ${_DB_PORTS}
 .if ${_WANT_BDB_VER} == "${bdb}" && ${_FOUND} == "no"
 _MATCHED_DB_VER:=	${bdb:S/+//}
 . if ${_MATCHED_DB_VER} == "${bdb}"
 # USE_BDB is exactly specified
-LIB_DEPENDS+=	${db${bdb}_DEPENDS}
-_FOUND=	yes
+_FOUND=	${bdb}
 .else
 # USE_BDB is specified as VER+
-.  for db4 in ${_DB_${_MATCHED_DB_VER}P}
-.   if exists(${db${db4}_FIND}) && ${_FOUND} == "no"
-LIB_DEPENDS+=   ${db${db4}_DEPENDS}
-_FOUND=	yes
+.  for dbx in ${_DB_${_MATCHED_DB_VER}P}
+.   if exists(${db${dbx}_FIND})
+_BRKDB=	no
+# Skip versions we are broken with
+.    if defined(BROKEN_WITH_BDB)
+_CHK_BDB:=	${dbx}
+.     for BRKDB in ${BROKEN_WITH_BDB}
+.      if ${_CHK_BDB} == "${BRKDB}"
+_BRKDB= yes
+.      endif
+.     endfor
+.    endif
+.    if ${_BRKDB} == no
+.     if defined(WITH_BDB_HIGHEST)
+# Use the highest version of Berkeley DB found
+_FOUND=	${dbx}
+.     elif ${_FOUND} == no
+# Use the first Berkeley DB found
+_FOUND=	${dbx}
+.     endif
+.    endif
 .   endif
 .  endfor
 .  if ${_FOUND} == "no"
 # No existing db4 version is detected in system
-LIB_DEPENDS+=	${db${_MATCHED_DB_VER}_DEPENDS}
-_FOUND=	yes
+_FOUND=	${_MATCHED_DB_VER}
 .  endif
 . endif
 .endif
 .endfor
+.endif
 
 # USE_BDB is specified incorrectly, so mark this as IGNORE
 .if ${_FOUND} == "no"
 IGNORE=	"Unknown bdb version: ${USE_BDB}"
+.else
+# Now check if we can use it
+. if defined(BROKEN_WITH_BDB)
+.  for VER in ${BROKEN_WITH_BDB}
+_CHK_PLUS:=	${VER:S/+//}
+# BROKEN_WITH_BDB is specified as VER+
+.   if ${_CHK_PLUS}  != "${VER}"
+.    if ${_FOUND} == "${_CHK_PLUS}
+_BDB_BROKEN=	yes
+.    else
+.     for VER_P in ${_DB_${_CHK_PLUS}P}
+.      if ${_FOUND} == "${VER_P}"
+_BDB_BROKEN=	yes
+.      endif
+.     endfor
+.    endif
+.   elif ${_FOUND} == "${VER}"
+_BDB_BROKEN=	yes
+.   endif
+.  endfor
+. endif
+. if ${_BDB_BROKEN} == "yes"
+IGNORE= "Does not work with Berkeley DB ${_FOUND} \(${BROKEN_WITH_BDB} not supported\)"
+. else
+# Now add the dependancy on Berkeley DB ${_FOUND) version
+LIB_DEPENDS+=	${db${_FOUND}_DEPENDS}
+.  if ${_FOUND} == 40
+BDB_LIB_NAME=		db4
+BDB_LIB_CXX_NAME=	db4_cxx
+BDB_INCLUDE_DIR=	${LOCALBASE}/include/db4
+.  elif ${_FOUND} == 42
+BDB_LIB_NAME=		db-4.2
+BDB_LIB_CXX_NAME=	db_cxx-4.2
+BDB_LIB_DIR=		${LOCALBASE}/lib/db42
+.  elif ${_FOUND} == 43
+BDB_LIB_NAME=		db-4.3
+BDB_LIB_CXX_NAME=	db_cxx-4.3
+BDB_LIB_DIR=		${LOCALBASE}/lib/db43
+.  elif ${_FOUND} == 44
+BDB_LIB_NAME=		db-4.4
+BDB_LIB_CXX_NAME=	db_cxx-4.4
+BDB_LIB_DIR=		${LOCALBASE}/lib/db44
+.  endif
+BDB_LIB_NAME?=		db${_FOUND}
+BDB_LIB_CXX_NAME?=	db${_FOUND}_cxx
+BDB_INCLUDE_DIR?=	${LOCALBASE}/include/db${_FOUND}
+BDB_LIB_DIR?=		${LOCALBASE}/lib
+. endif
+.endif
+
+# Obsolete variables
+.if defined(OBSOLETE_BDB_VAR)
+. for var in ${OBSOLETE_BDB_VAR}
+.  if defined(${var})
+BAD_VAR+=	${var},
+.  endif
+. endfor
+. if defined(BAD_VAR)
+_IGNORE_MSG=	Obsolete variable(s) ${BAD_VAR} use WITH_BDB_VER or ${UNIQUENAME:U:S,-,_,}_WITH_BDB_VER to select Berkeley DB version
+. endif
+. if defined(IGNORE)
+IGNORE+= ${_IGNORE_MSG}
+. else
+IGNORE=	${_IGNORE_MSG}
+. endif
 .endif
 
 .endif # USE_BDB