Hack up distcheck for publican
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 29 Feb 2012 01:49:16 +0000 (11:49 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 29 Feb 2012 02:46:01 +0000 (12:46 +1000)
Publican requires a read-write source tree, see
http://bugzilla.redhat.com/show_bug.cgi?id=798484

And it currently cannot build out-of-tree, so we need to copy the sources
into the _build tree and generate Protocol.xml into that tree too (we'd have
to do this anyway since automake creates a read-only source tree, so we
can't just link).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
doc/Wayland/Makefile.am

index 099efb2..0ac9fff 100644 (file)
@@ -1,5 +1,4 @@
 if HAVE_PUBLICAN
-EXTRA_DIST = Wayland
 noinst_DATA = Wayland
 
 publican_sources = \
@@ -16,16 +15,31 @@ publican_sources = \
        $(srcdir)/en-US/images/wayland.png  \
        $(srcdir)/en-US/images/x-architecture.png
 
+# publican does not support out-of-tree builds and during make distcheck the
+# source tree is read-only so we can't chdir and/or dump the protocol there
+# copy the tree into _build, leaving a marker file to clean up after
+# distclean
+# See https://bugzilla.redhat.com/show_bug.cgi?id=798484 for the chmod
+copy-sources:
+       if ! test -e "en-US/"; then \
+               mkdir en-US/; \
+               touch en-US/need-distclean; \
+               cp -r $(srcdir)/en-US/* en-US; \
+               chmod u+w en-US/images; \
+       fi
 
 Wayland: docbook-xsl publican.cfg $(publican_sources)
-       publican build --lang en-US --format html,pdf
+       publican build --config=$(srcdir)/publican.cfg --lang en-US --format html,pdf
 
 # This must be run befor the publican run
-docbook-xsl: $(top_srcdir)/protocol/wayland.xml protocol-to-docbook.xsl
-       $(AM_V_GEN)$(XSLTPROC) protocol-to-docbook.xsl $(top_srcdir)/protocol/wayland.xml > $(srcdir)/en-US/Protocol.xml
+docbook-xsl: copy-sources $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-to-docbook.xsl
+       $(AM_V_GEN)$(XSLTPROC) $(srcdir)/protocol-to-docbook.xsl $(top_srcdir)/protocol/wayland.xml > $(builddir)/en-US/Protocol.xml
 
 clean-local:
        -rm -rf Wayland
+       if test -e "en-US/need-distclean"; then \
+               rm -rf en-US; \
+       fi
 
 install-data-local:
        $(MKDIR_P) $(DESTDIR)$(docdir)