Subject: pkg/37293: misc/rpm fails to build under Linux
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <cheusov@tut.by>
List: pkgsrc-bugs
Date: 11/07/2007 03:30:00
>Number: 37293
>Category: pkg
>Synopsis: misc/rpm fails to build under Linux
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 07 03:30:00 +0000 2007
>Originator: cheusov@tut.by
>Release: NetBSD 4.0_RC3
>Organization:
>Environment:
System: NetBSD chen.chizhovka.net 4.0_RC3 NetBSD 4.0_RC3 (GENERIC) #2: Sat Oct 20 21:41:02 EEST 2007 cheusov@chen.chizhovka.net:/srv/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
misc/rpm fails to build under Linux:
dump.c: In function 'main':
dump.c:24: warning: incompatible implicit declaration of built-in function 'exit'
dump.c:30: warning: incompatible implicit declaration of built-in function 'exit'
gcc -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -L/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/lib -L/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/build -L/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/misc dump.o ../lib/librpm.a -lz -o dump
gcc -I/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4 -I/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4 -O2 -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/db4 -DHAVE_CONFIG_H -I/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/lib -I/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/misc -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/db4 -c -o dumpdb.o dumpdb.c
gcc -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -L/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/lib -L/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/build -L/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/misc dumpdb.o ../lib/librpm.a -lz -o dumpdb
../lib/librpm.a(dbindex.o): In function `dbiOpenIndex':
dbindex.c:(.text+0x395): undefined reference to `__db185_open'
collect2: ld returned 1 exit status
gmake[1]: *** [dumpdb] Error 1
gmake[1]: Leaving directory `/tmp/obj_pkgsrc/misc/rpm/work/rpm-2.5.4/tools'
gmake: *** [make-subdirs] Error 1
*** Error code 2
>Fix:
I tested the following patch under Linux and NetBSD.
Is it time to upgrade misc/rpm?
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/misc/rpm/Makefile,v
retrieving revision 1.65
diff -u -r1.65 Makefile
--- Makefile 13 May 2007 00:55:14 -0000 1.65
+++ Makefile 7 Nov 2007 03:24:24 -0000
@@ -30,6 +30,9 @@
RPMDIR= ${RPM_DB_PREFIX}/lib/rpm
FILES_SUBST+= RPMDIR=${RPMDIR:Q}
+MAKE_ENV+= LIBDB=${BDB_LIBS:Q}
+LDFLAGS+= ${BDB_LIBS:Q}
+
.include "../../mk/bsd.prefs.mk"
post-configure:
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/misc/rpm/distinfo,v
retrieving revision 1.9
diff -u -r1.9 distinfo
--- distinfo 18 Feb 2007 11:17:03 -0000 1.9
+++ distinfo 7 Nov 2007 03:24:24 -0000
@@ -6,7 +6,7 @@
SHA1 (patch-aa) = 3ee3193cc8e9043017b1f507b606c72acab77ddb
SHA1 (patch-ab) = 63635f4f7fd96b4e7a40bfbaffd5673b40db3a13
SHA1 (patch-ac) = ed4545088fc0cc56fd577fbc122a073f12d751aa
-SHA1 (patch-ba) = c6a062e733e09eb56144177444188dcaf0cfcb06
+SHA1 (patch-ba) = bbefebc9be0a025f5eba5c39c3fa1f7bbd13f433
SHA1 (patch-bb) = dc0ea2dd366b793003218858ca3d67bc285a2089
SHA1 (patch-bd) = 1c9cd4587314ee45bccdf08c6ecaabbe641aaa5d
SHA1 (patch-be) = ed237b47e9f8033e8fdfc4258a1bdd5ebaff469e
Index: patches/patch-ba
===================================================================
RCS file: /cvsroot/pkgsrc/misc/rpm/patches/patch-ba,v
retrieving revision 1.2
diff -u -r1.2 patch-ba
--- patches/patch-ba 24 Jul 2004 04:43:10 -0000 1.2
+++ patches/patch-ba 7 Nov 2007 03:24:24 -0000
@@ -1,8 +1,8 @@
$NetBSD: patch-ba,v 1.2 2004/07/24 04:43:10 grant Exp $
---- Makefile.in.orig 1998-09-12 23:16:32.000000000 +1000
+--- Makefile.in.orig 1998-09-12 16:16:32.000000000 +0300
+++ Makefile.in
-@@ -30,8 +30,8 @@ ETCDIR=$(ROOT)/etc
+@@ -30,14 +30,14 @@ ETCDIR=$(ROOT)/etc
# -----------------------------------------------------------------------
@@ -13,6 +13,13 @@
INSTSUBDIRS = lib scripts @PO@
OTHERSUBDIRS = docs autodeps
OBJS = rpm.o query.o install.o verify.o checksig.o ftp.o url.o build.o \
+ @GETTEXTSTUB@
+ PROGS = @RPM@ rpm2cpio
+-LIBS = @LIBS@ @LIBINTL@ @LIBDL@
++LIBS = @LIBS@ @LIBINTL@ @LIBDL@ $(LIBDB)
+ LOADLIBES = -lrpmbuild -lpopt -lrpm @LIBMISC@
+ LDFLAGS_STATIC = @LDFLAGS_STATIC@
+
@@ -124,21 +124,19 @@ install: all
[ -d $(installprefix)/$(RPMCONFIGDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(RPMCONFIGDIR)