make proto
[Samba.git] / source / script / makeyodldocs.sh
blob5b54df033e5be36b756f0692e89bf73162132eda
1 #!/bin/sh
2 SRCDIR=$1
3 shift
4 FILES=$@
6 if test -z $FILES; then
7 FILES=*.yo
8 fi
10 YODLDIR=$SRCDIR/../docs/yodldocs
11 MANPAGEDIR=$SRCDIR/../docs/manpages
12 HTMLDIR=$SRCDIR/../docs/htmldocs
14 echo "Re-creating man pages and HTML pages from YODL sources..."
16 if [ ! -d $MANPAGEDIR ]; then
17 echo "directory $MANPAGEDIR does not exist, are we in the right place?"
18 exit 1
21 if [ ! -d $HTMLDIR ]; then
22 echo "directory $HTMLDIR does not exist, are we in the right place?"
23 exit 1
26 if [ ! -d $YODLDIR ]; then
27 echo "directory $YODLDIR does not exist, are we in the right place?"
28 exit 1
31 cd $YODLDIR
33 for d in $FILES
37 # Create the basename from the YODL manpage
39 bn=`echo $d | sed -e 's/\.yo//'`
41 case "$d"
43 *.[0-9].yo)
44 echo "Creating man pages..."
45 echo $d
46 rm -f $bn.man
47 yodl2man $d
48 if [ ! -f $bn.man ]; then
49 echo "Failed to make man page for $d"
50 exit 1
52 cp $bn.man ../manpages/$bn || echo "Cannot create $YODLDIR/../manpages/$bn"
53 rm -f $bn.man
55 echo "Creating html versions of man pages..."
56 echo $d
57 rm -f $bn.html
58 yodl2html $d
59 if [ ! -f $bn.html ]; then
60 echo "Failed to make html page for $d"
61 exit 1
63 cp $bn.html ../htmldocs || echo "Cannot create $YODLDIR/../htmldocs/$bn.html"
64 rm -f $bn.html
68 # Non man-page YODL docs - just make html and text.
70 echo $d
71 rm -f $bn.html
72 yodl2html $d
73 if [ ! -f $bn.html ]; then
74 echo "Failed to make html page for $d"
75 exit 1
77 cp $bn.html ../htmldocs || echo "Cannot create $YODLDIR/../htmldocs/$bn.html"
78 rm -f $bn.html
79 rm -f $bn.txt
80 yodl2txt $d
81 if [ ! -f $bn.txt ]; then
82 echo "Failed to make text page for $d"
83 exit 1
85 cp $bn.txt ../textdocs || echo "Cannot create $YODLDIR/../textdocs/$bn.txt"
86 rm -f $bn.txt
88 esac
89 done
91 echo "Remember to CVS check in your changes..."
92 exit 0