some docs cleanups
[platform/upstream/dbus.git] / update-dbus-docs.sh
1 #! /bin/bash
2
3 function die()
4 {
5     echo $* 2>&1
6     exit 1
7 }
8
9 CHECKOUTDIR=/tmp/dbus-for-docs
10 export CVSROOT=:ext:hp@cvs.freedesktop.org:/cvs/dbus
11
12 cd $CHECKOUTDIR || die "could not changedir to $CHECKOUTDIR"
13
14 echo "Checking out to directory "`pwd`
15
16 /bin/rm -rf dbus/doc || true ## get rid of old doxygen, etc.
17 cvs co dbus || die "failed to cvs update"
18 cd dbus || die "could not cd to dbus"
19
20 echo "Configuring and building docs"
21
22 ./autogen.sh || die "could not autogen"
23 doxygen Doxyfile || die "could not run Doxygen"
24 cd doc || die "could not cd to doc dir"
25 make || die "could not build docs"
26 cd .. || die "could not cd up"
27
28 MANFILES=`find -name "dbus*.1"`
29 for M in $MANFILES ; do
30     BASENAME=`basename $M`
31     echo "Converting $M to $BASENAME.html"
32     man2html $M > doc/$BASENAME.html
33 done
34
35 echo "Packing docs into tarball"
36 cp README HACKING AUTHORS NEWS ChangeLog doc/ || die "could not copy in assorted files"
37 tar cfz dbus-docs.tar.gz doc/*.dtd doc/*.xml doc/*.html doc/*.txt doc/api/html/*.html doc/api/html/*.css doc/api/html/*.png doc/HACKING doc/AUTHORS doc/NEWS doc/ChangeLog doc/TODO doc/README doc/*.png doc/*.svg || die "could not tar up docs"
38
39 tar tfz dbus-docs.tar.gz | sort > tarball.list || die "could not list tarball contents"
40 find doc -not -type d | grep -v CVS | grep -v -E '.~[0-9.]+~' | grep -v Makefile | grep -vE '.c$' | grep -v man3dbus | grep -v .cvsignore | sort > filesystem.list || die "could not list doc/* contents"
41
42 diff -u filesystem.list tarball.list || die "some files were not included"
43
44 echo "Uploading docs to server"
45 scp dbus-docs.tar.gz pdx.freedesktop.org:
46 ssh hp@pdx.freedesktop.org '(cd /srv/dbus.freedesktop.org/www/ && /bin/cp -f ~/dbus-docs.tar.gz . && tar zxf dbus-docs.tar.gz && echo "Successfully unpacked tarball on server")'
47