]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: Replace variables in man pages
authorAndrea Bolognani <abologna@redhat.com>
Wed, 13 Apr 2016 16:52:12 +0000 (18:52 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 25 Apr 2016 13:40:44 +0000 (15:40 +0200)
We can't use eg. @sysconfdir@ directly in the .pod file, because
pod2man(1) will interpret that as a variable name and format it
accordingly.

Instead, we use eg. SYSCONFDIR and use a subsequent sed(1) call
to turn it into the expected @sysconfdir@.

daemon/Makefile.am
src/Makefile.am
tools/Makefile.am

index bb97ab963dda3f01c721cf3f4582e01176c87896..927d16fe7147f4ca597e62f2dddb87ff251904a3 100644 (file)
@@ -508,8 +508,14 @@ endif ! WITH_LIBVIRTD
 POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
 
 %.8.in: %.pod
-       $(AM_V_GEN)$(POD2MAN) --section=8 $< $@ \
-               && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
+       $(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
+       if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
+       sed \
+               -e 's|SYSCONFDIR|\@sysconfdir\@|g' \
+               -e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
+               < $@-t1 > $@-t2 && \
+       rm -f $@-t1 && \
+       mv $@-t2 $@
 
 %.8: %.8.in $(top_srcdir)/configure.ac
        $(AM_V_GEN)sed \
index ad009352a7956bcde2d08a47db710a1050e90a04..d0d1f41db8051f9ab481b7863c802529e1870d87 100644 (file)
@@ -2565,12 +2565,24 @@ virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
 POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
 
 virtlockd.8.in: locking/virtlockd.pod
-       $(AM_V_GEN)$(POD2MAN) --section 8 $< $@ \
-               && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
+       $(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
+       if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
+       sed \
+               -e 's|SYSCONFDIR|\@sysconfdir\@|g' \
+               -e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
+               < $@-t1 > $@-t2 && \
+       rm -f $@-t1 && \
+       mv $@-t2 $@
 
 virtlogd.8.in: logging/virtlogd.pod
-       $(AM_V_GEN)$(POD2MAN) --section 8 $< $@ \
-               && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
+       $(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
+       if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
+       sed \
+               -e 's|SYSCONFDIR|\@sysconfdir\@|g' \
+               -e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
+               < $@-t1 > $@-t2 && \
+       rm -f $@-t1 && \
+       mv $@-t2 $@
 
 %.8: %.8.in $(top_srcdir)/configure.ac
        $(AM_V_GEN)sed \
index 7ade4e4b66911a64257d33661776893e33c0490f..9302ee8aef4241953fb87c979a8465b1d87d4657 100644 (file)
@@ -280,12 +280,24 @@ endif WITH_WIN_ICON
 POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
 
 %.1.in: %.pod
-       $(AM_V_GEN)$(POD2MAN) $< $@ \
-               && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
+       $(AM_V_GEN)$(POD2MAN) $< $@-t1 && \
+       if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
+       sed \
+               -e 's|SYSCONFDIR|\@sysconfdir\@|g' \
+               -e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
+       < $@-t1 > $@-t2 && \
+       rm -f $@-t1 && \
+       mv $@-t2 $@
 
 %.8.in: %.pod
-       $(AM_V_GEN)$(POD2MAN) --section=8 $< $@ \
-               && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
+       $(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
+       if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
+       sed \
+               -e 's|SYSCONFDIR|\@sysconfdir\@|g' \
+               -e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
+               < $@-t1 > $@-t2 && \
+       rm -f $@-t1 && \
+       mv $@-t2 $@
 
 %.1: %.1.in $(top_srcdir)/configure.ac
        $(AM_V_GEN)sed \