Skip to content
Snippets Groups Projects
Commit 081242d8 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix rapi documentation

As a nice side-effect this also fixes "make distcheck".

The way used to include the generated rapi-resources.sgml file only
works if it's built in the same directory. That's not the case during
"make distcheck". The patch changes the sed script used for variables
to include the file using its absolute path.

Reviewed-by: iustinp
parent a17a7623
No related branches found
No related tags found
No related merge requests found
...@@ -6,4 +6,5 @@ Configuring for development ...@@ -6,4 +6,5 @@ Configuring for development
sh autogen.sh && \ sh autogen.sh && \
./configure --enable-maintainer-mode \ ./configure --enable-maintainer-mode \
--prefix=/usr/local --sysconfdir=/etc --localstatedir=/var --prefix=/usr/local --sysconfdir=/etc --localstatedir=/var \
--enable-rapi
...@@ -11,6 +11,7 @@ abs_top_srcdir = @abs_top_srcdir@ ...@@ -11,6 +11,7 @@ abs_top_srcdir = @abs_top_srcdir@
ACLOCAL_AMFLAGS = -I autotools ACLOCAL_AMFLAGS = -I autotools
DOCBOOK_WRAPPER = $(top_srcdir)/autotools/docbook-wrapper DOCBOOK_WRAPPER = $(top_srcdir)/autotools/docbook-wrapper
BUILD_RAPI_RESOURCE_DOC = $(top_srcdir)/doc/build-rapi-resources-doc
REPLACE_VARS_SED = autotools/replace_vars.sed REPLACE_VARS_SED = autotools/replace_vars.sed
hypervisordir = $(pkgpythondir)/hypervisor hypervisordir = $(pkgpythondir)/hypervisor
...@@ -41,6 +42,7 @@ CLEANFILES = \ ...@@ -41,6 +42,7 @@ CLEANFILES = \
doc/*.html \ doc/*.html \
doc/*.in \ doc/*.in \
doc/*.pdf \ doc/*.pdf \
doc/rapi-resources.sgml \
doc/examples/ganeti.initd \ doc/examples/ganeti.initd \
doc/examples/ganeti.cron \ doc/examples/ganeti.cron \
lib/*.py[co] \ lib/*.py[co] \
...@@ -223,10 +225,8 @@ doc/%.html: doc/%.in $(DOCBOOK_WRAPPER) ...@@ -223,10 +225,8 @@ doc/%.html: doc/%.in $(DOCBOOK_WRAPPER)
doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml doc/rapi.pdf doc/rapi.html: doc/rapi-resources.sgml
doc/rapi-resources.sgml: doc/build-rapi-resources-doc lib/rapi/resources.py doc/rapi-resources.sgml: $(BUILD_RAPI_RESOURCE_DOC) lib/rapi/resources.py
PYTHONPATH=.:$(top_builddir) $< > $@ || rm -f $@ PYTHONPATH=.:$(top_builddir) $(BUILD_RAPI_RESOURCE_DOC) > $@ || rm -f $@
.INTERMEDIATE: doc/rapi-resources.sgml
man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER) man/%.7: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
$(DOCBOOK_WRAPPER) $< $@ $(DOCBOOK_WRAPPER) $< $@
...@@ -236,7 +236,7 @@ man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER) ...@@ -236,7 +236,7 @@ man/%.8: man/%.in man/footer.sgml $(DOCBOOK_WRAPPER)
man/footer.sgml $(TESTS): srclinks man/footer.sgml $(TESTS): srclinks
$(TESTS) doc/build-rapi-resources-doc: ganeti lib/_autoconf.py $(TESTS) $(BUILD_RAPI_RESOURCE_DOC): ganeti lib/_autoconf.py
lib/_autoconf.py: Makefile stamp-directories lib/_autoconf.py: Makefile stamp-directories
set -e; \ set -e; \
...@@ -269,6 +269,10 @@ $(REPLACE_VARS_SED): Makefile stamp-directories ...@@ -269,6 +269,10 @@ $(REPLACE_VARS_SED): Makefile stamp-directories
echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \ echo 's#@LOCALSTATEDIR@#$(localstatedir)#g'; \
echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \ echo 's#@CUSTOM_XEN_KERNEL@#$(XEN_KERNEL)#g'; \
echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \ echo 's#@CUSTOM_XEN_INITRD@#$(XEN_INITRD)#g'; \
echo '/@INCLUDE_RAPI_RESOURCES@/ {'; \
echo ' r $(abs_top_builddir)/doc/rapi-resources.sgml'; \
echo ' d'; \
echo '}'; \
} > $@ } > $@
# We need to create symlinks because "make distcheck" will not install Python # We need to create symlinks because "make distcheck" will not install Python
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<!ENTITY JsonLink "http://www.json.org/"> <!ENTITY JsonLink "http://www.json.org/">
<!ENTITY WikipediaRESTLink <!ENTITY WikipediaRESTLink
"http://en.wikipedia.org/wiki/Representational_State_Transfer"> "http://en.wikipedia.org/wiki/Representational_State_Transfer">
<!ENTITY IncludeResources SYSTEM "doc/rapi-resources.sgml">
]> ]>
<article class="specification"> <article class="specification">
<articleinfo> <articleinfo>
...@@ -88,7 +87,7 @@ xmlreq.send(null);</screen> ...@@ -88,7 +87,7 @@ xmlreq.send(null);</screen>
<sect1> <sect1>
<title>Resources</title> <title>Resources</title>
&IncludeResources; @INCLUDE_RAPI_RESOURCES@
</sect1> </sect1>
</article> </article>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment