Subject: pkg/20331: build of rpm2pkg doesn't find rpmlib.h
To: None <>
From: None <>
List: netbsd-bugs
Date: 02/13/2003 06:57:39
>Number:         20331
>Category:       pkg
>Synopsis:       build of rpm2pkg doesn't find rpmlib.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 13 06:58:00 PST 2003
>Originator:     Pavel Cahyna
>Release:        1.6_STABLE
NetBSD omega 1.6_STABLE NetBSD 1.6_STABLE (GENERIC) #0: Fri Nov 22 12:41:51 MET 
2002     bouyer@java:/home/tmp/alpha/obj/sys/arch/alpha/compile/GENERIC alpha
when trying building rpm2pkg (with rpm properly installed) I get:
/usr/pkgsrc/pkgtools/rpm2pkg$ make
===> Building for rpm2pkg-1.3
/obj/pkg/work./pkgtools/rpm2pkg/work/.buildlink/bin/cc -O2 -mcpu=ev4 -mieee -I/usr/pkg/include  -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -o /obj/pkg/work./pkgtools/rpm2pkg/work/rpm2pkg  /usr/pkgsrc/pkgtools/rpm2pkg/files/rpm2pkg.c -lrpm -lintl -lz
/usr/pkgsrc/pkgtools/rpm2pkg/files/rpm2pkg.c:18: rpmlib.h: No such file or directory

rpmlib.h is actually located in /usr/pkg/include/rpm, note that this
directory is not included by -L... parameters in the compilation command above.

In fact, the Makefile tries to add ${BUILDLINK_CPPFLAGS.rpm} to CFLAGS
but BUILDLINK_CPPFLAGS.rpm is defined in ../../misc/rpm/
and this file is included only after setting CFLAGS, so it doesn't do 
what's intended.
see above.
apply the following patch to /usr/pkgsrc/pkgtools/rpm2pkg/Makefile:

--- Makefile.orig       Tue Dec 10 12:15:49 2002
+++ Makefile    Thu Feb 13 15:05:10 2003
@@ -15,6 +15,8 @@
 WRKSRC=                ${WRKDIR}
+.include "../../misc/rpm/"
 LIBS=          -lrpm -lintl -lz
@@ -27,6 +29,5 @@
        ${INSTALL_MAN} ${FILESDIR}/rpm2pkg.8 ${PREFIX}/man/man8
 .include "../../devel/zlib/"
-.include "../../misc/rpm/"
 .include "../../mk/"