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