2014-07-08 12:47:09 +01:00
|
|
|
fixupOutputHooks+=('if [ -z "$dontGzipMan" ]; then compressManPages "$prefix"; fi')
|
2014-06-27 12:33:05 +01:00
|
|
|
|
|
|
|
compressManPages() {
|
|
|
|
local dir="$1"
|
|
|
|
|
2014-08-27 00:14:09 +01:00
|
|
|
if [ ! -d "$dir/share/man" ]; then return; fi
|
2014-06-27 12:33:05 +01:00
|
|
|
echo "gzipping man pages in $dir"
|
|
|
|
|
|
|
|
GLOBIGNORE=.:..:*.gz:*.bz2
|
|
|
|
|
|
|
|
for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do
|
|
|
|
if [ -f "$f" -a ! -L "$f" ]; then
|
|
|
|
if gzip -c -n "$f" > "$f".gz; then
|
|
|
|
rm "$f"
|
|
|
|
else
|
|
|
|
rm "$f".gz
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do
|
|
|
|
if [ -L "$f" -a -f `readlink -f "$f"`.gz ]; then
|
|
|
|
ln -sf `readlink "$f"`.gz "$f".gz && rm "$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
unset GLOBIGNORE
|
|
|
|
}
|