Manpage generation revisited
authorWouter Verhelst <w@uter.be>
Wed, 13 Apr 2011 11:03:23 +0000 (13:03 +0200)
committerWouter Verhelst <w@uter.be>
Wed, 13 Apr 2011 11:03:23 +0000 (13:03 +0200)
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
man/Makefile.am
man/nbd-server.1.in.sgml
man/nbd-server.5.in.sgml

index 378106d..90577f5 100644 (file)
@@ -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
 
index c10ec13..bca1321 100644 (file)
@@ -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
index 7946c23..2695086 100644 (file)
@@ -83,7 +83,7 @@ manpage.1: manpage.sgml
     were a local filesystem.</para>
 
     <para><command>&dhpackage;</command> 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
        <listitem>
          <para>Specify configuration file. The default configuration
            file, if this parameter is not specified, is
-           <filename>@sysconfdir@/nbd-server/config</filename>.</para>
+           <filename>$sysconfdir/nbd-server/config</filename>.</para>
          <para>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
index d36fe01..9fb2eff 100644 (file)
@@ -20,7 +20,7 @@ manpage.1: manpage.sgml
   <!ENTITY dhemail     "<email>wouter@debian.org</email>">
   <!ENTITY dhusername  "Wouter Verhelst">
   <!ENTITY dhucpackage "<refentrytitle>NBD-SERVER</refentrytitle>">
-  <!ENTITY dhpackage   "@sysconfdir@/nbd-server/config">
+  <!ENTITY dhpackage   "$sysconfdir/nbd-server/config">
 
   <!ENTITY debian      "<productname>Debian GNU/Linux</productname>">
   <!ENTITY gnu         "<acronym>GNU</acronym>">
@@ -60,11 +60,10 @@ manpage.1: manpage.sgml
   <refsect1>
     <title>DESCRIPTION</title>
 
-    <para><command>&dhpackage;</command> allows to configure the
-    nbd-server.</para>
+    <para>This file allows to configure the nbd-server.</para>
 
     <para>While
-      <filename>@sysconfdir@/nbd-server/config</filename> is the default
+      <filename>$sysconfdir/nbd-server/config</filename> is the default
       configuration file, this can be varied with the <option>-C</option>
       option to <command>nbd-server</command>(1).
     </para>
@@ -209,7 +208,7 @@ manpage.1: manpage.sgml
        <listitem>
          <para>
            Optional; string; default
-           <filename>@sysconfdir@/nbd-server/allow</filename>.
+           <filename>$sysconfdir/nbd-server/allow</filename>.
          </para>
          <para>
            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
     </programlisting>
-    <para>With @sysconfdir@/nbd-server/allow containing the following:</para>
+    <para>With $sysconfdir/nbd-server/allow containing the following:</para>
     <programlisting>
       127.0.0.1
       192.168.0.0/8