]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Fix maintainer-upload-docs target to work out-of-tree
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 20 Sep 2011 17:44:25 +0000 (18:44 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 21 Sep 2011 10:25:48 +0000 (11:25 +0100)
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.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41047
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
doc/Makefile.am

index b36777cdf6be0ed7ce9da59bded1896e5f6455fc..3fdb7803c4ec4b6e1aba04e64d8d0fac77de4a18 100644 (file)
@@ -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