Backport brpm-compress patch from MDV

This commit is contained in:
Denis Silakov 2012-12-27 15:07:21 +04:00
parent 55da4d8dae
commit ee945de1ab
2 changed files with 67 additions and 1 deletions

View file

@ -0,0 +1,59 @@
--- rpm-5.4.10/macros/mandriva.in.brpcomp~ 2012-12-26 08:56:29.522684255 +0100
+++ rpm-5.4.10/macros/mandriva.in 2012-12-26 09:37:59.322548015 +0100
@@ -137,8 +137,9 @@ end\
%_enable_debug_packages 1
-# Default extension to use (for info files)
+# Default extension to use (for man & info files)
%_extension .xz
+%_compress xz -0f --text
# Macro: %{mklibname <name> [<major> [<minor>]] [-s] [-d]}
--- rpm-5.4.10/scripts/brp-compress.brpcomp~ 2012-12-26 08:55:38.248052991 +0100
+++ rpm-5.4.10/scripts/brp-compress 2012-12-26 09:38:15.914753103 +0100
@@ -8,8 +8,8 @@ fi
cd "$RPM_BUILD_ROOT"
# Compress man pages
-COMPRESS="gzip -9 -n"
-COMPRESS_EXT=.gz
+COMPRESS=${COMPRESS:-gzip -9 -n}
+COMPRESS_EXT=${COMPRESS_EXT:-.gz}
for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
@@ -17,15 +17,14 @@ for d in ./usr/man/man* ./usr/man/*/man*
./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
do
[ -d $d ] || continue
- for f in `find $d -type f`
+ for f in `find $d -type f ! -name dir`
do
[ -f "$f" ] || continue
- [ "`basename $f`" = "dir" ] && continue
case "$f" in
- *.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.Z$//'`;;
- *.gz) gunzip -f $f; b=`echo $f | sed -e 's/\.gz$//'`;;
- *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
+ *.gz|*.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
+ *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
+ *.xz|*.lzma) unxz -f $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
*) b=$f;;
esac
@@ -48,9 +47,10 @@ do
for f in `find $d -type l`
do
- l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
+ l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
+ echo $l
rm -f $f
- b=`echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
+ b=`echo $f | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
done
done

View file

@ -59,7 +59,7 @@ Summary: The RPM package management system
Name: rpm
Epoch: 1
Version: %{libver}.%{minorver}
Release: %{?prereldate:0.%{prereldate}.}6
Release: %{?prereldate:0.%{prereldate}.}7
License: LGPLv2.1+
Group: System/Configuration/Packaging
URL: http://rpm5.org/
@ -354,6 +354,11 @@ Patch161: rpm-5.4.10-search-through-buildroot-library-dirs-for-uclibc-deps.patch
# status: same as for other dep gen patches
Patch162: rpm-5.4.10-fix-uninitialized-variable.patch
# this patch updates the upstream brp-compress scripts, which will be replacing
# our own locally maintained compress-files script from spec-helper
# status: ready
Patch169: rpm-5.4.10-update-and-use-brp-compress.patch
# ROSA stuff
Patch501: rpm-5.3.12.vendor.ROSA.patch
# Restore RPM_PACKAGE_NAME export as it's still used by aot-compile-rpm
@ -722,6 +727,8 @@ This package contains the RPM API documentation generated in HTML format.
%patch161 -p1 -b .uclibc_buildroot~
%patch162 -p1 -b .uninitialized~
%patch169 -p1 -b .brpcomp~
%patch501 -p1 -b .rosa_vendor~
%patch502 -p1 -b .package_name~
%patch503 -p1 -b .specspo~