Debian Codegraph @

scripts/update-htmldocs

raw
1 #!/usr/bin/bash
2
3 echo This script regenerates the 'sourceware.org/systemtap/{tapset,man,...}' docs
4 echo from a NEW checkout of git main systemtap and a partial build.
5 echo
6 echo Consider running this script under ssh-agent, with an ssh-add-ed identity,
7 echo in order to prevent interactive blockage at the many ssh/git operations.
8 echo
9 echo Count to ten ... slowly ...
10 sleep 10
11
12 #check for man2html
13 #TODO perhaps wget, untar, and automatically use, then remove if we want?
14 # http://dcssrv1.oit.uci.edu/indiv/ehood/tar/man2html3.0.1.tar.gz
15
16 if which man2html &>/dev/null; then
17 :
18 else
19 echo "Please install man2html package"
20 exit
21 fi
22
23 # Create the directory we'll be working in
24
25 DIR=`mktemp -d stapdocsXXX -p /tmp/`; cd $DIR
26
27 # We'll need to build the latest stap with docs, ensure a check that everything built properly or bail
28
29 # TODO Could set BRANCH from cmdline arg
30 BRANCH=master
31 git clone --branch $BRANCH --depth 1 git://sourceware.org/git/systemtap.git
32
33 # Checkout the htdocs CVS^H^H^Hgit
34
35 git clone ssh://sourceware.org/git/systemtap-htdocs.git htdocs
36
37 BASEDIR=`pwd`
38 cd systemtap
39
40 mkdir build && mkdir local && cd build
41
42 ../configure --enable-docs --enable-htmldocs --prefix=$BASEDIR/systemtap/local
43
44 make -C doc
45 make install-data
46 if [ $? -eq 0 ]; then
47 :
48 else
49 echo "Make failed, please address build errors"
50 exit
51 fi
52
53 ### LANGREF
54 cp doc/langref.pdf $BASEDIR/htdocs/
55
56 cd $BASEDIR/htdocs
57 git rm $BASEDIR/htdocs/langref/*
58 git commit -m 'removed langref/* bits'
59
60 cd $BASEDIR/htdocs/langref
61 htlatex $BASEDIR/systemtap/doc/langref.tex "html,2"
62 cp langref.html index.html
63 cd $BASEDIR/htdocs/
64 git add langref/*.html
65 git add langref/*.css
66 git commit -m 'add new langref/*'
67 cd -
68
69 ### TUTORIAL
70 cp $BASEDIR/systemtap/build/doc/tutorial.pdf $BASEDIR/htdocs/
71
72 cd $BASEDIR/htdocs
73 git rm $BASEDIR/htdocs/tutorial/*
74 git commit -m 'removed tutorial/* bits'
75
76 cd $BASEDIR/htdocs/tutorial
77 htlatex $BASEDIR/systemtap/doc/tutorial.tex "html,2"
78 cp tutorial.html index.html
79
80 cd $BASEDIR/htdocs
81 git add tutorial/*.html
82 git add tutorial/*.css
83 git commit -m 'add new tutorial/*'
84
85 # beginners guide
86 # we require xmlto version newer than 0.0.23-3
87 # TODO add a version check
88
89 cd $BASEDIR/systemtap/build/doc/beginners
90
91 cp SystemTap_Beginners_Guide.pdf $BASEDIR/htdocs/
92
93 #echo 'systemtap_beginners_guide.pdf cp'
94
95 rm $BASEDIR/htdocs/SystemTap_Beginners_Guide/*.html
96 cp -R SystemTap_Beginners_Guide $BASEDIR/htdocs/
97 #echo 'systemtap_beginners_guide recursive cp'
98
99 # tapsets
100 cd ../..
101
102 cp $BASEDIR/systemtap/build/doc/SystemTap_Tapset_Reference/tapsets.pdf $BASEDIR/htdocs/
103
104 #echo 'tapsets.pdf cp'
105
106 rm $BASEDIR/htdocs/tapsets/*.html
107
108 cp -R $BASEDIR/systemtap/build/doc/SystemTap_Tapset_Reference/tapsets/*.html $BASEDIR/htdocs/tapsets/
109
110 cd $BASEDIR/htdocs
111 git add tapsets/*.html && git commit -m 'add new tapsets/*.html'
112
113 #echo 'tapsets html cp'
114
115 # systemtap examples
116 # run gitweb.php script?
117 # run examples-index-gen.pl script if needed?
118
119 cd $BASEDIR/htdocs
120 git rm man/*.html && git commit -m 'removed man pages'
121
122 cd $BASEDIR/htdocs/man
123
124 ./REGEN.sh $BASEDIR/systemtap/local
125
126 cd $BASEDIR/htdocs
127 git add man/*.html && git commit -m 'added new man pages'
128 echo -- $BASEDIR
129
130 echo Documentation generated, now make sure to cd $BASEDIR/htdocs
131 echo then review the results and git push to update the website.
132