From 14bca55dde79adddd77999ae262b8132ae0396f9 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sun, 19 May 2013 17:01:06 +0000 Subject: iptables: use autoconf to process .in man pages This fixes a bug in iptables.8 and ip6tables.8 where @PACKAGE_VERSION@ was not processed in the VERSION section. It also simplifies the Makefile by avoiding some sed commands. [ Mangled this patch to rename iptables-extensions.8.in to iptables-extensions.8.tmpl.in to avoid having a file whose name is terminated by .in.in --pablo ] Signed-off-by: Andy Spencer Signed-off-by: Pablo Neira Ayuso --- configure.ac | 2 ++ iptables/.gitignore | 1 + iptables/Makefile.am | 11 ++--------- iptables/ip6tables.8.in | 2 +- iptables/iptables-extensions.8.in | 28 ---------------------------- iptables/iptables-extensions.8.tmpl.in | 28 ++++++++++++++++++++++++++++ iptables/iptables.8.in | 2 +- 7 files changed, 35 insertions(+), 39 deletions(-) delete mode 100644 iptables/iptables-extensions.8.in create mode 100644 iptables/iptables-extensions.8.tmpl.in diff --git a/configure.ac b/configure.ac index d165d52c..3e5e8268 100644 --- a/configure.ac +++ b/configure.ac @@ -127,6 +127,8 @@ AC_SUBST([libxtables_vmajor]) AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile iptables/Makefile iptables/xtables.pc + iptables/iptables.8 iptables/ip6tables.8 + iptables/iptables-extensions.8.tmpl libipq/Makefile libipq/libipq.pc libiptc/Makefile libiptc/libiptc.pc libiptc/libip4tc.pc libiptc/libip6tc.pc diff --git a/iptables/.gitignore b/iptables/.gitignore index 4fc63aa4..c9c31788 100644 --- a/iptables/.gitignore +++ b/iptables/.gitignore @@ -6,6 +6,7 @@ /iptables /iptables.8 /iptables-extensions.8 +/iptables-extensions.8.tmpl /iptables-save /iptables-restore /iptables-static diff --git a/iptables/Makefile.am b/iptables/Makefile.am index 61e78db9..46d24630 100644 --- a/iptables/Makefile.am +++ b/iptables/Makefile.am @@ -38,15 +38,8 @@ if ENABLE_IPV6 v6_sbin_links = ip6tables ip6tables-restore ip6tables-save endif -iptables.8: ${srcdir}/iptables.8.in - ${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' $< >$@; - -ip6tables.8: ${srcdir}/ip6tables.8.in - ${AM_VERBOSE_GEN} sed -e 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' $< >$@; - -iptables-extensions.8: ${srcdir}/iptables-extensions.8.in ../extensions/matches.man ../extensions/targets.man - ${AM_VERBOSE_GEN} sed -e \ - 's/@PACKAGE_AND_VERSION@/${PACKAGE} ${PACKAGE_VERSION}/g' \ +iptables-extensions.8: ${srcdir}/iptables-extensions.8.tmpl ../extensions/matches.man ../extensions/targets.man + ${AM_VERBOSE_GEN} sed \ -e '/@MATCH@/ r ../extensions/matches.man' \ -e '/@TARGET@/ r ../extensions/targets.man' $< >$@; diff --git a/iptables/ip6tables.8.in b/iptables/ip6tables.8.in index 86348548..05e0d0f7 100644 --- a/iptables/ip6tables.8.in +++ b/iptables/ip6tables.8.in @@ -1,4 +1,4 @@ -.TH IP6TABLES 8 "" "@PACKAGE_AND_VERSION@" "@PACKAGE_AND_VERSION@" +.TH IP6TABLES 8 "" "@PACKAGE_STRING@" "@PACKAGE_STRING@" .\" .\" Man page written by Andras Kis-Szabo .\" It is based on iptables man page. diff --git a/iptables/iptables-extensions.8.in b/iptables/iptables-extensions.8.in deleted file mode 100644 index 9ec3fb0b..00000000 --- a/iptables/iptables-extensions.8.in +++ /dev/null @@ -1,28 +0,0 @@ -.TH iptables-extensions 8 "" "@PACKAGE_AND_VERSION@" "@PACKAGE_AND_VERSION@" -.SH NAME -iptables-extensions \(em list of extensions in the standard iptables distribution -.SH SYNOPSIS -\fBip6tables\fP [\fB\-m\fP \fIname\fP [\fImodule-options\fP...]] -[\fB\-j\fP \fItarget-name\fP [\fItarget-options\fP...] -.PP -\fBiptables\fP [\fB\-m\fP \fIname\fP [\fImodule-options\fP...]] -[\fB\-j\fP \fItarget-name\fP [\fItarget-options\fP...] -.SH MATCH EXTENSIONS -iptables can use extended packet matching modules -with the \fB\-m\fP or \fB\-\-match\fP -options, followed by the matching module name; after these, various -extra command line options become available, depending on the specific -module. You can specify multiple extended match modules in one line, -and you can use the \fB\-h\fP or \fB\-\-help\fP -options after the module has been specified to receive help specific -to that module. The extended match modules are evaluated in the order -they are specified in the rule. -.PP -If the \fB\-p\fP or \fB\-\-protocol\fP was specified and if and only if an -unknown option is encountered, iptables will try load a match module of the -same name as the protocol, to try making the option available. -.\" @MATCH@ -.SH TARGET EXTENSIONS -iptables can use extended target modules: the following are included -in the standard distribution. -.\" @TARGET@ diff --git a/iptables/iptables-extensions.8.tmpl.in b/iptables/iptables-extensions.8.tmpl.in new file mode 100644 index 00000000..99d89a1f --- /dev/null +++ b/iptables/iptables-extensions.8.tmpl.in @@ -0,0 +1,28 @@ +.TH iptables-extensions 8 "" "@PACKAGE_STRING@" "@PACKAGE_STRING@" +.SH NAME +iptables-extensions \(em list of extensions in the standard iptables distribution +.SH SYNOPSIS +\fBip6tables\fP [\fB\-m\fP \fIname\fP [\fImodule-options\fP...]] +[\fB\-j\fP \fItarget-name\fP [\fItarget-options\fP...] +.PP +\fBiptables\fP [\fB\-m\fP \fIname\fP [\fImodule-options\fP...]] +[\fB\-j\fP \fItarget-name\fP [\fItarget-options\fP...] +.SH MATCH EXTENSIONS +iptables can use extended packet matching modules +with the \fB\-m\fP or \fB\-\-match\fP +options, followed by the matching module name; after these, various +extra command line options become available, depending on the specific +module. You can specify multiple extended match modules in one line, +and you can use the \fB\-h\fP or \fB\-\-help\fP +options after the module has been specified to receive help specific +to that module. The extended match modules are evaluated in the order +they are specified in the rule. +.PP +If the \fB\-p\fP or \fB\-\-protocol\fP was specified and if and only if an +unknown option is encountered, iptables will try load a match module of the +same name as the protocol, to try making the option available. +.\" @MATCH@ +.SH TARGET EXTENSIONS +iptables can use extended target modules: the following are included +in the standard distribution. +.\" @TARGET@ diff --git a/iptables/iptables.8.in b/iptables/iptables.8.in index 9643705f..0fba603d 100644 --- a/iptables/iptables.8.in +++ b/iptables/iptables.8.in @@ -1,4 +1,4 @@ -.TH IPTABLES 8 "" "@PACKAGE_AND_VERSION@" "@PACKAGE_AND_VERSION@" +.TH IPTABLES 8 "" "@PACKAGE_STRING@" "@PACKAGE_STRING@" .\" .\" Man page written by Herve Eychenne (May 1999) .\" It is based on ipchains page. -- cgit v1.2.3