add first draft of the nonce-tcp spec
[dbus4win.git] / update-dbus-docs.sh
blob627f0a703e8da757680f25804054ceee1a9aab38
1 #! /bin/bash
3 function die()
5 echo $* 2>&1
6 exit 1
9 if test -n "$FDUSER" ; then
10 echo "Using freedesktop.org account $FDUSER"
11 user="$FDUSER@"
12 else
13 echo "Using freedesktop.org account from ~/.ssh/config, or local username"
16 CHECKOUTDIR=`mktemp -d || echo /tmp/dbus-for-docs`
17 export CVSROOT=":ext:${user}cvs.freedesktop.org:/cvs/dbus"
19 cd $CHECKOUTDIR || die "could not changedir to $CHECKOUTDIR"
21 echo "Checking out to directory "`pwd`
23 /bin/rm -rf dbus/doc || true ## get rid of old doxygen, etc.
24 cvs co dbus || die "failed to cvs update"
25 cd dbus || die "could not cd to dbus"
27 echo "Configuring and building docs"
29 ## the configure flags are explicit so if you lack xmlto, etc.
30 ## you won't fail to update those docs
31 ./autogen.sh --enable-xml-docs=yes --enable-doxygen-docs=yes || die "could not autogen"
32 doxygen Doxyfile || die "could not run Doxygen"
33 make -C doc || die "could not build docs"
35 MANFILES=`find -name "dbus*.1"`
36 for M in $MANFILES ; do
37 BASENAME=`basename $M`
38 echo "Converting $M to $BASENAME.html"
39 man2html $M > doc/$BASENAME.html
40 done
42 echo "Packing docs into tarball"
43 cp README HACKING AUTHORS NEWS COPYING ChangeLog doc/ || die "could not copy in assorted files"
44 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 tar tfz dbus-docs.tar.gz | sort > tarball.list || die "could not list tarball contents"
47 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 diff -u filesystem.list tarball.list || die "some files were not included"
51 echo "Uploading docs to server"
52 scp dbus-docs.tar.gz "${user}"dbus.freedesktop.org:
53 ssh "${user}"dbus.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 echo "Uploading DTD to server"
56 scp -p doc/introspect.dtd "${user}"dbus.freedesktop.org:/srv/specifications.freedesktop.org/www/dbus/1.0/introspect.dtd