[gnutls-devel] [PATCH] build: always install man(1)

Alon Bar-Lev alon.barlev at gmail.com
Fri Dec 18 11:13:09 CET 2015


currently these man pages are installed only if --enable-doc
is provided, while these are not actually docs, do not require any
special dependency, nor consume large space.

add --disable-manpages to enable/disable manpages installation, install
the man(1) regardless of --enable-doc.

Signed-off-by: Alon Bar-Lev <alon.barlev at gmail.com>
---
 .gitignore               | 21 +++++++-----
 Makefile.am              |  6 +++-
 configure.ac             |  6 ++++
 doc/Makefile.am          |  7 +++-
 doc/manpages/Makefile.am | 67 ------------------------------------
 manpages/Makefile.am     | 89 ++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 118 insertions(+), 78 deletions(-)
 create mode 100644 manpages/Makefile.am

diff --git a/.gitignore b/.gitignore
index 2c84b0e..8c41b62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -123,18 +123,9 @@ doc/latex/gnutls.lof
 doc/latex/gnutls.lot
 doc/manpages/Makefile
 doc/manpages/Makefile.in
-doc/manpages/certtool.1
-doc/manpages/danetool.1
-doc/manpages/gnutls-cli-debug.1
-doc/manpages/gnutls-cli.1
-doc/manpages/gnutls-serv.1
 doc/manpages/gnutls_*.3
 doc/manpages/dane_*.3
 doc/manpages/xssl_*.3
-doc/manpages/ocsptool.1
-doc/manpages/p11tool.1
-doc/manpages/psktool.1
-doc/manpages/srptool.1
 doc/ocsp-api.texi
 doc/pgp-api.texi
 doc/pkcs11-api.texi
@@ -440,6 +431,18 @@ m4/visibility.m4
 m4/wchar_t.m4
 m4/wint_t.m4
 m4/xsize.m4
+manpages/Makefile
+manpages/Makefile.in
+manpages/certtool.1
+manpages/danetool.1
+manpages/gnutls-cli-debug.1
+manpages/gnutls-cli.1
+manpages/gnutls-serv.1
+manpages/ocsptool.1
+manpages/p11tool.1
+manpages/psktool.1
+manpages/srptool.1
+manpages/tpmtool.1
 po/*.gmo
 po/*.po
 po/Makefile
diff --git a/Makefile.am b/Makefile.am
index d61fded..bda5f26 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,6 +42,10 @@ if HAVE_GUILE
 SUBDIRS += guile
 endif
 
+if ENABLE_MANPAGES
+SUBDIRS += manpages
+endif
+
 if ENABLE_DOC
 SUBDIRS += doc
 endif
@@ -80,7 +84,7 @@ dist-hook:
 		$(SED) -i 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $$i.tmp; \
 		autogen -Tagman-cmd.tpl $$i.tmp; \
 		rm -f $$i.tmp; \
-		mv -f *.1 ../doc/manpages/; \
+		mv -f *.1 ../manpages/; \
 	done
 	cd $(distdir)/src/ && for i in *-args.c *-args.h;do \
 		mv $$i $$i.bak; \
diff --git a/configure.ac b/configure.ac
index efacc30..57ab8a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,11 @@ AM_PROG_CC_C_O
 AC_PROG_YACC
 AC_PROG_SED
 
+AC_ARG_ENABLE(manpages,
+  AS_HELP_STRING([--disable-manpages], [don't install manpages]),
+    enable_manpages=$enableval, enable_manpages=yes)
+AM_CONDITIONAL(ENABLE_MANPAGES, test "$enable_manpages" != "no")
+
 AC_ARG_ENABLE(doc,
   AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
     enable_doc=$enableval, enable_doc=yes)
@@ -894,6 +899,7 @@ AC_CONFIG_FILES([
   lib/opencdk/Makefile
   lib/openpgp/Makefile
   lib/x509/Makefile
+  manpages/Makefile
   po/Makefile.in
   src/Makefile
   src/crywrap/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index da2aecc..61f217b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -24,7 +24,12 @@ EXTRA_DIST = TODO certtool.cfg gnutls.pdf gnutls.html	\
 	gnutls-guile.pdf gnutls-guile.html stamp_enums stamp_functions \
 	doc.mk
 
-SUBDIRS = examples cyclo scripts manpages credentials latex
+SUBDIRS = examples cyclo scripts credentials latex
+
+if ENABLE_MANPAGES
+SUBDIRS += manpages
+endif
+
 if ENABLE_GTK_DOC
 SUBDIRS += reference
 endif
diff --git a/doc/manpages/Makefile.am b/doc/manpages/Makefile.am
index db1f71b..9436c4c 100644
--- a/doc/manpages/Makefile.am
+++ b/doc/manpages/Makefile.am
@@ -25,73 +25,6 @@ dist_man_MANS =
 
 -include $(top_srcdir)/doc/doc.mk
 
-if ENABLE_TOOLS
-dist_man_MANS += gnutls-cli.1 gnutls-cli-debug.1 gnutls-serv.1	\
-	certtool.1 psktool.1 p11tool.1 ocsptool.1 tpmtool.1
-if ENABLE_SRP
-dist_man_MANS += srptool.1
-endif
-if ENABLE_DANE
-dist_man_MANS += danetool.1
-endif
-endif
-
-# Note that our .def files depend on autogen
-# supporting the @subheading texi keyword. This
-# is not currently the case so we do remove it
-# before processing. Once the new version of autogen
-# is out, replace the sed and tmp files with a simple
-# autogen -DMAN_SECTION=1 -Tagman-cmd.tpl $<
-certtool.1: ../../src/certtool-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-ocsptool.1: ../../src/ocsptool-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-danetool.1: ../../src/danetool-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-gnutls-cli.1: ../../src/cli-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-gnutls-serv.1: ../../src/serv-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-gnutls-cli-debug.1: ../../src/cli-debug-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-srptool.1: ../../src/srptool-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-p11tool.1: ../../src/p11tool-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-tpmtool.1: ../../src/tpmtool-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
-psktool.1: ../../src/psktool-args.def
-	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
-	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
-	rm -f "$<".tmp
-
 APIMANS =
 APIMANS += gnutls_aead_cipher_decrypt.3
 APIMANS += gnutls_aead_cipher_deinit.3
diff --git a/manpages/Makefile.am b/manpages/Makefile.am
new file mode 100644
index 0000000..c95510b
--- /dev/null
+++ b/manpages/Makefile.am
@@ -0,0 +1,89 @@
+## Process this file with automake to produce Makefile.in
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+#
+# Author: Nikos Mavroyanopoulos, Simon Josefsson
+#
+# This file is part of GnuTLS.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+dist_man_MANS =
+
+if ENABLE_TOOLS
+dist_man_MANS += gnutls-cli.1 gnutls-cli-debug.1 gnutls-serv.1	\
+	certtool.1 psktool.1 p11tool.1 ocsptool.1 tpmtool.1
+if ENABLE_SRP
+dist_man_MANS += srptool.1
+endif
+if ENABLE_DANE
+dist_man_MANS += danetool.1
+endif
+endif
+
+# Note that our .def files depend on autogen
+# supporting the @subheading texi keyword. This
+# is not currently the case so we do remove it
+# before processing. Once the new version of autogen
+# is out, replace the sed and tmp files with a simple
+# autogen -DMAN_SECTION=1 -Tagman-cmd.tpl $<
+certtool.1: ../src/certtool-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+ocsptool.1: ../src/ocsptool-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+danetool.1: ../src/danetool-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+gnutls-cli.1: ../src/cli-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+gnutls-serv.1: ../src/serv-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+gnutls-cli-debug.1: ../src/cli-debug-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+srptool.1: ../src/srptool-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+p11tool.1: ../src/p11tool-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+tpmtool.1: ../src/tpmtool-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
+
+psktool.1: ../src/psktool-args.def
+	-sed 's/@subheading \(.*\)/@*\n at var{\1}\n@*/' $< > "$<".tmp && \
+	autogen -DMAN_SECTION=1 -Tagman-cmd.tpl "$<".tmp && \
+	rm -f "$<".tmp
-- 
2.4.10




More information about the Gnutls-devel mailing list