From aaca16d42d1f2cc0746d23034704e4e22f7d295d Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Wed, 13 Apr 2011 13:03:23 +0200 Subject: [PATCH] Manpage generation revisited Previously, we would generate manpages using direct automake-style @foo@ substitution. These, however, contain data in shell syntaxis, which results in a manpage in the style of '${prefix}/etc/nbd-server/config allows to configure the nbd-server', which is confusing. Instead, generate a shell script that outputs the manpage using shell interpolation, which supposedly works correctly. It's a bit yuck, but it's the way automake wants us to do these things. --- configure.ac | 2 +- man/Makefile.am | 31 ++++++++++++++++++++++--------- man/nbd-server.1.in.sgml | 4 ++-- man/nbd-server.5.in.sgml | 13 ++++++------- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 378106d..90577f5 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,6 @@ AC_TYPE_PID_T nbd_server_CPPFLAGS=$nbd_server_CPPFLAGS" -DSYSCONFDIR='\"$sysconfdir\"'" AC_SUBST(nbd_server_CPPFLAGS) AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile doc/Doxyfile man/Makefile man/nbd-client.8 man/nbd-server.5 man/nbd-server.1]) +AC_CONFIG_FILES([Makefile doc/Doxyfile man/Makefile man/nbd-client.8.sh man/nbd-server.5.sh man/nbd-server.1.sh]) AC_OUTPUT diff --git a/man/Makefile.am b/man/Makefile.am index c10ec13..bca1321 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,16 +1,29 @@ man_MANS = nbd-server.1 nbd-server.5 nbd-client.8 CLEANFILES = manpage.links manpage.refs MAINTAINERCLEANFILES = nbd-server.1 nbd-client.8 nbd-server.5 -EXTRA_DIST = nbd-server.1.in.sgml nbd-client.8.in.sgml nbd-server.5.in.sgml +EXTRA_DIST = nbd-server.1.in.sgml nbd-client.8.in.sgml nbd-server.5.in.sgml nbd-server.1.sh.in nbd-server.5.sh.in nbd-server.8.sh.in -infiles: nbd-server.1.in nbd-client.8.in nbd-server.5.in - -nbd-server.1.in: nbd-server.1.in.sgml +nbd-server.1: nbd-server.1.sh + sh nbd-server.1.sh > nbd-server.1 +nbd-server.5: nbd-server.5.sh + sh nbd-server.5.sh > nbd-server.5 +nbd-client.8: nbd-client.8.sh + sh nbd-client.8.sh > nbd-server.8 +nbd-server.1.sh.in: nbd-server.1.in.sgml sh.tmpl LC_ALL=C docbook2man nbd-server.1.in.sgml - mv NBD-SERVER.1 nbd-server.1.in -nbd-client.8.in: nbd-client.8.in.sgml + cat sh.tmpl > nbd-server.1.sh.in + cat NBD-SERVER.1 >> nbd-server.1.sh.in + echo "EOF" >> nbd-server.1.sh.in + rm NBD-SERVER.1 +nbd-client.8.sh.in: nbd-client.8.in.sgml sh.tmpl LC_ALL=C docbook2man nbd-client.8.in.sgml - mv NBD-CLIENT.8 nbd-client.8.in -nbd-server.5.in: nbd-server.5.in.sgml + cat sh.tmpl > nbd-client.8.sh.in + cat NBD-CLIENT.8 >> nbd-client.8.sh.in + echo "EOF" >> nbd-client.8.sh.in + rm NBD-CLIENT.8 +nbd-server.5.sh.in: nbd-server.5.in.sgml sh.tmpl LC_ALL=C docbook2man nbd-server.5.in.sgml - mv NBD-SERVER.5 nbd-server.5.in + cat sh.tmpl > nbd-server.5.sh.in + cat NBD-SERVER.5 >> nbd-server.5.sh.in + echo "EOF" >> nbd-server.5.sh.in + rm NBD-SERVER.5 diff --git a/man/nbd-server.1.in.sgml b/man/nbd-server.1.in.sgml index 7946c23..2695086 100644 --- a/man/nbd-server.1.in.sgml +++ b/man/nbd-server.1.in.sgml @@ -83,7 +83,7 @@ manpage.1: manpage.sgml were a local filesystem. &dhpackage; implements some security - through a file called "@sysconfdir@/nbd-server/allow" (by default; a + through a file called "$sysconfdir/nbd-server/allow" (by default; a different file can be chosen with the '-l' option or through a config file specification). This file must list the IP-addresses or network masks of clients that are allowed to connect. If it does not @@ -194,7 +194,7 @@ manpage.1: manpage.sgml Specify configuration file. The default configuration file, if this parameter is not specified, is - @sysconfdir@/nbd-server/config. + $sysconfdir/nbd-server/config. Note that the configuration file is always parsed and the entries in the file used, even if an extra server is specified on the command line. To disable the configuration diff --git a/man/nbd-server.5.in.sgml b/man/nbd-server.5.in.sgml index d36fe01..9fb2eff 100644 --- a/man/nbd-server.5.in.sgml +++ b/man/nbd-server.5.in.sgml @@ -20,7 +20,7 @@ manpage.1: manpage.sgml wouter@debian.org"> NBD-SERVER"> - + Debian GNU/Linux"> GNU"> @@ -60,11 +60,10 @@ manpage.1: manpage.sgml DESCRIPTION - &dhpackage; allows to configure the - nbd-server. + This file allows to configure the nbd-server. While - @sysconfdir@/nbd-server/config is the default + $sysconfdir/nbd-server/config is the default configuration file, this can be varied with the option to nbd-server(1). @@ -209,7 +208,7 @@ manpage.1: manpage.sgml Optional; string; default - @sysconfdir@/nbd-server/allow. + $sysconfdir/nbd-server/allow. The name of the authorization file for this export. This @@ -656,9 +655,9 @@ manpage.1: manpage.sgml [export] exportname = /export/blkdev port = 12345 - authfile = @sysconfdir@/nbd-server/allow + authfile = $sysconfdir/nbd-server/allow - With @sysconfdir@/nbd-server/allow containing the following: + With $sysconfdir/nbd-server/allow containing the following: 127.0.0.1 192.168.0.0/8 -- 1.7.10.4