[PATCH 6/6] Hack up distcheck for publican

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 28 18:57:34 PST 2012


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).

CC: Gaetan Nadon <gaetan.nadon at videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Gaetan, if you have any better suggestions I'd love to hear them.

 doc/Wayland/Makefile.am |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/doc/Wayland/Makefile.am b/doc/Wayland/Makefile.am
index 099efb2..0ac9fff 100644
--- a/doc/Wayland/Makefile.am
+++ b/doc/Wayland/Makefile.am
@@ -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)
-- 
1.7.7.6



More information about the wayland-devel mailing list