#!/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