[Rpm-maint] nss/nspr location for configure

2008-11-26 Thread Jan Engelhardt
Hi,


rpm's configure script cannot find nss/nspr even though these are 
installed. As it turns out, configure.ac does not use nss/nspr's 
pkg-config files nor the nspr-config utility nor offers a way to 
pinpoint to the location.

This kinda makes it impossible to compile rpm on openSUSE right now as 
the headers are in /usr/include/nss3 and /usr/include/nspr4, 
respectively.
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] nss/nspr location for configure (patch)

2008-11-26 Thread Jan Engelhardt
On Wednesday 2008-11-26 22:28, Jan Engelhardt wrote:

rpm's configure script cannot find nss/nspr even though these are 
installed. As it turns out, configure.ac does not use nss/nspr's 
pkg-config files nor the nspr-config utility nor offers a way to 
pinpoint to the location.

This kinda makes it impossible to compile rpm on openSUSE right now as 
the headers are in /usr/include/nss3 and /usr/include/nspr4, 
respectively.


commit c736d5be553174d12990cc193b72c4c3cadb6a0c
Author: Jan Engelhardt [EMAIL PROTECTED]
Date:   Wed Nov 26 22:46:58 2008 +0100

build: use pkg-config for nss/nspr

Signed-off-by: Jan Engelhardt [EMAIL PROTECTED]
---
 Makefile.am|8 
 build/Makefile.am  |2 +-
 lib/Makefile.am|4 ++--
 python/Makefile.am |4 ++--
 rpmio/Makefile.am  |4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4b26751..4adda03 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,7 +29,7 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) 
-I$(top_builddir)/include/
 AM_CPPFLAGS += -I$(top_srcdir)/build
 AM_CPPFLAGS += -I$(top_srcdir)/lib
 AM_CPPFLAGS += -I$(top_srcdir)/rpmio
-AM_CPPFLAGS += @WITH_NSS_INCLUDE@
+AM_CPPFLAGS += ${libnspr_CFLAGS} ${libnss_CFLAGS}
 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
 AM_CPPFLAGS += -I$(top_srcdir)/misc
 AM_CPPFLAGS += @WITH_LIBELF_INCLUDE@
@@ -89,16 +89,16 @@ DISTCLEANFILES += find-requires
 rpm_SOURCES =  rpmqv.c debug.h system.h
 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK 
-DIAM_RPMQV
 rpm_LDADD =build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
-rpm_LDADD +=   @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ 
@WITH_ZLIB_LIB@
+rpm_LDADD +=   @WITH_LIBELF_LIB@ ${libnspr_LIBS} ${libnss_LIBS} 
@WITH_POPT_LIB@ @WITH_ZLIB_LIB@
 
 rpmbuild_SOURCES = build.c rpmqv.c build.h debug.h system.h
 rpmbuild_CPPFLAGS =$(AM_CPPFLAGS) -DIAM_RPMBT
 rpmbuild_LDADD =   build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
-rpmbuild_LDADD +=  @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ 
@WITH_ZLIB_LIB@
+rpmbuild_LDADD +=  @WITH_LIBELF_LIB@ ${libnspr_LIBS} ${libnss_LIBS} 
@WITH_POPT_LIB@ @WITH_ZLIB_LIB@
 
 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
 rpm2cpio_LDADD =   lib/librpm.la rpmio/librpmio.la
-rpm2cpio_LDADD +=  @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ 
@WITH_ZLIB_LIB@
+rpm2cpio_LDADD +=  @WITH_LIBELF_LIB@ ${libnspr_LIBS} ${libnss_LIBS} 
@WITH_POPT_LIB@ @WITH_ZLIB_LIB@
 
 
 if LIBELF
diff --git a/build/Makefile.am b/build/Makefile.am
index d03afef..61923fa 100644
--- a/build/Makefile.am
+++ b/build/Makefile.am
@@ -1,7 +1,7 @@
 # Makefile for rpmbuild library.
 
 AM_CPPFLAGS =  -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
-AM_CPPFLAGS += @WITH_NSS_INCLUDE@
+AM_CPPFLAGS += ${libnspr_CFLAGS} ${libnss_CFLAGS}
 AM_CPPFLAGS += @WITH_MAGIC_INCLUDE@
 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
 AM_CPPFLAGS += @WITH_LIBELF_INCLUDE@
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 982fa73..f799b4c 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -3,7 +3,7 @@
 include $(top_srcdir)/rpm.am
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
-AM_CPPFLAGS += @WITH_NSS_INCLUDE@
+AM_CPPFLAGS += ${libnspr_CFLAGS} ${libnss_CFLAGS}
 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
 AM_CPPFLAGS += @WITH_SQLITE3_INCLUDE@
 AM_CPPFLAGS += -I$(top_srcdir)/misc
@@ -42,7 +42,7 @@ librpm_la_LDFLAGS = -release 4.6
 
 librpm_la_LIBADD = \
$(top_builddir)/rpmio/librpmio.la \
-   @WITH_NSS_LIB@ \
+   ${libnspr_LIBS} ${libnss_LIBS} \
@WITH_POPT_LIB@ \
@WITH_SELINUX_LIB@ \
@WITH_SQLITE3_LIB@ \
diff --git a/python/Makefile.am b/python/Makefile.am
index 7765051..aa3a42c 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -6,7 +6,7 @@ if PYTHON
 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
 AM_CPPFLAGS += -I$(top_srcdir)/python
 AM_CPPFLAGS += @WITH_LIBELF_INCLUDE@
-AM_CPPFLAGS += @WITH_NSS_INCLUDE@
+AM_CPPFLAGS += ${libnspr_CFLAGS} ${libnss_CFLAGS}
 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
 AM_CPPFLAGS += -I$(top_srcdir)/misc
 AM_CPPFLAGS += [EMAIL PROTECTED]@
@@ -19,7 +19,7 @@ _rpmmodule_la_LIBADD = \
$(top_builddir)/build/librpmbuild.la \
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmio/librpmio.la \
-   @WITH_NSS_LIB@ \
+   ${libnspr_LIBS} ${libnss_LIBS} \
@WITH_POPT_LIB@ \
@WITH_LIBELF_LIB@ \
@WITH_PYTHON_LIB@
diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am
index 5edb68b..df48a25 100644
--- a/rpmio/Makefile.am
+++ b/rpmio/Makefile.am
@@ -1,7 +1,7 @@
 # Makefile for rpm library.
 
 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
-AM_CPPFLAGS += @WITH_NSS_INCLUDE@
+AM_CPPFLAGS += ${libnspr_CFLAGS} ${libnss_CFLAGS}
 AM_CPPFLAGS += @WITH_LUA_INCLUDE@
 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
 AM_CPPFLAGS += -I$(top_srcdir)/misc
@@ -22,7 +22,7 

[Rpm-maint] rpm: support lzip compression for %setup (patch)

2008-11-26 Thread Jan Engelhardt

LZIP is the new stable lzma compression utility 
( http://freshmeat.net/p/lzip/ ) with magic bytes and checksum.

===

commit edacdf5e91e25393d6394e88d6d920b3b1cc0cac
Author: Jan Engelhardt [EMAIL PROTECTED]
Date:   Wed Nov 26 22:50:50 2008 +0100

Support LZIP compression
---
 build/parsePrep.c   |3 +++
 configure.ac|   15 +++
 macros.in   |1 +
 rpmio/macro.c   |3 +++
 rpmio/rpmfileutil.c |3 +++
 rpmio/rpmfileutil.h |3 ++-
 6 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/build/parsePrep.c b/build/parsePrep.c
index 34906c8..cc1738d 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -218,6 +218,9 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly)
case COMPRESSED_LZMA:
t = %{__lzma} -dc;
break;
+   case COMPRESSED_LZIP:
+   t = %__lzip -dc;
+   break;
}
zipper = rpmGetPath(t, NULL);
if (needtar) {
diff --git a/configure.ac b/configure.ac
index 6779968..36dc970 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,7 @@ AC_SUBST(__ID_U)
 
 AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
 AC_PATH_PROG(__LZMA, lzma, /usr/bin/lzma, $MYPATH)
+AC_PATH_PROG([__LZIP], [lzip], [/usr/bin/lzip], [$MYPATH])
 AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
 AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
 AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
@@ -302,18 +303,8 @@ AM_CONDITIONAL(LIBDWARF,[test $WITH_LIBDWARF = yes])
 # We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS 
 # have a header named nss.h... so make extra check for NSS's sechash.h 
 # which we use too and hopefully is slightly more unique to NSS.
-WITH_NSS_INCLUDE=
-WITH_NSS_LIB=
-AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [
-  AC_MSG_ERROR([missing required NSPR / NSS header])
-])
-AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
-  WITH_NSS_LIB=-lnss3
-], [
-  AC_MSG_ERROR([missing required NSS library 'nss3'])
-])
-AC_SUBST(WITH_NSS_INCLUDE)
-AC_SUBST(WITH_NSS_LIB)
+PKG_CHECK_MODULES([libnspr], [nspr])
+PKG_CHECK_MODULES([libnss], [nss])
 
 #=
 # Check for magic library.
diff --git a/macros.in b/macros.in
index c3c5025..cac51b1 100644
--- a/macros.in
+++ b/macros.in
@@ -47,6 +47,7 @@
 %__install @__INSTALL@
 %__ln_s@LN_S@
 %__lzma@__LZMA@
+%__lzip@__LZIP@
 %__make@__MAKE@
 %__mkdir   @__MKDIR@
 %__mkdir_p @MKDIR_P@
diff --git a/rpmio/macro.c b/rpmio/macro.c
index afe41cb..f0fe9c1 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -981,6 +981,9 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
 case COMPRESSED_LZMA:
 sprintf(be, %%__lzma -dc %s, b);
 break;
+case COMPRESSED_LZIP:
+   sprintf(be, %%__lzip -dc %s, b);
+   break;
}
b = be;
 } else if (STREQ(S, f, fn)) {
diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c
index d0f4646..b2c22b4 100644
--- a/rpmio/rpmfileutil.c
+++ b/rpmio/rpmfileutil.c
@@ -360,6 +360,9 @@ int rpmFileIsCompressed(const char * file, 
rpmCompressedMagic * compressed)
   (magic[4] == 0x5a)  (magic[5] == 0x00)) {
/* new style lzma with magic */
*compressed = COMPRESSED_LZMA;
+} else if (magic[0] == 'L'  magic[1] == 'Z' 
+magic[2] == 'I'  magic[3] == 'P') {
+*compressed = COMPRESSED_LZIP;
 } else if (((magic[0] == 0037)  (magic[1] == 0213)) || /* gzip */
((magic[0] == 0037)  (magic[1] == 0236)) ||   /* old gzip */
((magic[0] == 0037)  (magic[1] == 0036)) ||   /* pack */
diff --git a/rpmio/rpmfileutil.h b/rpmio/rpmfileutil.h
index 471509e..74f10ff 100644
--- a/rpmio/rpmfileutil.h
+++ b/rpmio/rpmfileutil.h
@@ -18,7 +18,8 @@ typedef enum rpmCompressedMagic_e {
 COMPRESSED_OTHER   = 1,/*! gzip can handle */
 COMPRESSED_BZIP2   = 2,/*! bzip2 can handle */
 COMPRESSED_ZIP = 3,/*! unzip can handle */
-COMPRESSED_LZMA= 4 /*! lzma can handle */
+COMPRESSED_LZMA= 4,/*! lzma can handle */
+COMPRESSED_LZIP= 5,
 } rpmCompressedMagic;
 
 /** \ingroup rpmfileutil

___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] nss/nspr location for configure

2008-11-26 Thread Ville Skyttä
On Wednesday 26 November 2008, Jan Engelhardt wrote:

 rpm's configure script cannot find nss/nspr even though these are
 installed. As it turns out, configure.ac does not use nss/nspr's
 pkg-config files

Unless I'm mistaken, upstream nss and nspr do not ship pkgconfig files, 
they're distro additions and thus depending on them could be fragile.  (I 
wonder if distro packagers haven't bothered to submit the *.pc they add 
upstream or if upstream has rejected them.)

 nor the nspr-config utility nor offers a way to 
 pinpoint to the location.

These on the other hand sound like something that should be fixed (and I see 
you already sent a patch).
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint