From b4ad8bbe15600c672244d2052c3415c726e62a16 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 20 Sep 2011 18:44:25 +0100 Subject: [PATCH] Fix maintainer-upload-docs target to work out-of-tree The STATIC_DOCS, DTDS and all dist_ files except XMLTO_OUTPUT are in the source tree. The XMLTO_OUTPUT and the man2html output are in the build tree, and the BONUS_FILES already have $(srcdir) in their names. Also change the rules that generate the dbus-docs directory so that if they fail, they leave behind a temporary directory, rather than leaving behind a dbus-docs directory that causes make to not run those rules if re-run; and change the rules to scp files to the server, to put a trailing "/" on paths, ensuring that the tarball won't be uploaded as "www" if the www directory doesn't already exist. --- doc/Makefile.am | 39 +++++++++++++++++++++++++-------------- 1 files changed, 25 insertions(+), 14 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index b36777c..3fdb780 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -30,6 +30,7 @@ DTDS = \ dist_doc_DATA = system-activation.txt +# uploaded and distributed, but not installed STATIC_DOCS = \ dbus-faq.xml \ dbus-specification.xml \ @@ -47,11 +48,19 @@ EXTRA_DIST = \ html_DATA = -# we distribute these in the tarball so users don't necessarily need xmlto -dist_html_DATA = \ +dist_html_DATA = + +# diagram.png/diagram.svg aren't really HTML, but must go in the same +# directory as the HTML to avoid broken links +STATIC_HTML = \ diagram.png \ diagram.svg \ - $(XMLTO_OUTPUT) + $(NULL) + +dist_html_DATA += $(STATIC_HTML) + +# we distribute these in the tarball so users don't necessarily need xmlto +dist_html_DATA += $(XMLTO_OUTPUT) XMLTO_OUTPUT= \ dbus-faq.html \ @@ -122,14 +131,16 @@ BONUS_FILES = \ $(top_srcdir)/ChangeLog dbus-docs: $(STATIC_DOCS) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp - $(AM_V_at)rm -rf $@ - $(AM_V_GEN)$(MKDIR_P) $@/api - $(AM_V_at)cp $(STATIC_DOCS) $@ - $(AM_V_at)cp $(dist_doc_DATA) $@ - $(AM_V_at)cp $(dist_html_DATA) $@ - $(AM_V_at)cp $(MAN_HTML_FILES) $@ - $(AM_V_at)cp $(BONUS_FILES) $@ - $(AM_V_at)cp -r api/html $@/api + $(AM_V_at)rm -rf $@ $@.tmp + $(AM_V_GEN)$(MKDIR_P) $@.tmp/api + $(AM_V_at)cd $(srcdir) && cp $(STATIC_DOCS) @abs_builddir@/$@.tmp + $(AM_V_at)cd $(srcdir) && cp $(dist_doc_DATA) @abs_builddir@/$@.tmp + $(AM_V_at)cd $(srcdir) && cp $(STATIC_HTML) @abs_builddir@/$@.tmp + $(AM_V_at)cp $(XMLTO_OUTPUT) @abs_builddir@/$@.tmp + $(AM_V_at)cp $(MAN_HTML_FILES) @abs_builddir@/$@.tmp + $(AM_V_at)cp $(BONUS_FILES) @abs_builddir@/$@.tmp + $(AM_V_at)cp -r api/html @abs_builddir@/$@.tmp/api + $(AM_V_at)mv $@.tmp $@ dbus-docs.tar.gz: dbus-docs $(AM_V_GEN)tar czf $@ $< @@ -141,10 +152,10 @@ 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) + scp dbus-docs.tar.gz $(DOC_SERVER):$(DOC_WWW_DIR)/ rsync -rpvzP --chmod=Dg+s,ug+rwX,o=rX \ dbus-docs/ $(DOC_SERVER):$(DOC_WWW_DIR)/doc/ - scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH) + cd $(srcdir) && scp -p $(DTDS) $(SPECIFICATION_SERVER):$(SPECIFICATION_PATH)/ else maintainer-upload-docs: @echo "Can't upload documentation! Re-run configure with" @@ -156,7 +167,7 @@ endif clean-local: rm -f $(html_DATA) rm -rf api - rm -rf dbus-docs + rm -rf dbus-docs dbus-docs.tmp rm -f *.1.html rm -f doxygen.stamp -- 1.7.6.3