summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2010-09-09 13:15:57 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2010-10-05 11:46:00 +0100
commit783baf9df290a30ee9157338d41a1bfebc36f2ab (patch)
tree08512bf1cfb0d38b064f24d01321867e010b4d55
parentee17175118028ad3b2c39be2fd58a21406325b91 (diff)
Move uploading docs into build system.documentation-build-system
This uploads a doc tarball, and its contents, to the appropriate location on dbus.freedesktop.org. It also uploads the DTDs to the appropriate location on specifications.freedesktop.org. I believe this uploads the same files as the old update-dbus-docs.sh script did.
-rw-r--r--configure.in4
-rw-r--r--doc/.gitignore2
-rw-r--r--doc/Makefile.am73
-rwxr-xr-xupdate-dbus-docs.sh56
4 files changed, 66 insertions, 69 deletions
diff --git a/configure.in b/configure.in
index 6af0ca9f..c6033987 100644
--- a/configure.in
+++ b/configure.in
@@ -1348,6 +1348,10 @@ AC_PATH_PROG([MAN2HTML], [man2html])
AC_ARG_VAR([MAN2HTML], [Path to man2html (optional)])
AM_CONDITIONAL(DBUS_HAVE_MAN2HTML, test x$MAN2HTML != x)
+AM_CONDITIONAL(DBUS_CAN_UPLOAD_DOCS,
+ test x$enable_doxygen_docs = xyes -a x$enable_xml_docs = xyes -a \
+ x$MAN2HTML != x)
+
#### Have to go $localstatedir->$prefix/var->/usr/local/var
#### find the actual value for $prefix that we'll end up with
diff --git a/doc/.gitignore b/doc/.gitignore
index 8a38ca33..fd193572 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -12,3 +12,5 @@ dbus-test-plan.html
dbus-tutorial.html
dbus-faq.html
dbus-daemon.1
+dbus-docs
+dbus-docs.tar.gz
diff --git a/doc/Makefile.am b/doc/Makefile.am
index ec370843..bc349f87 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -16,19 +16,25 @@ MAN_HTML_FILES = \
dbus-send.1.html \
dbus-uuidgen.1.html
-EXTRA_DIST= \
- busconfig.dtd \
- diagram.png \
- diagram.svg \
- introspect.dtd \
- dbus-faq.xml \
- dbus-specification.xml \
- dbus-test-plan.xml \
- dbus-tutorial.xml \
- dcop-howto.txt \
- file-boilerplate.c \
- introspect.xsl \
- system-activation.txt \
+DTDS = \
+ busconfig.dtd \
+ introspect.dtd
+
+STATIC_DOCS = \
+ diagram.png \
+ diagram.svg \
+ dbus-faq.xml \
+ dbus-specification.xml \
+ dbus-test-plan.xml \
+ dbus-tutorial.xml \
+ dcop-howto.txt \
+ introspect.xsl \
+ system-activation.txt \
+ $(DTDS)
+
+EXTRA_DIST = \
+ file-boilerplate.c \
+ $(STATIC_DOCS) \
$(MAN_IN_FILES) $(man_MANS)
HTML_FILES= \
@@ -73,8 +79,49 @@ all-local:: $(MAN_HTML_FILES)
$(AM_V_GEN)( $(MAN2HTML) $< > $@.tmp && mv $@.tmp $@ )
endif
+if DBUS_CAN_UPLOAD_DOCS
+BONUS_FILES = \
+ $(top_srcdir)/README \
+ $(top_srcdir)/HACKING \
+ $(top_srcdir)/AUTHORS \
+ $(top_srcdir)/NEWS \
+ $(top_srcdir)/COPYING \
+ $(top_srcdir)/ChangeLog
+
+dbus-docs: $(STATIC_DOCS) $(HTML_FILES) $(MAN_HTML_FILES) $(BONUS_FILES) $(DOXYGEN_HTML_INDEX)
+ $(AM_V_at)rm -rf $@
+ $(AM_V_GEN)mkdir -p $@/api
+ $(AM_V_at)cp $(STATIC_DOCS) $@
+ $(AM_V_at)cp $(HTML_FILES) $@
+ $(AM_V_at)cp $(MAN_HTML_FILES) $@
+ $(AM_V_at)cp $(BONUS_FILES) $@
+ $(AM_V_at)cp -r api/html $@/api
+
+dbus-docs.tar.gz: dbus-docs
+ $(AM_V_GEN)tar czf $@ $<
+
+DOC_SERVER = dbus.freedesktop.org
+DOC_WWW_DIR = /srv/dbus.freedesktop.org/www
+
+SPECIFICATION_SERVER = specifications.freedesktop.org
+SPECIFICATION_PATH = /srv/specifications.freedesktop.org/www/dbus/1.0
+
+maintainer-upload-docs: dbus-docs.tar.gz dbus-docs
+ scp dbus-docs.tar.gz $(DOC_SERVER):$(DOC_WWW_DIR)
+ rsync -rvzP --chmod=Dg+s,ug+rwX,o=rX \
+ dbus-docs/ $(DOC_SERVER):$(DOC_WWW_DIR)/doc/
+ scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH)
+else
+maintainer-upload-docs:
+ @echo "Can't upload documentation! Re-run configure with"
+ @echo " --enable-doxygen-docs --enable-xml-docs"
+ @echo "and ensure that man2html is installed."
+ @false
+endif
+
clean-local:
rm -rf api
+ rm -rf dbus-docs
rm -f *.1.html
maintainer-clean-local:
diff --git a/update-dbus-docs.sh b/update-dbus-docs.sh
deleted file mode 100755
index 627f0a70..00000000
--- a/update-dbus-docs.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/bash
-
-function die()
-{
- echo $* 2>&1
- exit 1
-}
-
-if test -n "$FDUSER" ; then
- echo "Using freedesktop.org account $FDUSER"
- user="$FDUSER@"
-else
- echo "Using freedesktop.org account from ~/.ssh/config, or local username"
-fi
-
-CHECKOUTDIR=`mktemp -d || echo /tmp/dbus-for-docs`
-export CVSROOT=":ext:${user}cvs.freedesktop.org:/cvs/dbus"
-
-cd $CHECKOUTDIR || die "could not changedir to $CHECKOUTDIR"
-
-echo "Checking out to directory "`pwd`
-
-/bin/rm -rf dbus/doc || true ## get rid of old doxygen, etc.
-cvs co dbus || die "failed to cvs update"
-cd dbus || die "could not cd to dbus"
-
-echo "Configuring and building docs"
-
-## the configure flags are explicit so if you lack xmlto, etc.
-## you won't fail to update those docs
-./autogen.sh --enable-xml-docs=yes --enable-doxygen-docs=yes || die "could not autogen"
-doxygen Doxyfile || die "could not run Doxygen"
-make -C doc || die "could not build docs"
-
-MANFILES=`find -name "dbus*.1"`
-for M in $MANFILES ; do
- BASENAME=`basename $M`
- echo "Converting $M to $BASENAME.html"
- man2html $M > doc/$BASENAME.html
-done
-
-echo "Packing docs into tarball"
-cp README HACKING AUTHORS NEWS COPYING ChangeLog doc/ || die "could not copy in assorted files"
-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"
-
-tar tfz dbus-docs.tar.gz | sort > tarball.list || die "could not list tarball contents"
-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"
-
-diff -u filesystem.list tarball.list || die "some files were not included"
-
-echo "Uploading docs to server"
-scp dbus-docs.tar.gz "${user}"dbus.freedesktop.org:
-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")'
-
-echo "Uploading DTD to server"
-scp -p doc/introspect.dtd "${user}"dbus.freedesktop.org:/srv/specifications.freedesktop.org/www/dbus/1.0/introspect.dtd