inspector: Replace old examples with ones derived from phony images.
[libguestfs.git] / inspector / Makefile.am
index c8ebaf7..5e6828f 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+include $(top_srcdir)/subdir-rules.mk
+
+EXAMPLE_XML = \
+       example-debian.xml \
+       example-fedora.xml \
+       example-ubuntu.xml \
+       example-windows.xml
+
 EXTRA_DIST = \
        run-inspector-locally \
        virt-inspector
 
+docdir = @docdir@
+dist_doc_DATA = \
+       virt-inspector.rng \
+       $(EXAMPLE_XML)
+
 if HAVE_INSPECTOR
 
 bin_SCRIPTS = virt-inspector
 man_MANS = virt-inspector.1
 
-noinst_DATA = $(top_builddir)/html/virt-inspector.1.html
+noinst_DATA = \
+       $(top_builddir)/html/virt-inspector.1.html
 
 virt-inspector.1: virt-inspector
        $(POD2MAN) \
@@ -42,4 +56,32 @@ $(top_builddir)/html/virt-inspector.1.html: virt-inspector
          --outfile html/virt-inspector.1.html \
          inspector/$<
 
+if HAVE_XMLLINT
+
+TESTS = $(EXAMPLE_XML)
+TESTS_ENVIRONMENT = $(XMLLINT) --noout --relaxng virt-inspector.rng
+
+endif
+
+# These rules require virt-inspector so there is no good time that we
+# can run them.  Instead you can run them by hand.
+
+example-debian.xml:
+       ./run-inspector-locally ../images/debian.img > $@
+example-fedora.xml:
+       ./run-inspector-locally ../images/fedora.img > $@
+example-ubuntu.xml:
+       ./run-inspector-locally ../images/ubuntu.img > $@
+example-windows.xml:
+       ./run-inspector-locally ../images/windows.img | fgrep -v '<uuid>' > $@
+
 endif
+
+# Make symlink from virt-inspector.pl to virt-inspector.  This is just
+# to keep xgettext happy since it uses the file extension to determine
+# the implementation language of a file.
+
+all-local: virt-inspector.pl
+
+virt-inspector.pl: virt-inspector
+       ln -sf $< $@