[Rpm-maint] [PATCH] brp-compress does not honor prefix/mandir
dieter
d_werner at gmx.net
Mon Feb 11 17:07:49 UTC 2013
I am using the prefix /usr/local for rpmbuild to keep my own packages
separated from official distribution packages.
This results that the man pages are put to
/usr/local/share/man/* or /usr/local/man/*
man pages located there are not compressed by brp-compress, because it
has a hardcoded and limited list of directories it searches.
I noticed in the list archive that somebody already reported this in
the past:
http://www.mail-archive.com/rpm-maint@lists.rpm.org/msg01000.html
To use a self defined prefix is well documented for rpm, therefore I
think resulting man page locations and the compression of the man pages
included in the rpm package should also be supported.
I have 2 suggestions for an improvement:
1) a simple approach: extend the list of hardcoded directories in
brp-compress by some "common" directories, e.g. after the
FHS. A patch could look like this:
diff -Pdpru brp-compress-ori brp-compress
--- brp-compress-ori 2013-02-11 16:43:46.749729262 +0100
+++ brp-compress 2013-02-11 16:45:00.047713073 +0100
@@ -14,7 +14,8 @@ 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 \
./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man*
\
- ./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
+ ./usr/share/doc/*/man/man* ./usr/lib/*/man/man* \
+ ./usr/local/share/man/* ./usr/local/man/*
do
[ -d $d ] || continue
for f in `find $d -type f`
2) somehow consider the configured prefix in brp-compress. This would
be a generic solution, but I have not checked it in full detail. I tried
it with exporting a variable in my spec file and using it in
brp-compress:
line added in spec file:
export BUILD_MANDIR=%{_mandir}
diff -Pdpru brp-compress-ori brp-compress
--- brp-compress-ori 2013-02-11 16:43:46.749729262 +0100
+++ brp-compress 2013-02-11 17:47:28.140594727 +0100
@@ -14,7 +14,8 @@ 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 \
./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man*
\
- ./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
+ ./usr/share/doc/*/man/man* ./usr/lib/*/man/man* \
+ ."$BUILD_MANDIR"
do
[ -d $d ] || continue
for f in `find $d -type f`
This works, but it is problematic if $BUILD_MANDIR is not set and would
require some additional checks in brp-compress in order to avoid
compression of files which should not be compressed if it is not set.
Besides, either users have to modify the spec file to add setting of
$BUILD_MANDIR, or it needs to be set "somewhere else" in the rpmbuild
process so that it is set when brp-compress is called.
Please CC me in any reply as I have not joined the list.
Dieter
More information about the Rpm-maint
mailing list