[libvirt] [PATCHv2 1/3] build: don't require pod2man for tarball builds

Eric Blake eblake at redhat.com
Fri Feb 18 22:24:55 UTC 2011


Right now, 'man libvirtd' includes information that depends on
configure results, so it must be generated on the fly and live
in $(builddir); however, requiring pod2man on all end user
machines is overkill.  Meanwhile, 'man virsh' doesn't mention
any configure results, so it can be built at 'make dist' time.
If that situation changes in the future, we can generate virsh.1
in the same way that we generate libvirtd.8.

* daemon/Makefile.am (libvirtd.8.in): New rule, to run pod2man in
advance of distribution.
(libvirtd.8): Use only sed from tarball.
(EXTRA_DIST): Ship new file.
(libvirtd.pod): Delete unused rule.
(man8_MANS): Let automake know which section to use.
(CLEANFILES, MAINTAINERCLEANFILES): Adjust to new files.
* tools/Makefile.am (dist_man1_MANS): Distribute pre-built man
pages, fine since they don't require any substitution.
(virt-xml-validate.1, virt-pki-validate.1): Change input source.
(virsh.1): Build into srcdir.
(CLEANFILES, MAINTAINERCLEANFILES): Adjust to new build style.
* daemon/.gitignore: Update.
Reported by Diego Elio Pettenò.
---

Re-send, minor VPATH tweaks from v1:
https://www.redhat.com/archives/libvir-list/2011-February/msg00613.html

 daemon/.gitignore  |    3 ++-
 daemon/Makefile.am |   10 ++++++----
 tools/Makefile.am  |   15 ++++++++-------
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/daemon/.gitignore b/daemon/.gitignore
index 840ddd8..ab3d093 100644
--- a/daemon/.gitignore
+++ b/daemon/.gitignore
@@ -8,6 +8,7 @@ libvirt_qemud
 libvirtd
 libvirtd.init
 libvirtd*.logrotate
-libvirtd.pod
 libvirtd.8
+libvirtd.8.in
+libvirtd.pod
 probes.h
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index cdf0f75..86f024f 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -38,6 +38,7 @@ EXTRA_DIST =						\
 	test_libvirtd.aug                               \
 	THREADING.txt					\
 	libvirtd.pod.in					\
+	libvirtd.8.in					\
 	libvirtd.stp					\
 	$(AVAHI_SOURCES)				\
 	$(DAEMON_SOURCES)
@@ -46,7 +47,7 @@ BUILT_SOURCES =

 if WITH_LIBVIRTD

-man_MANS = libvirtd.8
+man8_MANS = libvirtd.8

 sbin_PROGRAMS = libvirtd

@@ -62,7 +63,7 @@ augeastests_DATA = test_libvirtd.aug
 POD2MAN = pod2man -c "Virtualization Support" \
 			-r "$(PACKAGE)-$(VERSION)" -s 8

-libvirtd.pod: libvirtd.pod.in
+libvirtd.8: $(srcdir)/libvirtd.8.in
 	sed \
 	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
 	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
@@ -70,7 +71,7 @@ libvirtd.pod: libvirtd.pod.in
 	    < $< > $@-t
 	mv $@-t $@

-libvirtd.8: libvirtd.pod
+$(srcdir)/libvirtd.8.in: libvirtd.pod.in
 	$(AM_V_GEN)$(POD2MAN) $< $@

 libvirtd_SOURCES = $(DAEMON_SOURCES)
@@ -338,5 +339,6 @@ uninstall-data-sasl:
 endif


-CLEANFILES += $(BUILT_SOURCES) $(man_MANS) libvirtd.pod
+CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
 CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
+MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in
diff --git a/tools/Makefile.am b/tools/Makefile.am
index f008078..3dc549e 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -19,22 +19,22 @@ EXTRA_DIST = \
 bin_SCRIPTS = virt-xml-validate virt-pki-validate
 bin_PROGRAMS = virsh

-man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1
+dist_man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1


 virt-xml-validate: virt-xml-validate.in Makefile
 	$(AM_V_GEN)sed -e 's, at SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \
 	    || (rm $@ && exit 1) && chmod +x $@

-virt-xml-validate.1: virt-xml-validate
-	$(AM_V_GEN)$(POD2MAN) $< $@
+virt-xml-validate.1: virt-xml-validate.in
+	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@

 virt-pki-validate: virt-pki-validate.in Makefile
 	$(AM_V_GEN)sed -e 's, at SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
 	    || (rm $@ && exit 1) && chmod +x $@

-virt-pki-validate.1: virt-pki-validate
-	$(AM_V_GEN)$(POD2MAN) $< $@
+virt-pki-validate.1: virt-pki-validate.in
+	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@

 virsh_SOURCES =							\
 		console.c console.h				\
@@ -123,7 +123,7 @@ virsh_win_icon.$(OBJEXT): virsh_win_icon.rc
 endif

 virsh.1: virsh.pod
-	$(AM_V_GEN)$(POD2MAN) $< $@
+	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@

 install-data-local: install-init

@@ -162,7 +162,8 @@ libvirt-guests.init:
 endif # LIBVIRT_INIT_SCRIPT_RED_HAT


-CLEANFILES = $(bin_SCRIPTS) $(man1_MANS)
+CLEANFILES = $(bin_SCRIPTS)
 CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
+MAINTAINERCLEANFILES = $(dist_man1_MANS)

 DISTCLEANFILES = $(BUILT_SOURCES)
-- 
1.7.4




More information about the libvir-list mailing list