3 # Automatically find and install man pages.
4 # This is a little bit DWIMish, but still very handy.
6 PATH=debian:$PATH:/usr/lib/debhelper
9 # Note: this was mostly copied from debstd, and not verified to work.
10 # Find all filenames that look like man pages.
11 for file in `find * -name "*.[1-9]*" ! -name "*.ex" ! -name "*.in"`; do
12 # Make sure they arn't alreadt in debian/tmp
13 if ! expr $file : 'debian/tmp/.*' >/dev/null; then
14 # Make sure file thinks they are man pages.
15 if file $file|grep -q roff; then
16 if echo $file|grep -q /; then
17 NAME=`expr $file : '.*/\(.*\)'`
21 SECTION=man`expr $NAME : '.*\.\([123456789]\)'`
22 if [ ! -e debian/tmp/usr/man/$SECTION/$NAME -a \
23 ! -e debian/tmp/usr/X11*/man/$SECTION/$NAME ]; then
24 if [ ! -d debian/tmp/usr/man/$SECTION ]; then
25 doit "install -d debian/tmp/usr/man/$SECTION"
27 doit "install -p -m644 $file debian/tmp/usr/man/$SECTION/$NAME"