From 5e5291c3fcebcf44000f5cfcbcd00c34318f872b Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Sun, 26 Dec 2004 13:18:08 +0000 Subject: [PATCH] Allow manpages to be compressed with compress(1) instead of gzip. This is useful for plain old Irix 5.3 which doesn't understand gzipped manpages. --- buildpkg.functions | 17 ++++++++++++++--- buildpkg.packaging.irix | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/buildpkg.functions b/buildpkg.functions index a47cbf4..26407d3 100644 --- a/buildpkg.functions +++ b/buildpkg.functions @@ -63,6 +63,7 @@ FILE=/usr/bin/file # Used by do_strip() PRINTF=/usr/bin/printf LN=/usr/bin/ln GINSTALL=/usr/local/bin/install # BSD compatible install - usually GNU install +COMPRESS=/usr/bsd/compress # Groff stuff for manpages NROFF=/usr/local/bin/nroff @@ -114,7 +115,8 @@ pkgdirdesig=${topinstalldir##/*/} # topinstalldir suffix # Functionality controls catman=0 # Don't fix manpages pr. default -gzman=0 # Don't compress man pages pr. default +gzman=0 # Don't gzip man pages pr. default +compressman=0 # Don't compress(1) man pages pr. default gzinfo=1 # Compress infopages pr. default dostrip=1 dostrip_elf=1 # default to stripping binaries during the install stage @@ -393,6 +395,15 @@ fix_man() # Run from 'cwd' where 'cwd' contains catX/manX subdirs compress_man() { + if [ "$gzman" -eq 1 ]; then # Use gzip + local compsuffix=gz + local pack=$GZIP + fi + if [ "$compressman" -eq 1 ]; then # Use compress(1) + local compsuffix=Z + local pack="$COMPRESS -f" + fi + echo "Compressing manpages" for i in [cm]a[nt]? do @@ -404,10 +415,10 @@ compress_man() if [ "$suffix" != "gz" -a "$suffix" != "Z" ]; then #probably uncompressed... if [ -L "$manpage" ]; then TARGET=$($LS -l "$manpage" | $AWK '{ print $NF }') - $LN -sf "$TARGET".gz "$manpage".gz + $LN -sf "$TARGET".$compsuffix "$manpage".$compsuffix $RM -f "$manpage" else - $GZIP "$manpage" + $pack "$manpage" fi fi done diff --git a/buildpkg.packaging.irix b/buildpkg.packaging.irix index 66b2994..3e26894 100644 --- a/buildpkg.packaging.irix +++ b/buildpkg.packaging.irix @@ -28,6 +28,7 @@ catman=1 # Compress manpages gzman=1 +compressman=0 # strip? dostrip=1 @@ -852,7 +853,7 @@ generic_pack() if [ -d ${stagedir}${prefix}/${_mandir} ]; then setdir "${stagedir}${prefix}/${_mandir}" [ "$catman" -eq 1 ] && fix_man - [ "$gzman" -eq 1 ] && compress_man + [ "$gzman" -eq 1 -o "$compressman" -eq 1 ] && compress_man fi if [ -d ${stagedir}${prefix}/${_infodir} ]; then setdir "${stagedir}${prefix}/${_infodir}"