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.
This commit is contained in:
Tom G. Christensen 2004-12-26 13:18:08 +00:00
parent 4b73e80fac
commit 5e5291c3fc
2 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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}"