[libvirt] [PATCH 1/2] build-sys: fix build when daemon is disabled by not installing libvirtd.8

Since the rule to build libvirtd.8 is within the WITH_LIBVIRTD conditional, so declare the man page in there as well. Without this change, build without daemon will fail. --- .gnulib | 2 +- daemon/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gnulib b/.gnulib index 1629006..11fbc57 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 1629006348e1f66f07ce3ddcf3ebd2d14556cfce +Subproject commit 11fbc57405a118e6ec9a3ebc19bbf5ececdae4d6 diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 963d64f..dbf0ac3 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -41,12 +41,12 @@ EXTRA_DIST = \ $(AVAHI_SOURCES) \ $(DAEMON_SOURCES) -man_MANS = libvirtd.8 - BUILT_SOURCES = if WITH_LIBVIRTD +man_MANS = libvirtd.8 + sbin_PROGRAMS = libvirtd confdir = $(sysconfdir)/libvirt/ -- 1.7.2

This slightly reduces the requirements for building libvirt. --- daemon/Makefile.am | 4 ++-- tools/Makefile.am | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index dbf0ac3..74ad67b 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -45,7 +45,7 @@ BUILT_SOURCES = if WITH_LIBVIRTD -man_MANS = libvirtd.8 +dist_man_MANS = libvirtd.8 sbin_PROGRAMS = libvirtd @@ -324,5 +324,5 @@ uninstall-data-sasl: endif -CLEANFILES = $(BUILT_SOURCES) $(man_MANS) libvirtd.pod +CLEANFILES = $(BUILT_SOURCES) $(dist_man_MANS) libvirtd.pod CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda diff --git a/tools/Makefile.am b/tools/Makefile.am index fd05e8b..7bc94cc 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -13,7 +13,7 @@ EXTRA_DIST = $(ICON_FILES) virt-xml-validate.in virt-pki-validate.in virsh.pod bin_SCRIPTS = virt-xml-validate virt-pki-validate bin_PROGRAMS = virsh -man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1 +dist_man_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1 virt-xml-validate: virt-xml-validate.in Makefile @@ -119,6 +119,6 @@ virsh.1: virsh.pod $(AM_V_GEN)$(POD2MAN) $< $@ -CLEANFILES = $(bin_SCRIPTS) $(man1_MANS) +CLEANFILES = $(bin_SCRIPTS) $(dist_man_MANS) DISTCLEANFILES = $(BUILT_SOURCES) -- 1.7.2

On 08/05/2010 07:17 PM, Diego Elio Pettenò wrote:
This slightly reduces the requirements for building libvirt. --- daemon/Makefile.am | 4 ++-- tools/Makefile.am | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index dbf0ac3..74ad67b 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -45,7 +45,7 @@ BUILT_SOURCES =
if WITH_LIBVIRTD
-man_MANS = libvirtd.8 +dist_man_MANS = libvirtd.8
This says that libvirtd.8 is distributed as part of the tarball, rather than omitted, even though we have rules to regenerate it. I agree that distributing it makes it easier to build from a tarball if you don't have tools to regenerate it, so ACK to this part. However,
sbin_PROGRAMS = libvirtd
@@ -324,5 +324,5 @@ uninstall-data-sasl: endif
-CLEANFILES = $(BUILT_SOURCES) $(man_MANS) libvirtd.pod +CLEANFILES = $(BUILT_SOURCES) $(dist_man_MANS) libvirtd.pod
This says to nuke the distributed man page. Which means 'make && make clean && make' is once again requiring those extra tools. The patch needs to move distributed man pages out of CLEANFILES and into MAINTAINERCLEANFILES. Since only the maintainer is required to have the tools for regenerating the man pages (think 'make dist'), only the maintainer-clean target should nuke existing pages. I'm also wondering if we need a hook in 'make dist' to ensure the man pages are up-to-date (now that the developers don't rebuild it from a fresh tarball, the maintainer should now make sure that a stale copy from incremental builds does not sneak into the tarball). Do you want to make those edits and resubmit, or do you need me to make the tweaks? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 06/08/10 22:52, Eric Blake wrote:
On 08/05/2010 07:17 PM, Diego Elio Pettenò wrote: <snip>
-man_MANS = libvirtd.8 +dist_man_MANS = libvirtd.8
Ahhh, interesting. Thanks for pointing this out. :) Regards and best wishes, Justin Clift

Il giorno ven, 06/08/2010 alle 06.52 -0600, Eric Blake ha scritto:
This says to nuke the distributed man page. Which means 'make && make clean && make' is once again requiring those extra tools.
I wanted to stay as close as possible to the original, since I know people tend to be touchy about these rebuilds ;)
The patch needs to move distributed man pages out of CLEANFILES and into MAINTAINERCLEANFILES.
Yah, agreed. Will change it in a moment then
I'm also wondering if we need a hook in 'make dist' to ensure the man pages are up-to-date (now that the developers don't rebuild it from a fresh tarball, the maintainer should now make sure that a stale copy from incremental builds does not sneak into the tarball).
As far as I can see, this would still trigger a rebuild if timestamp don't match even if it's distributed, so it shouldn't be a problem at all. The important part is that dist/ditcheck is built with libvirtd enabled and not disabled. -- Diego Elio Pettenò — “Flameeyes” http://blog.flameeyes.eu/ If you found a .asc file in this mail and know not what it is, it's a GnuPG digital signature: http://www.gnupg.org/

This slightly reduces the requirements for building libvirt. The man pages are deleted with make maintainer-clean. --- daemon/Makefile.am | 5 +++-- tools/Makefile.am | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index dbf0ac3..77f9806 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -45,7 +45,7 @@ BUILT_SOURCES = if WITH_LIBVIRTD -man_MANS = libvirtd.8 +dist_man_MANS = libvirtd.8 sbin_PROGRAMS = libvirtd @@ -324,5 +324,6 @@ uninstall-data-sasl: endif -CLEANFILES = $(BUILT_SOURCES) $(man_MANS) libvirtd.pod +CLEANFILES = $(BUILT_SOURCES) libvirtd.pod CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda +MAINTAINERCLEANFILES = $(dist_man_MANS) diff --git a/tools/Makefile.am b/tools/Makefile.am index fd05e8b..8d8b235 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -13,7 +13,7 @@ EXTRA_DIST = $(ICON_FILES) virt-xml-validate.in virt-pki-validate.in virsh.pod bin_SCRIPTS = virt-xml-validate virt-pki-validate bin_PROGRAMS = virsh -man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1 +dist_man_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1 virt-xml-validate: virt-xml-validate.in Makefile @@ -119,6 +119,7 @@ virsh.1: virsh.pod $(AM_V_GEN)$(POD2MAN) $< $@ -CLEANFILES = $(bin_SCRIPTS) $(man1_MANS) +CLEANFILES = $(bin_SCRIPTS) +MAINTAINERCLEANFILES = $(dist_man_MANS) DISTCLEANFILES = $(BUILT_SOURCES) -- 1.7.2

On 08/09/2010 04:55 PM, Diego Elio Pettenò wrote:
This slightly reduces the requirements for building libvirt.
The man pages are deleted with make maintainer-clean. --- daemon/Makefile.am | 5 +++-- tools/Makefile.am | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
This fails 'make distcheck': ERROR: files left in build directory after distclean: ./tools/virt-xml-validate.1 ./tools/virt-pki-validate.1 ./daemon/libvirtd.8 make[1]: *** [distcleancheck] Error 1 I didn't have time to look into it further today, but it needs a bit more tweaking before it is ready. Interestingly, virsh.1 didn't show up on that list - what is different about that compared to the other three? Also, do we want to use dist_man1_MANS instead of dist_man_MANS, since automake can do a better job if it knows exactly which man section is being targetted? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 08/09/2010 05:12 PM, Eric Blake wrote:
On 08/09/2010 04:55 PM, Diego Elio Pettenò wrote:
This slightly reduces the requirements for building libvirt.
The man pages are deleted with make maintainer-clean.
Reviving an old thread...
--- daemon/Makefile.am | 5 +++-- tools/Makefile.am | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
This fails 'make distcheck':
ERROR: files left in build directory after distclean: ./tools/virt-xml-validate.1 ./tools/virt-pki-validate.1 ./daemon/libvirtd.8 make[1]: *** [distcleancheck] Error 1
I didn't have time to look into it further today, but it needs a bit more tweaking before it is ready. Interestingly, virsh.1 didn't show up on that list - what is different about that compared to the other three?
I found out why. virsh.1 is generated from virsh.pod (a static document); while libvirtd.8 is generated from libvirtd.pod (a dynamic document which reflects ./configure options) which in turn is generated from libvirtd.pod.in (a static document). It's a no-no to ever distribute a file that depends on configure results. It seems to me that your request is really about removing an end-user dependence on pod2man. It also seems that this is quite doable, but in a different manner. Rather than shipping just libvirtd.pod.in and generating libvirtd.pod and libvirtd.8 on the fly (which requires first sed then pod2man), or your proposal of shipping libvirtd.pod.in and libvirtd.8 (but missing out on libvirtd.pod, and breaking distcheck), we instead ship libvirtd.pod.in and libvirtd.1.in (requiring pod2man), but generate libvirtd.8 on the fly (using just sed). I'm working up a rewrite of your patch that does this; although, seeing as how it touches the build machinery, it may be deemed too risky for 0.8.8. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

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ò. ---
I'm working up a rewrite of your patch that does this; although, seeing as how it touches the build machinery, it may be deemed too risky for 0.8.8.
Any thoughts on when this should be applied? daemon/.gitignore | 3 ++- daemon/Makefile.am | 12 +++++++----- tools/Makefile.am | 15 ++++++++------- 3 files changed, 17 insertions(+), 13 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..b1fdd11 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: libvirtd.8.in sed \ -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \ -e 's![@]localstatedir[@]!$(localstatedir)!g' \ @@ -70,8 +71,8 @@ libvirtd.pod: libvirtd.pod.in < $< > $@-t mv $@-t $@ -libvirtd.8: libvirtd.pod - $(AM_V_GEN)$(POD2MAN) $< $@ +libvirtd.8.in: libvirtd.pod.in + $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@ 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,@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) -- 1.7.4

On 08/05/2010 07:17 PM, Diego Elio Pettenò wrote:
Since the rule to build libvirtd.8 is within the WITH_LIBVIRTD conditional, so declare the man page in there as well. Without this change, build without daemon will fail. --- .gnulib | 2 +- daemon/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.gnulib b/.gnulib index 1629006..11fbc57 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 1629006348e1f66f07ce3ddcf3ebd2d14556cfce +Subproject commit 11fbc57405a118e6ec9a3ebc19bbf5ececdae4d6
Was this intentional? I'm assuming it was accidental, and omitting it.
diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 963d64f..dbf0ac3 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -41,12 +41,12 @@ EXTRA_DIST = \ $(AVAHI_SOURCES) \ $(DAEMON_SOURCES)
-man_MANS = libvirtd.8 - BUILT_SOURCES =
if WITH_LIBVIRTD
+man_MANS = libvirtd.8 + sbin_PROGRAMS = libvirtd
ACK; applied. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (4)
-
Diego Elio Pettenò
-
Diego Elio “Flameeyes” Pettenò
-
Eric Blake
-
Justin Clift