source: postlfs/config/compressdoc.xml@ bb06362a

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since bb06362a was 8e37798, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

PDF fixes: Added keep-together PI to long screen blocks.
Bu sure that all sceen lines have <78 characteres.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6838 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 18.0 KB
RevLine 
[f8d632a]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[f8d632a]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
[0290a023]8<sect1 id="compressdoc" xreflabel="Compressing man and info pages">
[53819cbb]9 <?dbhtml filename="compressdoc.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>Compressing Man and Info Pages</title>
17
18 <indexterm zone="compressdoc">
19 <primary sortas="b-compressdoc">compressdoc</primary>
20 </indexterm>
21
[853ae568]22 <para>Man and info reader programs can transparently process files compressed
23 with <command>gzip</command> or <command>bzip2</command>, a feature you can
[9545a987]24 use to free some disk space while keeping your documentation
25 available. However, things are not that simple; man directories tend to
26 contain links&mdash;hard and symbolic&mdash;which defeat simple ideas like
27 recursively calling <command>gzip</command> on them. A better way to go is
28 to use the script below. If you would prefer to download the file instead of
29 creating it by typing or cut-and-pasting, you can find it at
30 <ulink url="&files-anduin;/compressdoc"/> (the file should be installed in
31 the <filename class="directory">/usr/sbin</filename> directory).</para>
[53819cbb]32
[8e37798]33<screen role="root"><?dbfo keep-together="auto"?><userinput>cat &gt; /usr/sbin/compressdoc &lt;&lt; "EOF"
[53819cbb]34<literal>#!/bin/bash
[9545a987]35# VERSION: 20060311.0028
[13f51bbc]36#
37# Compress (with bzip2 or gzip) all man pages in a hierarchy and
[2fa79e3b]38# update symlinks - By Marc Heerdink &lt;marc @ koelkast.net&gt;
[4ee1c44]39#
[13f51bbc]40# Modified to be able to gzip or bzip2 files as an option and to deal
[4e88613]41# with all symlinks properly by Mark Hymers &lt;markh @ &lfs-domainname;&gt;
[13f51bbc]42#
[2fa79e3b]43# Modified 20030930 by Yann E. Morin &lt;yann.morin.1998 @ anciens.enib.fr&gt;
[13f51bbc]44# to accept compression/decompression, to correctly handle hard-links,
45# to allow for changing hard-links into soft- ones, to specify the
[b714def5]46# compression level, to parse the man.conf for all occurrences of MANPATH,
[13f51bbc]47# to allow for a backup, to allow to keep the newest version of a page.
[4ee1c44]48#
[e0d33ef]49# Modified 20040330 by Tushar Teredesai to replace $0 by the name of the
[4ee1c44]50# script.
[4067e17b]51# (Note: It is assumed that the script is in the user's PATH)
[13f51bbc]52#
[4ee1c44]53# Modified 20050112 by Randy McMurchy to shorten line lengths and
54# correct grammar errors.
55#
[9545a987]56# Modified 20060128 by Alexander E. Patrakov for compatibility with Man-DB.
57#
58# Modified 20060311 by Archaic to use Man-DB manpath utility which is a
59# replacement for man --path from Man.
60#
[13f51bbc]61# TODO:
[4ee1c44]62# - choose a default compress method to be based on the available
63# tool : gzip or bzip2;
[e0d33ef]64# - offer an option to automagically choose the best compression
65# methed on a per page basis (eg. check which of
[4ee1c44]66# gzip/bzip2/whatever is the most effective, page per page);
[58c6057]67# - when a MANPATH env var exists, use this instead of /etc/man_db.conf
[4ee1c44]68# (useful for users to (de)compress their man pages;
69# - offer an option to restore a previous backup;
70# - add other compression engines (compress, zip, etc?). Needed?
[70919be]71
[13f51bbc]72# Funny enough, this function prints some help.
73function help ()
[70919be]74{
[13f51bbc]75 if [ -n "$1" ]; then
76 echo "Unknown option : $1"
77 fi
[4067e17b]78 ( echo "Usage: $MY_NAME &lt;comp_method&gt; [options] [dirs]" &amp;&amp; \
[13f51bbc]79 cat &lt;&lt; EOT
[e6da9e5]80Where comp_method is one of :
[13f51bbc]81 --gzip, --gz, -g
82 --bzip2, --bz2, -b
83 Compress using gzip or bzip2.
84
85 --decompress, -d
86 Decompress the man pages.
87
[4ee1c44]88 --backup Specify a .tar backup shall be done for all directories.
[e0d33ef]89 In case a backup already exists, it is saved as .tar.old
90 prior to making the new backup. If a .tar.old backup
[4ee1c44]91 exists, it is removed prior to saving the backup.
[13f51bbc]92 In backup mode, no other action is performed.
93
[e6da9e5]94And where options are :
[13f51bbc]95 -1 to -9, --fast, --best
[e0d33ef]96 The compression level, as accepted by gzip and bzip2.
97 When not specified, uses the default compression level
98 for the given method (-6 for gzip, and -9 for bzip2).
[4ee1c44]99 Not used when in backup or decompress modes.
[13f51bbc]100
[e0d33ef]101 --force, -F Force (re-)compression, even if the previous one was
102 the same method. Useful when changing the compression
103 ratio. By default, a page will not be re-compressed if
104 it ends with the same suffix as the method adds
[4ee1c44]105 (.bz2 for bzip2, .gz for gzip).
[e6da9e5]106
[e0d33ef]107 --soft, -S Change hard-links into soft-links. Use with _caution_
108 as the first encountered file will be used as a
[4ee1c44]109 reference. Not used when in backup mode.
[13f51bbc]110
[e0d33ef]111 --hard, -H Change soft-links into hard-links. Not used when in
[4ee1c44]112 backup mode.
[2fa79e3b]113
[13f51bbc]114 --conf=dir, --conf dir
[9545a987]115 Specify the location of man_db.conf. Defaults to /etc.
[13f51bbc]116
[e0d33ef]117 --verbose, -v Verbose mode, print the name of the directory being
118 processed. Double the flag to turn it even more verbose,
[4ee1c44]119 and to print the name of the file being processed.
[13f51bbc]120
[9545a987]121 --fake, -f Fakes it. Print the actual parameters compressdoc will use.
[13f51bbc]122
[e0d33ef]123 dirs A list of space-separated _absolute_ pathnames to the
[9545a987]124 man directories. When empty, and only then, use manpath
125 to parse ${MAN_CONF}/man_db.conf for all valid occurrences
126 of MANDATORY_MANPATH.
[13f51bbc]127
[4ee1c44]128Note about compression:
[13f51bbc]129 There has been a discussion on blfs-support about compression ratios of
130 both gzip and bzip2 on man pages, taking into account the hosting fs,
131 the architecture, etc... On the overall, the conclusion was that gzip
[e0d33ef]132 was much more efficient on 'small' files, and bzip2 on 'big' files,
[4ee1c44]133 small and big being very dependent on the content of the files.
[13f51bbc]134
[e0d33ef]135 See the original post from Mickael A. Peters, titled
[4ee1c44]136 "Bootable Utility CD", dated 20030409.1816(+0200), and subsequent posts:
[4e88613]137 http://&lfs-domainname;/pipermail/blfs-support/2003-April/038817.html
[13f51bbc]138
[e0d33ef]139 On my system (x86, ext3), man pages were 35564KB before compression.
140 gzip -9 compressed them down to 20372KB (57.28%), bzip2 -9 got down to
[4ee1c44]141 19812KB (55.71%). That is a 1.57% gain in space. YMMV.
142
[e0d33ef]143 What was not taken into consideration was the decompression speed. But
144 does it make sense to? You gain fast access with uncompressed man
145 pages, or you gain space at the expense of a slight overhead in time.
[4ee1c44]146 Well, my P4-2.5GHz does not even let me notice this... :-)
[13f51bbc]147
148EOT
[2fa79e3b]149) | less
[13f51bbc]150}
151
[e0d33ef]152# This function checks that the man page is unique amongst bzip2'd,
[4ee1c44]153# gzip'd and uncompressed versions.
[13f51bbc]154# $1 the directory in which the file resides
155# $2 the file name for the man page
[e0d33ef]156# Returns 0 (true) if the file is the latest and must be taken care of,
157# and 1 (false) if the file is not the latest (and has therefore been
[4ee1c44]158# deleted).
[13f51bbc]159function check_unique ()
160{
[e6da9e5]161 # NB. When there are hard-links to this file, these are
162 # _not_ deleted. In fact, if there are hard-links, they
[13f51bbc]163 # all have the same date/time, thus making them ready
164 # for deletion later on.
165
[e6da9e5]166 # Build the list of all man pages with the same name
167 DIR=$1
[13f51bbc]168 BASENAME=`basename "${2}" .bz2`
169 BASENAME=`basename "${BASENAME}" .gz`
[408e76d]170 GZ_FILE="$BASENAME".gz
[b614eb09]171 BZ_FILE="$BASENAME".bz2
[13f51bbc]172
173 # Look for, and keep, the most recent one
[4ee1c44]174 LATEST=`(cd "$DIR"; ls -1rt "${BASENAME}" "${GZ_FILE}" "${BZ_FILE}" \
175 2&gt;/dev/null | tail -n 1)`
[a72f9b7]176 for i in "${BASENAME}" "${GZ_FILE}" "${BZ_FILE}"; do
[e6da9e5]177 [ "$LATEST" != "$i" ] &amp;&amp; rm -f "$DIR"/"$i"
[13f51bbc]178 done
179
180 # In case the specified file was the latest, return 0
[e6da9e5]181 [ "$LATEST" = "$2" ] &amp;&amp; return 0
[13f51bbc]182 # If the file was not the latest, return 1
183 return 1
[70919be]184}
185
[4067e17b]186# Name of the script
187MY_NAME=`basename $0`
188
[e0d33ef]189# OK, parse the command-line for arguments, and initialize to some
190# sensible state, that is: don't change links state, parse
[9545a987]191# /etc/man_db.conf, be most silent, search man_db.conf in /etc, and don't
[4ee1c44]192# force (re-)compression.
[13f51bbc]193COMP_METHOD=
194COMP_SUF=
195COMP_LVL=
[2fa79e3b]196FORCE_OPT=
[13f51bbc]197LN_OPT=
198MAN_DIR=
[e6da9e5]199VERBOSE_LVL=0
[13f51bbc]200BACKUP=no
201FAKE=no
202MAN_CONF=/etc
203while [ -n "$1" ]; do
204 case $1 in
205 --gzip|--gz|-g)
206 COMP_SUF=.gz
207 COMP_METHOD=$1
208 shift
209 ;;
210 --bzip2|--bz2|-b)
211 COMP_SUF=.bz2
212 COMP_METHOD=$1
213 shift
214 ;;
215 --decompress|-d)
216 COMP_SUF=
217 COMP_LVL=
218 COMP_METHOD=$1
219 shift
220 ;;
221 -[1-9]|--fast|--best)
222 COMP_LVL=$1
223 shift
224 ;;
[e6da9e5]225 --force|-F)
[2fa79e3b]226 FORCE_OPT=-F
227 shift
228 ;;
229 --soft|-S)
230 LN_OPT=-S
[e6da9e5]231 shift
232 ;;
[2fa79e3b]233 --hard|-H)
234 LN_OPT=-H
[13f51bbc]235 shift
236 ;;
237 --conf=*)
238 MAN_CONF=`echo $1 | cut -d '=' -f2-`
239 shift
240 ;;
241 --conf)
242 MAN_CONF="$2"
243 shift 2
244 ;;
[e6da9e5]245 --verbose|-v)
246 let VERBOSE_LVL++
[13f51bbc]247 shift
248 ;;
249 --backup)
250 BACKUP=yes
251 shift
252 ;;
253 --fake|-f)
254 FAKE=yes
255 shift
256 ;;
257 --help|-h)
258 help
259 exit 0
260 ;;
261 /*)
262 MAN_DIR="${MAN_DIR} ${1}"
263 shift
264 ;;
265 -*)
266 help $1
267 exit 1
268 ;;
269 *)
[e0d33ef]270 echo "\"$1\" is not an absolute path name"
[13f51bbc]271 exit 1
272 ;;
273 esac
274done
275
276# Redirections
[e6da9e5]277case $VERBOSE_LVL in
[13f51bbc]278 0)
[e6da9e5]279 # O, be silent
280 DEST_FD0=/dev/null
281 DEST_FD1=/dev/null
282 VERBOSE_OPT=
[13f51bbc]283 ;;
284 1)
[e6da9e5]285 # 1, be a bit verbose
[13f51bbc]286 DEST_FD0=/dev/stdout
287 DEST_FD1=/dev/null
[e6da9e5]288 VERBOSE_OPT=-v
[13f51bbc]289 ;;
290 *)
[e6da9e5]291 # 2 and above, be most verbose
292 DEST_FD0=/dev/stdout
293 DEST_FD1=/dev/stdout
294 VERBOSE_OPT="-v -v"
[13f51bbc]295 ;;
296esac
[70919be]297
[e0d33ef]298# Note: on my machine, 'man --path' gives /usr/share/man twice, once
[4ee1c44]299# with a trailing '/', once without.
[13f51bbc]300if [ -z "$MAN_DIR" ]; then
[9545a987]301 MAN_DIR=`manpath -C "$MAN_CONF"/man_db.conf \
[13f51bbc]302 | sed 's/:/\\n/g' \
303 | while read foo; do dirname "$foo"/.; done \
304 | sort -u \
305 | while read bar; do echo -n "$bar "; done`
[70919be]306fi
307
[9545a987]308# If no MANDATORY_MANPATH in ${MAN_CONF}/man_db.conf, abort as well
[13f51bbc]309if [ -z "$MAN_DIR" ]; then
[9545a987]310 echo "No directory specified, and no directory found with \`manpath'"
[13f51bbc]311 exit 1
312fi
[70919be]313
[13f51bbc]314# Fake?
315if [ "$FAKE" != "no" ]; then
316 echo "Actual parameters used:"
317 echo -n "Compression.......: "
318 case $COMP_METHOD in
319 --bzip2|--bz2|-b) echo -n "bzip2";;
320 --gzip|__gz|-g) echo -n "gzip";;
321 --decompress|-d) echo -n "decompressing";;
322 *) echo -n "unknown";;
323 esac
324 echo " ($COMP_METHOD)"
325 echo "Compression level.: $COMP_LVL"
326 echo "Compression suffix: $COMP_SUF"
[2fa79e3b]327 echo -n "Force compression.: "
328 [ "foo$FORCE_OPT" = "foo-F" ] &amp;&amp; echo "yes" || echo "no"
[9545a987]329 echo "man_db.conf is....: ${MAN_CONF}/man_db.conf"
[2fa79e3b]330 echo -n "Hard-links........: "
[e0d33ef]331 [ "foo$LN_OPT" = "foo-S" ] &amp;&amp;
[4ee1c44]332 echo "convert to soft-links" || echo "leave as is"
[2fa79e3b]333 echo -n "Soft-links........: "
[e0d33ef]334 [ "foo$LN_OPT" = "foo-H" ] &amp;&amp;
[4ee1c44]335 echo "convert to hard-links" || echo "leave as is"
[13f51bbc]336 echo "Backup............: $BACKUP"
337 echo "Faking (yes!).....: $FAKE"
338 echo "Directories.......: $MAN_DIR"
[2fa79e3b]339 echo "Verbosity level...: $VERBOSE_LVL"
[13f51bbc]340 exit 0
341fi
[70919be]342
[13f51bbc]343# If no method was specified, print help
344if [ -z "${COMP_METHOD}" -a "${BACKUP}" = "no" ]; then
345 help
346 exit 1
[70919be]347fi
348
[666f6de]349# In backup mode, do the backup solely
[13f51bbc]350if [ "$BACKUP" = "yes" ]; then
351 for DIR in $MAN_DIR; do
352 cd "${DIR}/.."
353 DIR_NAME=`basename "${DIR}"`
354 echo "Backing up $DIR..." &gt; $DEST_FD0
355 [ -f "${DIR_NAME}.tar.old" ] &amp;&amp; rm -f "${DIR_NAME}.tar.old"
[e0d33ef]356 [ -f "${DIR_NAME}.tar" ] &amp;&amp;
[4ee1c44]357 mv "${DIR_NAME}.tar" "${DIR_NAME}.tar.old"
[4fb71d8e]358 tar -cvf "${DIR_NAME}.tar" "${DIR_NAME}" &gt; $DEST_FD1
[13f51bbc]359 done
360 exit 0
361fi
362
363# I know MAN_DIR has only absolute path names
364# I need to take into account the localized man, so I'm going recursive
365for DIR in $MAN_DIR; do
[2fa79e3b]366 MEM_DIR=`pwd`
[13f51bbc]367 cd "$DIR"
368 for FILE in *; do
[e6da9e5]369 # Fixes the case were the directory is empty
[13f51bbc]370 if [ "foo$FILE" = "foo*" ]; then continue; fi
[e6da9e5]371
372 # Fixes the case when hard-links see their compression scheme change
[e0d33ef]373 # (from not compressed to compressed, or from bz2 to gz, or from gz
[4ee1c44]374 # to bz2)
[e0d33ef]375 # Also fixes the case when multiple version of the page are present,
[4ee1c44]376 # which are either compressed or not.
[e6da9e5]377 if [ ! -L "$FILE" -a ! -e "$FILE" ]; then continue; fi
378
[a72f9b7]379 # Do not compress whatis files
380 if [ "$FILE" = "whatis" ]; then continue; fi
381
[13f51bbc]382 if [ -d "$FILE" ]; then
[e0d33ef]383 cd "${MEM_DIR}" # Go back to where we ran "$0",
[4ee1c44]384 # in case "$0"=="./compressdoc" ...
[13f51bbc]385 # We are going recursive to that directory
386 echo "-&gt; Entering ${DIR}/${FILE}..." &gt; $DEST_FD0
387 # I need not pass --conf, as I specify the directory to work on
388 # But I need exit in case of error
[e0be560]389 "$MY_NAME" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} \
[4ee1c44]390 ${FORCE_OPT} "${DIR}/${FILE}" || exit 1
[13f51bbc]391 echo "&lt;- Leaving ${DIR}/${FILE}." &gt; $DEST_FD1
[2fa79e3b]392 cd "$DIR" # Needed for the next iteration of the loop
[e6da9e5]393
[13f51bbc]394 else # !dir
[e6da9e5]395 if ! check_unique "$DIR" "$FILE"; then continue; fi
396
397 # Check if the file is already compressed with the specified method
[b614eb09]398 BASE_FILE=`basename "$FILE" .gz`
[408e76d]399 BASE_FILE=`basename "$BASE_FILE" .bz2`
[4ee1c44]400 if [ "${FILE}" = "${BASE_FILE}${COMP_SUF}" \
401 -a "foo${FORCE_OPT}" = "foo" ]; then continue; fi
[13f51bbc]402
403 # If we have a symlink
404 if [ -h "$FILE" ]; then
[b614eb09]405 case "$FILE" in
[13f51bbc]406 *.bz2)
407 EXT=bz2 ;;
408 *.gz)
409 EXT=gz ;;
410 *)
411 EXT=none ;;
412 esac
413
[e6da9e5]414 if [ ! "$EXT" = "none" ]; then
[4ee1c44]415 LINK=`ls -l "$FILE" | cut -d "&gt;" -f2 \
416 | tr -d " " | sed s/\.$EXT$//`
[13f51bbc]417 NEWNAME=`echo "$FILE" | sed s/\.$EXT$//`
418 mv "$FILE" "$NEWNAME"
419 FILE="$NEWNAME"
420 else
[b614eb09]421 LINK=`ls -l "$FILE" | cut -d "&gt;" -f2 | tr -d " "`
[13f51bbc]422 fi
423
[2fa79e3b]424 if [ "$LN_OPT" = "-H" ]; then
425 # Change this soft-link into a hard- one
426 rm -f "$FILE" &amp;&amp; ln "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
427 chmod --reference "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
428 else
429 # Keep this soft-link a soft- one.
430 rm -f "$FILE" &amp;&amp; ln -s "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
431 fi
[13f51bbc]432 echo "Relinked $FILE" &gt; $DEST_FD1
433
434 # else if we have a plain file
435 elif [ -f "$FILE" ]; then
436 # Take care of hard-links: build the list of files hard-linked
437 # to the one we are {de,}compressing.
[e0d33ef]438 # NB. This is not optimum has the file will eventually be
439 # compressed as many times it has hard-links. But for now,
[4ee1c44]440 # that's the safe way.
[13f51bbc]441 inode=`ls -li "$FILE" | awk '{print $1}'`
442 HLINKS=`find . \! -name "$FILE" -inum $inode`
443
444 if [ -n "$HLINKS" ]; then
445 # We have hard-links! Remove them now.
446 for i in $HLINKS; do rm -f "$i"; done
447 fi
448
449 # Now take care of the file that has no hard-link
[666f6de]450 # We do decompress first to re-compress with the selected
[13f51bbc]451 # compression ratio later on...
[b614eb09]452 case "$FILE" in
[13f51bbc]453 *.bz2)
454 bunzip2 $FILE
[e6da9e5]455 FILE=`basename "$FILE" .bz2`
[13f51bbc]456 ;;
457 *.gz)
458 gunzip $FILE
[e6da9e5]459 FILE=`basename "$FILE" .gz`
[13f51bbc]460 ;;
461 esac
462
[2fa79e3b]463 # Compress the file with the given compression ratio, if needed
[13f51bbc]464 case $COMP_SUF in
465 *bz2)
466 bzip2 ${COMP_LVL} "$FILE" &amp;&amp; chmod 644 "${FILE}${COMP_SUF}"
467 echo "Compressed $FILE" &gt; $DEST_FD1
468 ;;
469 *gz)
470 gzip ${COMP_LVL} "$FILE" &amp;&amp; chmod 644 "${FILE}${COMP_SUF}"
471 echo "Compressed $FILE" &gt; $DEST_FD1
472 ;;
473 *)
474 echo "Uncompressed $FILE" &gt; $DEST_FD1
475 ;;
476 esac
477
478 # If the file had hard-links, recreate those (either hard or soft)
479 if [ -n "$HLINKS" ]; then
480 for i in $HLINKS; do
[b614eb09]481 NEWFILE=`echo "$i" | sed s/\.gz$// | sed s/\.bz2$//`
[2fa79e3b]482 if [ "$LN_OPT" = "-S" ]; then
483 # Make this hard-link a soft- one
484 ln -s "${FILE}$COMP_SUF" "${NEWFILE}$COMP_SUF"
485 else
486 # Keep the hard-link a hard- one
487 ln "${FILE}$COMP_SUF" "${NEWFILE}$COMP_SUF"
488 fi
[4ee1c44]489 # Really work only for hard-links. Harmless for soft-links
490 chmod 644 "${NEWFILE}$COMP_SUF"
[13f51bbc]491 done
492 fi
493
494 else
[e0d33ef]495 # There is a problem when we get neither a symlink nor a plain
[4ee1c44]496 # file. Obviously, we shall never ever come here... :-(
497 echo -n "Whaooo... \"${DIR}/${FILE}\" is neither a symlink "
498 echo "nor a plain file. Please check:"
[b614eb09]499 ls -l "${DIR}/${FILE}"
[13f51bbc]500 exit 1
501 fi
502 fi
503 done # for FILE
[53819cbb]504done # for DIR</literal>
[4ee1c44]505
[9545a987]506EOF</userinput></screen>
507
508 <para>As <systemitem class="username">root</systemitem>, make
509 <command>compressdoc</command> executable for all users:</para>
510
511<screen><userinput>chmod -v 755 /usr/sbin/compressdoc</userinput></screen>
[70919be]512
[853ae568]513 <para>Now, as <systemitem class="username">root</systemitem>, you can issue
514 the command <command>compressdoc --bz2</command> to compress all your system man
[e0d33ef]515 pages. You can also run <command>compressdoc --help</command> to get
[53819cbb]516 comprehensive help about what the script is able to do.</para>
[13f51bbc]517
[9545a987]518 <para>Don't forget that a few programs, like the <application>X Window
[853ae568]519 System</application> and <application>XEmacs</application> also
520 install their documentation in non-standard places (such as
521 <filename class="directory">/usr/X11R6/man</filename>, etc.). Be sure
[9545a987]522 to add these locations to the file <filename>/etc/man_db.conf</filename>, as
[3597eb6]523 <envar>MANDATORY_MANPATH</envar> <replaceable>&lt;/path&gt;</replaceable>
[9545a987]524 lines.</para>
[4ee1c44]525
[9545a987]526 <para>Example:</para>
[4ee1c44]527
[53819cbb]528<screen><literal> ...
[9545a987]529 MANDATORY_MANPATH /usr/share/man
530 MANDATORY_MANPATH /usr/X11R6/man
531 MANDATORY_MANPATH /usr/local/man
532 MANDATORY_MANPATH /opt/qt/doc/man
[53819cbb]533 ...</literal></screen>
534
[e0d33ef]535 <para>Generally, package installation systems do not compress man/info pages,
536 which means you will need to run the script again if you want to keep the size
[53819cbb]537 of your documentation as small as possible. Also, note that running the script
[e0d33ef]538 after upgrading a package is safe; when you have several versions of a page
[53819cbb]539 (for example, one compressed and one uncompressed), the most recent one is kept
[853ae568]540 and the others are deleted.</para>
[70919be]541
542</sect1>
Note: See TracBrowser for help on using the repository browser.