From 6db98a2d4b602aef5568c2885e6da57776b460ba Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 16 Feb 2011 15:43:24 -0700 Subject: [PATCH] build: don't require pod2man for tarball builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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ò. --- 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 840ddd861f..ab3d093d18 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 cdf0f75bd3..86f024f754 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 f008078aba..3dc549eedb 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,@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,@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) -- 2.39.5