Forgot to add these new (auto-generated) manpages.
[samba.git] / source / script / makeyodldocs.sh
1 #!/bin/sh
2 SRCDIR=$1/
3
4 YODLDIR=$SRCDIR/../docs/yodldocs
5 MANPAGEDIR=$SRCDIR/../docs/manpages
6 HTMLDIR=$SRCDIR/../docs/htmldocs
7
8 echo "Re-creating man pages and HTML pages from YODL sources..."
9
10 if [ ! -d $MANPAGEDIR ]; then
11   echo "directory $MANPAGEDIR does not exist, are we in the right place?"
12   exit 1
13 fi
14
15 if [ ! -d $HTMLDIR ]; then
16   echo "directory $HTMLDIR does not exist, are we in the right place?"
17   exit 1
18 fi
19
20 if [ ! -d $YODLDIR ]; then
21   echo "directory $YODLDIR does not exist, are we in the right place?"
22   exit 1
23 fi
24
25 cd $YODLDIR
26
27 for d in *.yo
28 do
29
30 #
31 # Create the basename from the YODL manpage
32 #
33     bn=`echo $d | sed -e 's/\.yo//`
34
35         case "$d"
36         in
37                 *.[0-9].yo)
38                         echo "Creating man pages..."
39                         echo $d
40                         rm -f $bn.man
41                         yodl2man $d
42                         if [ ! -f $bn.man ]; then
43                                 echo "Failed to make man page for $d"
44                                 exit 1
45                         fi
46                         cp $bn.man ../manpages/$bn || echo "Cannot create $YODLDIR/../manpages/$bn"
47
48                         echo "Creating html versions of man pages..."
49                         echo $d
50                         rm -f $bn.html
51                         yodl2html $d
52                         if [ ! -f $bn.html ]; then
53                                 echo "Failed to make html page for $d"
54                                 exit 1
55                         fi
56                         cp $bn.html ../htmldocs || echo "Cannot create $YODLDIR/../htmldocs/$bn.html"
57                         ;;
58                 *)
59 #
60 # Non man-page YODL docs - just make html.
61 #
62                         echo $d
63                         rm -f $bn.html
64                         yodl2html $d
65                         if [ ! -f $bn.html ]; then
66                 echo "Failed to make html page for $d"
67                 exit 1
68             fi
69                         cp $bn.html ../htmldocs || echo "Cannot create $YODLDIR/../htmldocs/$bn.html"
70                 ;;
71         esac
72 done
73
74 echo "Remember to CVS check in your changes..."
75 exit 0