Date: Fri, 3 Aug 2007 10:33:56 +0400 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org Cc: sergei@FreeBSD.org Subject: Re: ports/115153: ports/sysutils/cfengine patch for bdb <= 4.3 Message-ID: <20070803063355.GH50228@void.codelabs.ru> In-Reply-To: <200708021810.l72IACdv041997@freefall.freebsd.org> References: <20070802175219.194AD1AF419@void.codelabs.ru> <200708021810.l72IACdv041997@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Good day. Found that situation is even worse that I described earlier: my cfengine was linked against the db-4.0, the smallest version that were present in the system. And I had requested db-4.3. I had fixed the Makefile and made completely new 'files/patch-configure' to compile CFEngine with the requested BDB version. I just replaced all checks for various BDB versions with the checks for the version, requested by the port. Here is the quick test log of the patch: --- buildtest.log begins here --- The following BDB libraries are present in the system: ----- $ ls -d /var/db/pkg/db* /var/db/pkg/db3-3.3.11_3,1 /var/db/pkg/db42-4.2.52_5 /var/db/pkg/db4-4.0.14_1,1 /var/db/pkg/db43-4.3.29_1 ----- Original port contents, compiled using 'WITH_BDB_VER=43': ----- $ ldd /usr/local/sbin/cfservd /usr/local/sbin/cfservd: libdb4.so.0 => /usr/local/lib/libdb4.so.0 (0x280d8000) libcrypto.so.5 => /usr/local/lib/libcrypto.so.5 (0x2815e000) libm.so.4 => /lib/libm.so.4 (0x2827b000) libpthread.so.2 => /lib/libpthread.so.2 (0x28291000) libc.so.6 => /lib/libc.so.6 (0x282b6000) ----- Patched port contents, compiled using 'WITH_BDB_VER=43': ----- $ ldd /usr/local/sbin/cfservd /usr/local/sbin/cfservd: libdb-4.3.so.0 => /usr/local/lib/libdb-4.3.so.0 (0x280d8000) libcrypto.so.5 => /usr/local/lib/libcrypto.so.5 (0x281a3000) libm.so.4 => /lib/libm.so.4 (0x282c0000) libpthread.so.2 => /lib/libpthread.so.2 (0x282d6000) libc.so.6 => /lib/libc.so.6 (0x282fb000) ----- Patched port contents, compiled using 'WITH_BDB_VER=44' (BDB 4.4 was installed as a dependency): ----- $ ldd /usr/local/sbin/cfservd /usr/local/sbin/cfservd: libdb-4.4.so.0 => /usr/local/lib/libdb-4.4.so.0 (0x280d8000) libcrypto.so.5 => /usr/local/lib/libcrypto.so.5 (0x281ba000) libm.so.4 => /lib/libm.so.4 (0x282d7000) libpthread.so.2 => /lib/libpthread.so.2 (0x282ed000) libc.so.6 => /lib/libc.so.6 (0x28312000) ----- Patched port contents, compiled using 'WITH_BDB_VER=42': ----- $ ldd /usr/local/sbin/cfservd /usr/local/sbin/cfservd: libdb-4.2.so.2 => /usr/local/lib/libdb-4.2.so.2 (0x280d8000) libcrypto.so.5 => /usr/local/lib/libcrypto.so.5 (0x28196000) libm.so.4 => /lib/libm.so.4 (0x282b3000) libpthread.so.2 => /lib/libpthread.so.2 (0x282c9000) libc.so.6 => /lib/libc.so.6 (0x282ee000) ----- All compilation variants of the patched port were quickly tested (the cfservd functionality only) and they worked fine. --- buildtest.log ends here --- Makefile patch (PORTREVISION was not bumped): --- Makefile.patch begins here --- --- Makefile.orig Thu Aug 2 22:27:59 2007 +++ Makefile Fri Aug 3 08:53:25 2007 @@ -43,6 +43,9 @@ @${REINPLACE_CMD} -e s,-pthread,${PTHREAD_CFLAGS},g \ -e s,-lpthread,${PTHREAD_LIBS},g \ -e s,lpthread,${PTHREAD_LIBS},g \ + -e s,__BDB_INCLUDE_DIR__,${BDB_INCLUDE_DIR},g \ + -e s,__BDB_LIB_DIR__,${BDB_LIB_DIR},g \ + -e s,__BDB_LIB_NAME__,${BDB_LIB_NAME},g \ ${WRKSRC}/configure .include <bsd.port.mk> --- Makefile.patch ends here --- New file 'files/patch-configure' (it incoporates the old fix concerning libpub): --- patch-configure begins here --- --- configure.orig Tue May 29 22:07:07 2007 +++ configure Fri Aug 3 09:07:26 2007 @@ -9569,13 +9569,13 @@ if test "x$BERKELEY_DB_DIR" = "xdefault" ; then - for d in $prefix /opt /usr/local /usr; do - for v in db-4 db4 db3 db db40; do + for d in system; do + for v in __BDB_LIB_NAME__; do - if test -f "$d/include/$v/db.h" ; then - echo "Found header in $d/include/$v " - test "x$d" != "x/usr" && BERKELEY_DB_LDFLAGS="-L$d/lib" - BERKELEY_DB_CFLAGS="-I$d/include/$v" + if test -f "__BDB_INCLUDE_DIR__/db.h" ; then + echo "Found header in __BDB_INCLUDE_DIR__ " + BERKELEY_DB_LDFLAGS="-L__BDB_LIB_DIR__" + BERKELEY_DB_CFLAGS="-I__BDB_INCLUDE_DIR__" late_LIBS=$LIBS # In RedHat 8, for instance, we have /usr/include/db4 # and libdb-4.0.a. Debian has /usr/lib/libdb-4.1.a, for @@ -9613,7 +9613,7 @@ return 0; } _ACEOF -for ac_lib in '' db-4 db4 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0; do +for ac_lib in '' __BDB_LIB_NAME__; do if test -z "$ac_lib"; then ac_res="none required" else @@ -9745,7 +9745,7 @@ done BERKELEY_DB_LIB="-ldb" - for v in db4.4 db44 db41 db40 db4 db33 db32 db3 db; do + for v in __BDB_LIB_NAME__; do if test -f "$BERKELEY_DB_DIR/lib/lib$v.so"; then BERKELEY_DB_LIB="-l$v" break @@ -17933,7 +17933,7 @@ -LIBS="-L../pub -lpub $LIBS" +LIBS="../pub/libpub.a $LIBS" { echo "$as_me:$LINENO: checking Checking for GCC Specific compile flags" >&5 --- patch-configure ends here --- Mark Burgess accepted my second patch against the cfshow.c: http://svn.iu.hio.no/viewvc/trunk/src/cfshow.c?root=Cfengine-2&r1=418&r2=433 so the initial patch (files/patch-CF_OLD_DB) will likely disappear for the next cfengine upstream version. -- Eygene
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070803063355.GH50228>