update-dbus-docs.sh revision cc0aea750cb03ffa6a9e94e493455920ab3e612b
1#! /bin/bash
2
3function die()
4{
5    echo $* 2>&1
6    exit 1
7}
8
9if test -z "$FDUSER" ; then
10    FDUSER=johnp
11fi
12
13echo "Using freedesktop.org account $FDUSER"
14
15CHECKOUTDIR=/tmp/dbus-for-docs
16export CVSROOT=:ext:$FDUSER@cvs.freedesktop.org:/cvs/dbus
17
18cd $CHECKOUTDIR || die "could not changedir to $CHECKOUTDIR"
19
20echo "Checking out to directory "`pwd`
21
22/bin/rm -rf dbus/doc || true ## get rid of old doxygen, etc.
23cvs co dbus || die "failed to cvs update"
24cd dbus || die "could not cd to dbus"
25
26echo "Configuring and building docs"
27
28## the configure flags are explicit so if you lack xmlto, etc. 
29## you won't fail to update those docs
30./autogen.sh --enable-xml-docs=yes --enable-doxygen-docs=yes || die "could not autogen"
31doxygen Doxyfile || die "could not run Doxygen"
32cd doc || die "could not cd to doc dir"
33make || die "could not build docs"
34cd .. || die "could not cd up"
35
36MANFILES=`find -name "dbus*.1"`
37for M in $MANFILES ; do
38    BASENAME=`basename $M`
39    echo "Converting $M to $BASENAME.html"
40    man2html $M > doc/$BASENAME.html
41done
42
43echo "Packing docs into tarball"
44cp README HACKING AUTHORS NEWS COPYING ChangeLog doc/ || die "could not copy in assorted files"
45tar cfz dbus-docs.tar.gz doc/*.dtd doc/*.xsl doc/*.xml doc/*.html doc/*.txt doc/api/html/*.html doc/api/html/*.css doc/api/html/*.png doc/api/html/*.gif doc/HACKING doc/AUTHORS doc/NEWS doc/ChangeLog doc/TODO doc/README doc/COPYING doc/*.png doc/*.svg || die "could not tar up docs"
46
47tar tfz dbus-docs.tar.gz | sort > tarball.list || die "could not list tarball contents"
48find 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"
49
50diff -u filesystem.list tarball.list || die "some files were not included"
51
52echo "Uploading docs to server"
53scp dbus-docs.tar.gz "$FDUSER"@pdx.freedesktop.org:
54ssh "$FDUSER"@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")'
55
56