diff options
author | joey <joey> | 1999-08-17 04:12:54 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 04:12:54 +0000 |
commit | 938b66ee19e113785e6655b1c3e73e9003e6464c (patch) | |
tree | d06bd22faa3da8940bec71ba2e34e2028b6e7764 /dh_installmanpages | |
download | debhelper-938b66ee19e113785e6655b1c3e73e9003e6464c.tar.gz |
r1: Initial revision
Diffstat (limited to 'dh_installmanpages')
-rwxr-xr-x | dh_installmanpages | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dh_installmanpages b/dh_installmanpages new file mode 100755 index 00000000..9dbf1c93 --- /dev/null +++ b/dh_installmanpages @@ -0,0 +1,31 @@ +#!/bin/sh -e +# +# Automatically find and install man pages. +# This is a little bit DWIMish, but still very handy. + +PATH=debian:$PATH:/usr/lib/debhelper +source dh_lib + +# Note: this was mostly copied from debstd, and not verified to work. +# Find all filenames that look like man pages. +for file in `find * -name "*.[1-9]*" ! -name "*.ex" ! -name "*.in"`; do + # Make sure they arn't alreadt in debian/tmp + if ! expr $file : 'debian/tmp/.*' >/dev/null; then + # Make sure file thinks they are man pages. + if file $file|grep -q roff; then + if echo $file|grep -q /; then + NAME=`expr $file : '.*/\(.*\)'` + else + NAME=$file + fi + SECTION=man`expr $NAME : '.*\.\([123456789]\)'` + if [ ! -e debian/tmp/usr/man/$SECTION/$NAME -a \ + ! -e debian/tmp/usr/X11*/man/$SECTION/$NAME ]; then + if [ ! -d debian/tmp/usr/man/$SECTION ]; then + doit "install -d debian/tmp/usr/man/$SECTION" + fi + doit "install -p -m644 $file debian/tmp/usr/man/$SECTION/$NAME" + fi + fi + fi +done |