* cmake/: don't install test applications and service files, moved CMAKE_DEBUG_POSTFI...
[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 if test -z "$FDUSER" ; then
10     FDUSER=johnp
11 fi
12
13 echo "Using freedesktop.org account $FDUSER"
14
15 CHECKOUTDIR=/tmp/dbus-for-docs
16 export CVSROOT=:ext:$FDUSER@cvs.freedesktop.org:/cvs/dbus
17
18 cd $CHECKOUTDIR || die "could not changedir to $CHECKOUTDIR"
19
20 echo "Checking out to directory "`pwd`
21
22 /bin/rm -rf dbus/doc || true ## get rid of old doxygen, etc.
23 cvs co dbus || die "failed to cvs update"
24 cd dbus || die "could not cd to dbus"
25
26 echo "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"
31 doxygen Doxyfile || die "could not run Doxygen"
32 cd doc || die "could not cd to doc dir"
33 make || die "could not build docs"
34 cd .. || die "could not cd up"
35
36 MANFILES=`find -name "dbus*.1"`
37 for M in $MANFILES ; do
38     BASENAME=`basename $M`
39     echo "Converting $M to $BASENAME.html"
40     man2html $M > doc/$BASENAME.html
41 done
42
43 echo "Packing docs into tarball"
44 cp README HACKING AUTHORS NEWS COPYING ChangeLog doc/ || die "could not copy in assorted files"
45 tar 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
47 tar tfz dbus-docs.tar.gz | sort > tarball.list || die "could not list tarball contents"
48 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"
49
50 diff -u filesystem.list tarball.list || die "some files were not included"
51
52 echo "Uploading docs to server"
53 scp dbus-docs.tar.gz "$FDUSER"@pdx.freedesktop.org:
54 ssh "$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