db: fix db3/db4 confusion by causing all packages to use virtual/db in db-4.3 4.3.29
authorJohn Bowler <jbowler@nslu2-linux.org>
Fri, 11 Nov 2005 07:15:36 +0000 (07:15 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Fri, 11 Nov 2005 07:15:36 +0000 (07:15 +0000)
  - The SleepyCat implementation of the Berkeley DB exists in OE in two different
  - versions, 3.2 and 4.3.  These appear to now be compatible (i.e. with the correct
  - settings db-4.3 can do everything db-3.2 can do and all packages compile with it).
  - The previous scheme of allowing both to be built (which was highly error prone)
  - has been removed and all db users now reference virtual/db.
  - Affects:
  - bogofilter, cyrus-*, openldap, perl, postfix, rpm

17 files changed:
packages/bogofilter/bogofilter_0.96.0.bb
packages/cyrus-imapd/cyrus-imapd_2.2.12.bb
packages/cyrus-sasl/cyrus-sasl_2.1.17.bb
packages/cyrus-sasl/cyrus-sasl_2.1.18.bb
packages/cyrus-sasl/cyrus-sasl_2.1.19.bb
packages/db/db-native_4.3.29.bb [new file with mode: 0644]
packages/db/db3-native_3.2.9.bb
packages/db/db3_3.2.9.bb
packages/db/db_4.3.29.bb [moved from packages/db/db_4.3.27.bb with 70% similarity]
packages/dsniff/dsniff_2.3.bb
packages/openldap/openldap_2.2.24.bb
packages/perl/perl-native_5.8.4.bb
packages/perl/perl-native_5.8.7.bb
packages/perl/perl.inc
packages/postfix/postfix-native_2.0.20.bb
packages/postfix/postfix_2.0.20.bb
packages/rpm/rpm_4.4.bb

index 55393c7..0b85c96 100644 (file)
@@ -1,11 +1,11 @@
 SECTION = "console/network"
-DEPENDS = "db3"
+DEPENDS = "virtual/db"
 RDEPENDS = "glibc-gconv glibc-gconv-iso8859-1"
 DESCRIPTION = "Bogofilter is a mail filter that classifies mail as spam or ham (non-spam) \
 by a statistical analysis of the message's header and content (body). \
 The program is able to learn from the user's classifications and corrections."
 LICENSE = "GPL"
-PR = "r4"
+PR = "r5"
 PRIORITY = "optional"
 
 SRC_URI = "http://download.sourceforge.net/bogofilter/bogofilter-${PV}.tar.bz2 \
index e1290ef..72dc846 100644 (file)
@@ -1,7 +1,7 @@
 SECTION = "console/network"
-DEPENDS = "cyrus-sasl db3"
+DEPENDS = "cyrus-sasl virtual/db"
 LICENSE = "BSD"
-PR = "r6"
+PR = "r7"
 DEPENDS += "install-native"
 
 SRC_URI = "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-${PV}.tar.gz \
@@ -18,16 +18,16 @@ inherit autotools update-rc.d
 INITSCRIPT_NAME = "cyrus"
 INITSCRIPT_PARAMS = "start 56 3 4 5 . stop 15 0 1 6 ."
 
+TARGET_LDFLAGS_append_thumb = " -lpthread"
 EXTRA_OECONF = "--with-auth=unix \
+               --with-dblib=berkeley \
+               --with-bdb-libdir=${STAGING_LIBDIR} \
+               --with-bdb-incdir=${STAGING_INCDIR} \
                --without-perl \
                --without-snmp"
 
 FILES_${PN} += "${prefix}/cyrus/bin"
 
-# Target only, the db4 headers are in include/db4, so *prepend* this
-# directory to the search path
-TARGET_CPPFLAGS =+ "-I${STAGING_DIR}/${TARGET_SYS}/include/db4"
-
 # All, lib/foo.c includes <config.h> from the top level directory and
 # is natively compiled
 BUILD_CPPFLAGS += " -I${S} -I${S}/et"
index f6cce56..381486b 100644 (file)
@@ -1,5 +1,5 @@
 SECTION = "console/network"
-DEPENDS = "db3"
+DEPENDS = "virtual/db"
 DESCRIPTION = "Generic client/server library for SASL authentication."
 LICENSE = "BSD"
 
index 5a1bf9f..0295b2e 100644 (file)
@@ -1,5 +1,5 @@
 SECTION = "console/network"
-DEPENDS = "db3"
+DEPENDS = "virtual/db"
 DESCRIPTION = "Generic client/server library for SASL authentication."
 LICENSE = "BSD"
 
index c76fe3e..90c44c9 100644 (file)
@@ -1,8 +1,8 @@
 SECTION = "console/network"
-DEPENDS = "db3 openssl"
+DEPENDS = "openssl virtual/db"
 DESCRIPTION = "Generic client/server library for SASL authentication."
 LICENSE = "BSD"
-PR = "r6"
+PR = "r7"
 
 SRC_URI = "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-${PV}.tar.gz \
           file://berkdb.m4.patch;patch=1"
@@ -11,9 +11,10 @@ inherit autotools
 
 acpaths = "-I ${S}/cmulocal -I ${S}/config -I ."
 CFLAGS_append = " -I${S}/include -I${S}/saslauthd/include"
+TARGET_LDFLAGS_append_thumb = " -lpthread"
 EXTRA_OECONF = "--enable-shared --enable-static --with-dblib=berkeley \
                --with-bdb-libdir=${STAGING_LIBDIR} \
-               --with-bdb-incdir=${STAGING_INCDIR}/db4 \
+               --with-bdb-incdir=${STAGING_INCDIR} \
                --without-pam \
                --without-opie --without-des"
 
diff --git a/packages/db/db-native_4.3.29.bb b/packages/db/db-native_4.3.29.bb
new file mode 100644 (file)
index 0000000..5aaeb43
--- /dev/null
@@ -0,0 +1,13 @@
+# This wrapper builds a native version of the SleepyCat
+# Berkeley DB for those packages which need it (e.g.
+# perl).
+SECTION = "libs"
+VIRTUAL_NAME = "virtual/db-native"
+CONFLICTS = "db3-native"
+#PR tracks the non-native package
+
+inherit native
+
+include db_${PV}.bb
+
+PACKAGES = ""
index 13c6063..44a8a5b 100644 (file)
@@ -1,4 +1,6 @@
 SECTION = "libs"
+VIRTUAL_NAME = "virtual/db-native"
+CONFLICTS = "db-native"
 inherit native
 include db3_${PV}.bb
 
index 4c78279..335d83c 100644 (file)
@@ -2,7 +2,14 @@ SECTION = "libs"
 DESCRIPTION = "Berkeley DB v3."
 HOMEPAGE = "http://www.sleepycat.com"
 LICENSE = "BSD Sleepycat"
-PR = "r1"
+PR = "r2"
+VIRTUAL_NAME ?= "virtual/db"
+CONFLICTS = "db"
+
+# it doesn't make any sense to have multiple relational
+# databases on an embedded machine, virtual/db allows
+# a build to select the desired one.
+PROVIDES += "${VIRTUAL_NAME}"
 
 SRC_URI = "ftp://sleepycat1.inetu.net/releases/db-${PV}.tar.gz \
           file://autofoo.patch;patch=1"
similarity index 70%
rename from packages/db/db_4.3.27.bb
rename to packages/db/db_4.3.29.bb
index 518fdde..ba11e12 100644 (file)
@@ -12,23 +12,30 @@ SECTION = "libs"
 DESCRIPTION = "Berkeley DB v4."
 HOMEPAGE = "http://www.sleepycat.com"
 LICENSE = "BSD Sleepycat"
-PR = "r1"
+VIRTUAL_NAME ?= "virtual/db"
+CONFLICTS = "db3"
+PR = "r0"
 
-SRC_URI = "http://downloads.sleepycat.com/${P}.tar.gz"
+SRC_URI = "http://downloads.sleepycat.com/db-${PV}.tar.gz"
+#SRC_URI_MD5 = "http://downloads.sleepycat.com/db-${PV}.tar.gz.md5"
 
 inherit autotools
 
-# At present virtual/db is only in the db4 file, but it
-# should probably be in the other candidates (db3, gdbm)
-# because it doesn't make any sense to have multiple
-# relational databases on an embedded machine...
-PROVIDES += " db4 virtual/db"
+# Put virtual/db in any appropriate provider of a
+# relational database, use it as a dependency in
+# place of a specific db and use:
+#
+# PREFERRED_PROVIDER_virtual/db
+#
+# to select the correct db in the build (distro) .conf
+PROVIDES += "${VIRTUAL_NAME}"
 
 # bitbake isn't quite clever enough to deal with sleepycat,
 # the distribution sits in the expected directory, but all
 # the builds must occur from a sub-directory.  The following
 # persuades bitbake to go to the right place
-S = "${WORKDIR}/${P}/build_unix"
+S = "${WORKDIR}/db-${PV}/dist"
+B = "${WORKDIR}/db-${PV}/build_unix"
 
 # The executables go in a separate package - typically there
 # is no need to install these unless doing real database
@@ -44,43 +51,39 @@ FILES_${PN}-bin = "${bindir}"
 FILES_${PN}-dev = "${includedir} ${libdir}"
 
 #configuration - set in local.conf to override
-DB4_CONFIG ?= "--enable-o_direct --enable-smallbuild"
+DB4_CONFIG ?= "--enable-o_direct --enable-smallbuild --enable-compat185"
+EXTRA_OECONF = "${DB4_CONFIG}"
+
 # Override the MUTEX setting here, the POSIX library is
 # the default - "POSIX/pthreads/library".
 # Don't ignore the nice SWP instruction on the ARM:
-EXTRA_OECONF = "${DB4_CONFIG}"
 # These enable the ARM assembler mutex code, this won't
 # work with thumb compilation...
 ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
 ARM_MUTEX_thumb = ""
-# NOTE: only tested on nslu2, should probably be _armeb
-EXTRA_OECONF_nslu2 = "${DB4_CONFIG} ${ARM_MUTEX}"
+MUTEX = ""
+MUTEX_arm = "${ARM_MUTEX}"
+MUTEX_armeb = "${ARM_MUTEX}"
+EXTRA_OECONF += "${MUTEX}"
 
 # Cancel the site stuff - it's set for db3 and destroys the
 # configure.
 CONFIG_SITE = ""
 do_configure() {
-       echo '#!/bin/sh' >${S}/configure
-       echo 'rm ${S}/configure' >>${S}/configure
-       echo 'exec ../dist/configure "$@"' >>${S}/configure
-       chmod a+x ${S}/configure
        oe_runconf
 }
 
 do_stage() {
        # The .h files get installed read-only, the autostage
        # function just uses cp -pPR, so do this by hand
-       # Install, for the moment, into include/db4 to avoid
-       # interfering with the db3 headers (which have the same
-       # name).  -I${STAGING_INCDIR}/db4 to use db4, as opposed
-       # to db3.
        rm -rf ${STAGE_TEMP}
        mkdir -p ${STAGE_TEMP}
        oe_runmake DESTDIR="${STAGE_TEMP}" install_include
-       mkdir -p ${STAGING_INCDIR}/db4
-       cp -pPRf ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}/db4
+       cp -pPRf ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}/.
        rm -rf ${STAGE_TEMP}
        oe_libinstall -so -C .libs libdb-4.3 ${STAGING_LIBDIR}
+       ln -sf libdb-4.3.so ${STAGING_LIBDIR}/libdb.so
+       ln -sf libdb-4.3.a ${STAGING_LIBDIR}/libdb.a
 }
 
 do_install_append() {
index fb820d7..21e7c39 100644 (file)
@@ -1,8 +1,9 @@
 SECTION = "console/network"
 DESCRIPTION = "dsniff is a collection of tools for network auditing and penetration testing."
 LICENSE = "BSD"
+PR = "r1"
 
-DEPENDS = "db3 libpcap libnet libnids openssl"
+DEPENDS = "virtual/db libpcap libnet libnids openssl"
 
 SRC_URI = "http://www.monkey.org/~dugsong/dsniff/dsniff-${PV}.tar.gz \
           file://configure.patch;patch=1"
index a2fd912..7c1f7f8 100644 (file)
@@ -12,7 +12,7 @@ PRIORITY = "optional"
 LICENSE = "OpenLDAP"
 SECTION = "libs"
 
-PR = "r3"
+PR = "r4"
 
 SRC_URI = "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz"
 SRC_URI += " file://openldap-autoconf.patch;patch=1"
@@ -89,16 +89,12 @@ md = "${libexecdir}/openldap"
 # To disable this set all three of the following variables to <empty> in
 # a .conf file (this will allow ldbm to be build with gdbm).
 OPENLDAP_OPTION_bdb   ?= --enable-bdb=mod
-OPENLDAP_DEPENDS_bdb  ?= db4
+OPENLDAP_DEPENDS_bdb  ?= db
 OPENLDAP_PACKAGE_bdb  ?= "${PN}-backend-bdb"
 FILES_${PN}-backend-bdb = "${md}/back_bdb.so ${md}/back_bdb.la ${md}/back_bdb-*.so.*"
 EXTRA_OECONF += " ${OPENLDAP_OPTION_bdb}"
 DEPENDS += ${OPENLDAP_DEPENDS_bdb}
 PACKAGES += " ${OPENLDAP_PACKAGE_bdb}"
-# For the moment the db4 headers are in a sub-directory to give compatibility
-# with the identically named db3 headers in the standard staging directory,
-# *prepend* the subdirectory:
-TARGET_CPPFLAGS =+ "-I${STAGING_DIR}/${TARGET_SYS}/include/db4"
 #
 #--enable-dnssrv       enable dnssrv backend no|yes|mod no
 # This has no dependencies.
@@ -109,7 +105,7 @@ PACKAGES += " ${PN}-backend-dnssrv"
 #--enable-hdb          enable Hierarchical DB backend no|yes|mod no
 # This forces ldbm to use Berkeley too, remove to use gdbm
 OPENLDAP_OPTION_hdb   ?= --enable-hdb=mod
-OPENLDAP_DEPENDS_hdb  ?= db4
+OPENLDAP_DEPENDS_hdb  ?= db
 OPENLDAP_PACKAGE_hdb  ?= "${PN}-backend-hdb"
 FILES_${PN}-backend-hdb = "${md}/back_hdb.so ${md}/back_hdb.la ${md}/back_hdb-*.so.*"
 EXTRA_OECONF += " ${OPENLDAP_OPTION_hdb}"
index da30274..a4065e9 100644 (file)
@@ -1,11 +1,12 @@
 DESCRIPTION = "Perl is a popular scripting language."
 HOMEPAGE = "http://www.perl.org/"
 LICENSE = "Artistic|GPL"
+PR = "r1"
 
 SECTION = "libs"
 inherit native
 
-DEPENDS = "db3-native gdbm-native"
+DEPENDS = "virtual/db-native gdbm-native"
 
 SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz"
 S = "${WORKDIR}/perl-${PV}"
index cc2b7fc..4a28478 100644 (file)
@@ -2,11 +2,12 @@ DESCRIPTION = "Perl is a popular scripting language."
 MAINTAINER="David Karlstrom <daka@thg.se>"
 HOMEPAGE = "http://www.perl.org/"
 LICENSE = "Artistic|GPL"
+PR = "r1"
 
 SECTION = "libs"
 inherit native
 
-DEPENDS = "db3-native gdbm-native"
+DEPENDS = "virtual/db-native gdbm-native"
 
 SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz"
 S = "${WORKDIR}/perl-${PV}"
index 5ee5418..505249c 100644 (file)
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.perl.org/"
 LICENSE = "Artistic|GPL"
 SECTION = "devel"
 PRIORITY = "optional"
-DEPENDS = "db3 perl-native"
+DEPENDS = "virtual/db perl-native"
 
 SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \
        file://Makefile.patch;patch=1 \
index 99a1d9f..bf00fd8 100644 (file)
@@ -2,7 +2,7 @@ SECTION = "console/network"
 include postfix_${PV}.bb
 inherit native
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/postfix-${PV}"
-DEPENDS = "db3-native pcre-native"
+DEPENDS = "virtual/db-native pcre-native"
 export DIRS = "src/util src/global src/postconf"
 
 do_stage () {
index a676c3f..4a11a00 100644 (file)
@@ -1,7 +1,7 @@
 SECTION = "console/network"
-DEPENDS = "db3 pcre postfix-native"
+DEPENDS = "virtual/db pcre postfix-native"
 LICENSE = "IPL"
-PR = "r7"
+PR = "r8"
 
 SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
           file://${FILESDIR}/makedefs.patch;patch=1 \
@@ -18,7 +18,14 @@ inherit update-rc.d
 INITSCRIPT_NAME = "postfix"
 INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ."
 
-export SYSLIBS = "-lpcre -ldb -lnsl -lresolv ${LDFLAGS}"
+#FIXME: this is broken because the native build won't work on systems where
+# native bdb does not require libpthread.  ARM doesn't require libpthread
+# because it uses an assembler mutex implementation.
+LIBBDB_EXTRA = "-lpthread"
+LIBBDB_EXTRA_arm = ""
+LIBBDB_EXTRA_armeb = ""
+
+export SYSLIBS = "-lpcre -ldb ${LIBBDB_EXTRA} -lnsl -lresolv ${LDFLAGS}"
 export EXPORT = "AUXLIBS='-lpcre' CCARGS='-DHAS_PCRE ${CFLAGS}' OPT='' DEBUG='-g'"
 export CC_append = " -DHAS_PCRE ${CFLAGS}"
 export EXTRA_OEMAKE = "-e"
index aebdf29..ca60056 100644 (file)
@@ -3,8 +3,8 @@ HOMEPAGE = "http://rpm.org/"
 LICENSE = "LGPL GPL"
 MAINTAINER = "Chris Larson <kergoth@handhelds.org>"
 # NOTE: currently rpm doesn't support using an external popt,
-# file, or db3.  FIXME: patch it to support that.
-# DEPENDS = "db3 popt file zlib"
+# file, or virtual/db.  FIXME: patch it to support that.
+# DEPENDS = "virtual/db popt file zlib"
 DEPENDS = "zlib"
 PR = "r1"