[Rpm-maint] [rpm-software-management/rpm] build: reword "%changelog is missing" (PR #2943)

2024-03-01 Thread Jan Engelhardt
Despite openSUSE packages having a %changelog section at all times, rpm throws 
this error.

Turns out its just terribly worded. Fix that.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2943

-- Commit Summary --

  * build: reword %changelog is missing

-- File Changes --

M build/build.c (4)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2943.patch
https://github.com/rpm-software-management/rpm/pull/2943.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2943
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] No debugsource with static archives (Issue #2763)

2023-12-07 Thread Jan Engelhardt
>Works for me in a Podman container:

Please switch to static library build here.

```
if true; then
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2763#issuecomment-1844873148
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] No debugsource with static archives (Issue #2763)

2023-12-07 Thread Jan Engelhardt
Damn. I need to rework the testcase then. (The problem _does_ appear on 
https://build.opensuse.org/package/live_build_log/openSUSE:Factory/libzypp/standard/x86_64
 where libzypp-debugsource is missing e.g. Table.cc)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2763#issuecomment-1844870863
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] No debugsource with static archives (Issue #2763)

2023-12-06 Thread Jan Engelhardt
Distro is openSUSE Tumbleweed 20231202 amd64.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2763#issuecomment-1842487050
You are receiving this because you are subscribed to this thread.

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


[Rpm-maint] [rpm-software-management/rpm] No debugsource with static archives (Issue #2763)

2023-11-13 Thread Jan Engelhardt
Version: rpm-4.18.0, rpm-4.19.0

Input:

```
Name:   asd
Version:0
Release:0
Summary:asd
License:GPL
BuildRequires:  gcc
%debug_package

%description

%prep
%autosetup -Tc

%build
echo 'void fffunc(void){}' >x.c
gcc -c -fPIC -g x.c
if true; then
gcc -shared -o libx.so x.o
else
ar crs libx.a x.o
fi

%install
b="%buildroot"
mkdir -p "$b/%_libdir"
cp -a libx.* "$b/%_libdir/"

%files
%_libdir/libx.*
```

Observed output:

```
$rpmbuild -bb a.spec
...
Wrote: /home/jengelh/rpmbuild/RPMS/x86_64/asd-debugsource-0-0.x86_64.rpm
Wrote: /home/jengelh/rpmbuild/RPMS/x86_64/asd-0-0.x86_64.rpm
...
$ rpm -qlvp /home/jengelh/rpmbuild/RPMS/x86_64/asd-debugsource-0-0.x86_64.rpm
(contains no files)
```

Expected output:

Provide the source files in asd-debugsource. Is this even doable, or are static 
archives a dead-on-arrival case?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2763
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Turn %prep into a normal build script (Issue #2205)

2023-09-20 Thread Jan Engelhardt
> Hey, wait... those numbers don't add up. If there are 6300 `PatchN`-packages, 
> and 3525 use `%patchN` or `%patch N`, then at most 2775 are using 
> `%autosetup`.

It is possible to utilize both %autosetup and %patch (admittedly somewhat 
unusual):

```
%autosetup
%if 0%{?somecond}
%patch93 -R
%endif
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2205#issuecomment-1727686956
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] %_sharedstatedir bad value in macros (%{_prefix}/com instead of /var/lib (Issue #2092)

2023-09-20 Thread Jan Engelhardt
%_sharedstatedir defaults to `%_prefix/com` because configure.ac defaults to 
`--sharedstatedir='${prefix}/com`, it's that simple.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2092#issuecomment-1727659233
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: more finegrained BuildRequires (Issue #2631)

2023-09-20 Thread Jan Engelhardt
we have `Requires(post)`, `Requires(verify)` etc. (for the %post, %verify, etc. 
sections), so by extension, for syntactic coherence, it should be 
`BuildRequires(prep)`, `BuildRequires(check)`, etc.

The classic `BuildRequires: x` could then eventually be repurposed to mean 
`BuildRequires(source): x  BuildRequires(prep): x  BuildRequires(build): x  
BuildRequires(install): x` (for rpmbuild -bs, -bp, -bb, -bi), because that is 
what it already does today (only -bs behavior would be new).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2631#issuecomment-1727598335
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Stack overflow in glob() function (Issue #2605)

2023-08-09 Thread Jan Engelhardt
Closed #2605 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2605#event-10044103363
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Stack overflow in glob() function (Issue #2605)

2023-08-08 Thread Jan Engelhardt
No; I just didn't have a 4.19 build handy (and I ~~don't~~ didn't think that 
any of those VLAs were touched—turns out the one in `glob` *was* in  
66fa46c006bae0f28d93238b8f7f1c923645eee5).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2605#issuecomment-1669808233
You are receiving this because you are subscribed to this thread.

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


[Rpm-maint] [rpm-software-management/rpm] Stack overflow in glob() function (Issue #2605)

2023-08-08 Thread Jan Engelhardt
Version: 4.18 (openSUSE Tumbleweed 20230807)

Given a crafted input file, rpm blows the standard stack (typically 8 MB( with 
lots of recursion. A VLA in the stack frame is detrimental to that as well.

```
$ gdb /usr/bin/rpm
(gdb) r _buildenv
…
Program received signal SIGSEGV, Segmentation fault.
0x77f0d934 in glob (
pattern=pattern@entry=0x7f809d40 "didnt move in 1.5h (seen in 
libreoffice builds) BuildFlags: logidlelimit:5400 %endif %if 
%_project == openSUSE:Factory || %_project 
== openSUSE:Factory:NonFre"..., flags=flags@entry=5152, 
pglob=pglob@entry=0x7fffb8d0, errfunc=0x0) at 
/usr/src/debug/rpm-4.18.0/rpmio/rpmglob.c:165
165 char onealt[strlen(pattern) - 1];
```

bt:

```
#0  0x77f0d934 in glob (pattern=pattern@entry=0x7f809d40 "didnt 
move"..., flags=flags@entry=5152, pglob=pglob@entry=0x7fffb8d0, 
errfunc=0x0) at /usr/src/debug/rpm-4.18.0/rpmio/rpmglob.c:165
#1  0x77f0e2fc in glob (pattern=pattern@entry=0x7f826dd0 "didnt 
move"..., flags=flags@entry=5152, pglob=pglob@entry=0x7fffb8d0, 
errfunc=0x0) at /usr/src/debug/rpm-4.18.0/rpmio/rpmglob.c:213
…
#70 0x77f0e2fc in glob (pattern=0x777811ce "didnt move"..., 
flags=flags@entry=5120, pglob=pglob@entry=0x7fffb8d0, errfunc=0x0)
at /usr/src/debug/rpm-4.18.0/rpmio/rpmglob.c:213
#71 0x77f0f073 in rpmGlob (patterns=patterns@entry=0x7781b010 
", 
argcPtr=0x555c9798, argvPtr=0x555c97a0)
at /usr/src/debug/rpm-4.18.0/lib/manifest.c:121
#73 0x77f667b3 in tryReadManifest (eiu=0x555c9760) at 
/usr/src/debug/rpm-4.18.0/lib/rpminstall.c:333
#74 rpmInstall (ts=ts@entry=0x555c8970, ia=, 
fileArgv=) at /usr/src/debug/rpm-4.18.0/lib/rpminstall.c:565
#75 0x67e1 in main (argc=3, argv=) at 
/usr/src/debug/rpm-4.18.0/rpm.c:274
```
[buildenv.zip](https://github.com/rpm-software-management/rpm/files/12290206/buildenv.zip)


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2605
You are receiving this because you are subscribed to this thread.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Spec file versioning macros (Issue #2443)

2023-04-06 Thread Jan Engelhardt
Just a comment, the mapping between git tag and rpm is one way. You can't tell 
if the rpm-ized string `1.2.alpha` came from a git tag string `1.2~alpha`, 
`1.2-alpha` or `1.2.alpha`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2443#issuecomment-1498702266
You are receiving this because you are subscribed to this thread.

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


[Rpm-maint] [rpm-software-management/rpm] docs: update grammar in dependency_generators.md (PR #2395)

2023-02-20 Thread Jan Engelhardt

You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2395

-- Commit Summary --

  * docs: update grammar in dependency_generators.md

-- File Changes --

M docs/manual/dependency_generators.md (36)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2395.patch
https://github.com/rpm-software-management/rpm/pull/2395.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2395
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Unable to read old RPMs with 4.16 (#1762)

2021-08-22 Thread Jan Engelhardt
The current rpm version as shipped by openSUSE Tumbleweed (I hope it's not a 
patch of the distro):

```
» wget https://ftp.gwdg.de/pub/linux/suse/5.3/i386.de/suse/a1/aaa_base.rpm
» rpm -q rpm
rpm-4.16.1.3-3.1.x86_64
» rpm -qp aaa_base.rpm
error: aaa_base.rpm: invalid signature tag Archivesize (1046)
error: aaa_base.rpm: not an rpm package (or package manifest)
```

Meanwhile, the slightly older rpm from openSUSE Leap 15.2:

```
» rpm -q rpm
rpm-4.14.1-lp152.17.5.x86_64
» rpm -qp aaa_base.rpm 
aaa_base-98.8.12-0.i386
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1762___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


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

2008-12-18 Thread Jan Engelhardt

On Wednesday 2008-12-17 12:53, Panu Matilainen wrote:

 On Sat, 29 Nov 2008, Ralf Corsepius wrote:

 On Wed, 2008-11-26 at 22:55 +0100, Jan Engelhardt wrote:
  LZIP is the new stable lzma compression utility
 Pardon, but what is your legitimation to claim lzip to be
 the new stable lzma compression utility?

 No doubt, it is yet one another lzma compression utility.

 
  ( http://freshmeat.net/p/lzip/ ) with magic bytes and checksum.

 IMO, rpm should not adopt lzip  support, unless lzip has proven to be a
 functional and viable tool.

 See also:
 http://lists.gnu.org/archive/html/automake/2008-11/msg00076.html

 FWIW: I share Bob F's perspective. One lesson the mess about the
 original lzma has tought, is to be more reluctant on adoption of such
 compression tools.

 Wrt compressors for use in rpm payloads, absolutely agreed. Build-time support
 for uncompressing patches + tarballs for whatever formats is quite different
 issue and not harmful, but I see little point in having support for a format
 that barely exists in the wild (AFAICT).

There must be some kind of universal law that states that projects
(I'm not even talking 'bout compressors) that have N% attention
market share get even more attention no matter how 'bad' they are,
and that projects having less than those N% get no attention at all
because everybody claims no one uses it so what. That way, projects
that are just recently nascent can hardly take off no matter how
'good' they may be.


 Otherwise we should add LHA, ARJ and
 all the other myriads of known (un)compressors too...

These belong to the set of tools that faded away. LZH and ARJ were
absolutely normal in the 90s and not having an uncompressor for them
on your DOS system meant you suck, because, (at least ARJ) did often
provide better compression than PKZIP. As time passed, tools with
other distinct features arose, such as (as CRC was already there)
archive repair metadata, or even higher compression ratios.
___
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-29 Thread Jan Engelhardt

On Saturday 2008-11-29 08:27, Ralf Corsepius wrote:
On Thu, 2008-11-27 at 00:20 +0200, Ville Skyttä wrote:
 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.)

This patch is pointless.

Of course Ville is right that, as long as the .pc files (or
nspr-config) is not upstream, inclusion does not make sense, but the
patch clearly has a point, namely to have me NOT having to manually
find nspr in the depths of my distribution myself, but let it do that
automatically.
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[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