From: Mark Wooding Date: Tue, 30 Dec 2008 15:01:50 +0000 (+0000) Subject: Build: Fix construction of manual pages. X-Git-Tag: 1.0.0pre8~28 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/commitdiff_plain/e99aedcf9373b3305c32e510c086bf3357b4736a?hp=ca3aaaeb369633cd65c8cc29dde88daff2c38e8c Build: Fix construction of manual pages. Firstly, there was a bug in vars.am: the suffix rule used to construct manpages was broken because suffix rules aren't allowed to have dependencies of their own. So purge defs.man.in (we now just have defs.man) and confsubst the entire manpage each time. Secondly, in preparation for new manpages for services, consolidate the summary-building machinery into vars.am. The server makefile no longer needs a special case for tripe-admin.8. To keep things tidy, defs.man and make-summary have been stashed in common. This seems as good a place as any. --- diff --git a/Makefile.am b/Makefile.am index ce25e370..a36afeb8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,10 +89,6 @@ DISTCHECK_CONFIGURE_FLAGS = \ dist-hook:: echo $(VERSION) >$(distdir)/RELEASE -## Manual page preamble. -EXTRA_DIST += defs.man.in -CLEANFILES += defs.man - ## Additional build tools. EXTRA_DIST += config/confsubst EXTRA_DIST += config/auto-version diff --git a/client/tripectl.1.in b/client/tripectl.1.in index 0724b8a6..d517f9bc 100644 --- a/client/tripectl.1.in +++ b/client/tripectl.1.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripectl 1 "19 February 2001" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/common/Makefile.am b/common/Makefile.am index 27ba6941..1aa4ae1e 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -39,4 +39,14 @@ libtripe_a_SOURCES += slip.h ## Miscellaneous utilties. libtripe_a_SOURCES += util.c util.h +###-------------------------------------------------------------------------- +### Documentation. + +## Standard manpage preamble. +EXTRA_DIST += defs.man + +## Utility for building summary tables. +EXTRA_DIST += make-summary + ###----- That's all, folks -------------------------------------------------- + diff --git a/defs.man.in b/common/defs.man similarity index 100% rename from defs.man.in rename to common/defs.man diff --git a/server/make-summary b/common/make-summary similarity index 100% rename from server/make-summary rename to common/make-summary diff --git a/keys/tripe-keys.8.in b/keys/tripe-keys.8.in index ce3c1ec1..146eb7a6 100644 --- a/keys/tripe-keys.8.in +++ b/keys/tripe-keys.8.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripe-keys 8 "14 September 2005" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/keys/tripe-keys.conf.5.in b/keys/tripe-keys.conf.5.in index ad3173d3..887faf67 100644 --- a/keys/tripe-keys.conf.5.in +++ b/keys/tripe-keys.conf.5.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripe-keys.conf 5 "14 September 2005" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/maint-utils/manfix b/maint-utils/manfix index fb36848a..42930a6c 100755 --- a/maint-utils/manfix +++ b/maint-utils/manfix @@ -28,7 +28,7 @@ .\\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\ .\ .\\"--------------------------------------------------------------------------\ -.so ../defs.man.in \\"@@@PRE@@@\ +.so ../common/defs.man \\"@@@PRE@@@\ .\ .\\"-------------------------------------------------------------------------- p diff --git a/mon/tripemon.1.in b/mon/tripemon.1.in index 4a795e04..125a6221 100644 --- a/mon/tripemon.1.in +++ b/mon/tripemon.1.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripemon 1 "4 October 2005" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/pathmtu/pathmtu.1.in b/pathmtu/pathmtu.1.in index 364526bc..aca6bd20 100644 --- a/pathmtu/pathmtu.1.in +++ b/pathmtu/pathmtu.1.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH pathmtu 1 "29 December 2008" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/pkstream/pkstream.1.in b/pkstream/pkstream.1.in index b8a6c9d5..e732cbf2 100644 --- a/pkstream/pkstream.1.in +++ b/pkstream/pkstream.1.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH pkstream 1 "23 April 2003" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/priv/tripe-privhelper.8.in b/priv/tripe-privhelper.8.in index ea4a43fd..0d7d50d6 100644 --- a/priv/tripe-privhelper.8.in +++ b/priv/tripe-privhelper.8.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripe-privhelper 8 "28 April 2008" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/proxy/tripe-mitm.8.in b/proxy/tripe-mitm.8.in index 5f970f24..38062a0d 100644 --- a/proxy/tripe-mitm.8.in +++ b/proxy/tripe-mitm.8.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripe-mitm 8 "14 October 2003" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/server/Makefile.am b/server/Makefile.am index e54b7978..b6df4280 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -68,10 +68,4 @@ man_MANS += tripe-admin.5 CLEANFILES += tripe-admin.5 EXTRA_DIST += tripe-admin.5.in make-summary -tripe-admin.5: tripe-admin.5.in make-summary $(mandefs) - awk -f $(srcdir)/make-summary <$(srcdir)/tripe-admin.5.in >$@.tmp - $(mansubst) $@.tmp >$@.new - rm -f $@.tmp - mv $@.new $@ - ###----- That's all, folks -------------------------------------------------- diff --git a/server/tripe-admin.5.in b/server/tripe-admin.5.in index 05023729..6901dc41 100644 --- a/server/tripe-admin.5.in +++ b/server/tripe-admin.5.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripe-admin 5 "18 February 2001" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/server/tripe.8.in b/server/tripe.8.in index dab23e3b..ad71bc91 100644 --- a/server/tripe.8.in +++ b/server/tripe.8.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripe 8 "10 February 2001" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/uslip/tripe-uslip.1.in b/uslip/tripe-uslip.1.in index 47268f4e..b607c394 100644 --- a/uslip/tripe-uslip.1.in +++ b/uslip/tripe-uslip.1.in @@ -24,7 +24,7 @@ .\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. . .\"-------------------------------------------------------------------------- -.so ../defs.man.in \" @@@PRE@@@ +.so ../common/defs.man \" @@@PRE@@@ . .\"-------------------------------------------------------------------------- .TH tripe-uslip 1 "7 April 2008" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption" diff --git a/vars.am b/vars.am index 6eb59dbf..245b98e7 100644 --- a/vars.am +++ b/vars.am @@ -78,21 +78,14 @@ SUFFIXES += .5 .5.in SUFFIXES += .7 .7.in SUFFIXES += .8 .8.in -mandefs = $(top_builddir)/defs.man - -mansubst = sed \ - -e '/@@@PRE@@@/ {' \ - -e 'r$(mandefs)' \ - -e 'd' \ - -e '}' - -.1.in.1 .5.in.5 .7.in.7 .8.in.8: $(mandefs) - $(mansubst) $< >$@.new && mv $@.new $@ - -$(mandefs): $(top_srcdir)/defs.man.in Makefile - $(confsubst) $(top_srcdir)/defs.man.in >$@.new $(SUBSTITUTIONS) - sed '/^\.$$/ d; /^\.\\"/ d' $@.new >$@.new2 - rm -f $@.new - mv $@.new2 $@ +mandefs = $(top_srcdir)/common/defs.man +makesummary = $(top_srcdir)/common/make-summary + +.1.in.1 .5.in.5 .7.in.7 .8.in.8: + sed '/^\.$$/ d; /^\.\\"/ d' $(mandefs) >$@.defs + sed -e '/@@@PRE@@@/ {' -e 'r$@.defs' -e 'd' -e '}' $< >$@.merge + $(confsubst) $@.merge >$@.subst $(SUBSTITUTIONS) + awk -f $(makesummary) $@.subst >$@.new + rm -f $@.defs $@.merge $@.subst && mv $@.new $@ ###----- That's all, folks --------------------------------------------------