#!/bin/sh ###################################################################### # # qmail-install-mans # # copies qmail's man pages to the appropriate place in a normal # man hierarchy. to keep them associated with qmail, it makes # up a new name, changing the `0' to the actual number and # appending `qmail' to the end. for example, `cat8/qmail-smtpd.0' # becomes `man8/qmail-smtpd.8qmail'. # # this works under debian linux. it may not work for you. # # 19nov96 / john labovitz # ###################################################################### # set this to where the qmail man pages (*.0) currently live qmailmandir=/var/qmail/man # set this to where you want the newly named version to live localmandir=/usr/local/man # prefix for directory of section (ie, `man8'), without section number -- # usually `man', but maybe you want `cat' instead mansectiondir=man # set this to the suffix of the new pages suffix=qmail cd $qmailmandir # process each of cat1, cat5, cat7, etc... for dir in *; do cd $dir # get section number out of the catN name section=`echo $dir | sed -e 's/cat\([0-9]\)/\1/'` # make up a new directory name newdir=$localmandir/$mansectiondir$section # make the directory if necessary install -d $newdir # go through each man page... for file in *.0; do echo "$file -> $newdir/$newfile.$section$suffix" # strip off the .0 newfile=`echo $file | sed -e 's/\\.0//'` # copy the file to the new directory with the proper name install -m 644 $file $newdir/$newfile.$section$suffix done cd .. done .