1997-11-24 05:07:28 +00:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
# Devin Reade, November 1997.
|
|
|
|
#
|
1999-02-21 23:37:13 +00:00
|
|
|
# $Id: mkhtmlman,v 1.9 1999/02/21 23:37:13 gdr-ftp Exp $
|
1997-11-24 05:07:28 +00:00
|
|
|
|
|
|
|
man2html=/usr/local/bin/man2html
|
|
|
|
TMPDIR=${TMPDIR:-/tmp}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make sure we know where everything is going.
|
|
|
|
#
|
|
|
|
if [ -z "$GNOROOT" ]; then
|
|
|
|
echo "GNOROOT variable not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ -z "$MANHTML" ]; then
|
|
|
|
echo "MANHTML variable not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ -z "$NAME" ]; then
|
|
|
|
echo "NAME variable not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ -z "$ADDR" ]; then
|
|
|
|
echo "ADDR variable not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
1997-11-24 05:46:29 +00:00
|
|
|
if [ ! -x ./newer ]; then
|
|
|
|
echo "./newer does not exist"
|
|
|
|
exit 1
|
|
|
|
fi
|
1997-11-24 05:07:28 +00:00
|
|
|
set +e
|
|
|
|
|
|
|
|
listfile=$TMPDIR/mkhtmlman.1.$$
|
|
|
|
|
|
|
|
trap "rm -f $listfile" 0 1 2 15
|
|
|
|
|
|
|
|
MANDIRS="$GNOROOT/usr.man $GNOROOT/*bin* $GNOROOT/*lib*"
|
|
|
|
|
|
|
|
for section in 1 2 3 4 5 6 7 8; do
|
|
|
|
dest=$MANHTML/man$section
|
|
|
|
[ -d $dest ] || mkdir -p $dest
|
|
|
|
|
|
|
|
for F in 00.DUMMY `find $MANDIRS -type f -name '*.'$section -print \
|
1999-01-18 01:46:07 +00:00
|
|
|
| grep -v .AppleDouble \
|
|
|
|
| grep -v .finderinfo \
|
|
|
|
| grep -v .resource \
|
1997-11-24 06:46:18 +00:00
|
|
|
| grep -v libcurses/PSD.doc \
|
1998-01-26 07:13:14 +00:00
|
|
|
| grep -v bin/gsh/updates1.1 \
|
1997-11-24 06:46:18 +00:00
|
|
|
| grep -v sed/tests` ; do
|
1997-11-24 05:07:28 +00:00
|
|
|
[ "$F" = 00.DUMMY ] && continue;
|
1998-02-19 03:04:10 +00:00
|
|
|
if egrep -q -e '^'"$F"'$' ignored.pages; then
|
|
|
|
echo "$F: ignored"
|
1998-02-04 07:17:13 +00:00
|
|
|
continue
|
|
|
|
fi
|
1998-02-19 03:04:10 +00:00
|
|
|
F_noG="$F"
|
1998-01-26 07:13:14 +00:00
|
|
|
if [ -f $F'G' ]; then
|
|
|
|
F="$F"G
|
|
|
|
fi
|
1998-02-19 03:04:10 +00:00
|
|
|
macro=''
|
|
|
|
if ! egrep -q -e '^\.TH.*GNO' $F; then
|
|
|
|
if egrep -q -e '^\.Sh NAME' $F; then
|
|
|
|
echo "$F: Using the BSD-formatted man page."
|
|
|
|
macro=doc
|
|
|
|
else
|
|
|
|
echo "$F: This does not appear to be a GNO manual page." \
|
|
|
|
"Skipped."
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
f=`basename $F_noG`
|
|
|
|
f2=`echo $f | perl -pe 's/\.[^\.]+$//;'`
|
|
|
|
echo "$f" >> $listfile
|
1997-11-24 05:46:29 +00:00
|
|
|
if ! ./newer $dest/$f.html $F; then
|
|
|
|
echo "creating $dest/$f.html"
|
1998-02-19 03:04:10 +00:00
|
|
|
nroff -man$macro $F | $man2html -nodepage | \
|
1997-11-24 05:46:29 +00:00
|
|
|
perl -p -e \
|
1999-02-21 23:37:13 +00:00
|
|
|
's/<BODY>/<title>GNO: '"$f2($section)"'<\/title><body bgcolor=\#ffffff textcolor=\#000000 linkcolor=\#0000FF vlinkcolor=\#001177 alinkcolor=\#001177>/;'\
|
1997-11-24 05:07:28 +00:00
|
|
|
> $dest/$f.html
|
1997-11-24 05:46:29 +00:00
|
|
|
fi
|
1997-11-24 05:07:28 +00:00
|
|
|
done
|
1997-11-24 05:46:29 +00:00
|
|
|
echo "creating $dest/00.index.html"
|
1997-11-24 05:07:28 +00:00
|
|
|
sort $listfile | \
|
|
|
|
./mkmandex -s$section -name="$NAME" -addr="$ADDR" -mkso="$MKSO" \
|
|
|
|
-hroot="$HTMLROOT" > $dest/00.index.html
|
|
|
|
rm $listfile
|
|
|
|
done
|
|
|
|
|