3ce7d3
From e462d022a9dc52c40aece6f8ba3123ff3ffa59ed Mon Sep 17 00:00:00 2001
3ce7d3
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
3ce7d3
Date: Wed, 25 Jul 2018 12:24:16 +0200
3ce7d3
Subject: [PATCH] Use make automatic variables to install updated manuals
3ce7d3
3ce7d3
Make will choose modified manual from build directory or original from source
3ce7d3
directory automagically. Take advantage of install tool feature.
3ce7d3
Install all files in single command instead of iterating on each of them.
3ce7d3
---
3ce7d3
 bin/check/Makefile.in   |  8 +++++---
3ce7d3
 bin/confgen/Makefile.in |  9 +++++----
3ce7d3
 bin/delv/Makefile.in    |  6 ++++--
3ce7d3
 bin/dig/Makefile.in     |  8 ++++----
3ce7d3
 bin/dnssec/Makefile.in  |  6 ++++--
3ce7d3
 bin/named/Makefile.in   | 13 +++++++++----
3ce7d3
 bin/pkcs11/Makefile.in  |  9 ++++-----
3ce7d3
 bin/python/Makefile.in  |  8 ++++----
3ce7d3
 bin/tools/Makefile.in   | 25 +++++++++++++++----------
3ce7d3
 9 files changed, 54 insertions(+), 38 deletions(-)
3ce7d3
3ce7d3
diff --git a/bin/check/Makefile.in b/bin/check/Makefile.in
3ce7d3
index 12f48d2d23..d8eac4c714 100644
3ce7d3
--- a/bin/check/Makefile.in
3ce7d3
+++ b/bin/check/Makefile.in
3ce7d3
@@ -83,12 +83,14 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs
3ce7d3
+install-man8: ${MANPAGES}
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+	(cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8)
3ce7d3
+
3ce7d3
+install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs install-man8
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkconf@EXEEXT@ ${DESTDIR}${sbindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkzone@EXEEXT@ ${DESTDIR}${sbindir}
3ce7d3
 	(cd ${DESTDIR}${sbindir}; rm -f named-compilezone@EXEEXT@; ${LINK_PROGRAM} named-checkzone@EXEEXT@ named-compilezone@EXEEXT@)
3ce7d3
-	for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done
3ce7d3
-	(cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8)
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	rm -f ${DESTDIR}${mandir}/man8/named-compilezone.8
3ce7d3
diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in
3ce7d3
index 87f13dda4b..7865c0c73e 100644
3ce7d3
--- a/bin/confgen/Makefile.in
3ce7d3
+++ b/bin/confgen/Makefile.in
3ce7d3
@@ -95,13 +95,14 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs
3ce7d3
+install-man8: rndc-confgen.8 ddns-confgen.8
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+	(cd ${DESTDIR}${mandir}/man8; rm -f tsig-keygen.8; ${LINK_PROGRAM} ddns-confgen.8 tsig-keygen.8)
3ce7d3
+
3ce7d3
+install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs install-man8
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} rndc-confgen@EXEEXT@ ${DESTDIR}${sbindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ddns-confgen@EXEEXT@ ${DESTDIR}${sbindir}
3ce7d3
-	${INSTALL_DATA} ${srcdir}/rndc-confgen.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/ddns-confgen.8 ${DESTDIR}${mandir}/man8
3ce7d3
 	(cd ${DESTDIR}${sbindir}; rm -f tsig-keygen@EXEEXT@; ${LINK_PROGRAM} ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@)
3ce7d3
-	(cd ${DESTDIR}${mandir}/man8; rm -f tsig-keygen.8; ${LINK_PROGRAM} ddns-confgen.8 tsig-keygen.8)
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	rm -f ${DESTDIR}${mandir}/man8/tsig-keygen.8
3ce7d3
diff --git a/bin/delv/Makefile.in b/bin/delv/Makefile.in
3ce7d3
index e2d2802262..19361a83ea 100644
3ce7d3
--- a/bin/delv/Makefile.in
3ce7d3
+++ b/bin/delv/Makefile.in
3ce7d3
@@ -63,10 +63,12 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
3ce7d3
 
3ce7d3
-install:: delv@EXEEXT@ installdirs
3ce7d3
+install-man1: delv.1
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
3ce7d3
+
3ce7d3
+install:: delv@EXEEXT@ installdirs install-man1
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
3ce7d3
 		delv@EXEEXT@ ${DESTDIR}${bindir}
3ce7d3
-	${INSTALL_DATA} ${srcdir}/delv.1 ${DESTDIR}${mandir}/man1
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	rm -f ${DESTDIR}${mandir}/man1/delv.1
3ce7d3
diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in
3ce7d3
index 773ac46395..3edd951e7e 100644
3ce7d3
--- a/bin/dig/Makefile.in
3ce7d3
+++ b/bin/dig/Makefile.in
3ce7d3
@@ -91,16 +91,16 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
3ce7d3
 
3ce7d3
-install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs
3ce7d3
+install-man1: ${MANPAGES}
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
3ce7d3
+
3ce7d3
+install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs install-man1
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
3ce7d3
 		dig@EXEEXT@ ${DESTDIR}${bindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
3ce7d3
 		host@EXEEXT@ ${DESTDIR}${bindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
3ce7d3
 		nslookup@EXEEXT@ ${DESTDIR}${bindir}
3ce7d3
-	for m in ${MANPAGES}; do \
3ce7d3
-		${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1; \
3ce7d3
-		done
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	for m in ${MANPAGES}; do \
3ce7d3
diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in
3ce7d3
index 1be1d5ffc6..1d0c4ce5c1 100644
3ce7d3
--- a/bin/dnssec/Makefile.in
3ce7d3
+++ b/bin/dnssec/Makefile.in
3ce7d3
@@ -110,9 +110,11 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-install:: ${TARGETS} installdirs
3ce7d3
+install-man8: ${MANPAGES}
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+
3ce7d3
+install:: ${TARGETS} installdirs install-man8
3ce7d3
 	for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir}; done
3ce7d3
-	for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m ; done
3ce7d3
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
3ce7d3
index 1c413973d0..03e4cb849b 100644
3ce7d3
--- a/bin/named/Makefile.in
3ce7d3
+++ b/bin/named/Makefile.in
3ce7d3
@@ -172,12 +172,17 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs
3ce7d3
+install-man5: named.conf.5
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man5
3ce7d3
+
3ce7d3
+install-man8: named.8 lwresd.8
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+
3ce7d3
+install-man: install-man5 install-man8
3ce7d3
+
3ce7d3
+install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs install-man
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir}
3ce7d3
 	(cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@)
3ce7d3
-	${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/lwresd.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	rm -f ${DESTDIR}${mandir}/man5/named.conf.5
3ce7d3
diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in
3ce7d3
index ae9061626c..a058c91214 100644
3ce7d3
--- a/bin/pkcs11/Makefile.in
3ce7d3
+++ b/bin/pkcs11/Makefile.in
3ce7d3
@@ -71,7 +71,10 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-install:: ${TARGETS} installdirs
3ce7d3
+install-man8: ${MANPAGES}
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+
3ce7d3
+install:: ${TARGETS} installdirs install-man8
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-list@EXEEXT@ \
3ce7d3
 		${DESTDIR}${sbindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-destroy@EXEEXT@ \
3ce7d3
@@ -80,10 +83,6 @@ install:: ${TARGETS} installdirs
3ce7d3
 		${DESTDIR}${sbindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-tokens@EXEEXT@ \
3ce7d3
 		${DESTDIR}${sbindir}
3ce7d3
-	${INSTALL_DATA} ${srcdir}/pkcs11-list.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/pkcs11-destroy.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/pkcs11-keygen.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/pkcs11-tokens.8 ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	rm -f ${DESTDIR}${mandir}/man8/pkcs11-tokens.8
3ce7d3
diff --git a/bin/python/Makefile.in b/bin/python/Makefile.in
3ce7d3
index aa678d47ab..064c404e2f 100644
3ce7d3
--- a/bin/python/Makefile.in
3ce7d3
+++ b/bin/python/Makefile.in
3ce7d3
@@ -47,13 +47,13 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-install:: ${TARGETS} installdirs
3ce7d3
+install-man8: ${MANPAGES}
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+
3ce7d3
+install:: ${TARGETS} installdirs install-man8
3ce7d3
 	${INSTALL_SCRIPT} dnssec-checkds ${DESTDIR}${sbindir}
3ce7d3
 	${INSTALL_SCRIPT} dnssec-coverage ${DESTDIR}${sbindir}
3ce7d3
 	${INSTALL_SCRIPT} dnssec-keymgr ${DESTDIR}${sbindir}
3ce7d3
-	${INSTALL_DATA} ${srcdir}/dnssec-checkds.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/dnssec-coverage.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/dnssec-keymgr.8 ${DESTDIR}${mandir}/man8
3ce7d3
 	if test -n "${PYTHON}" ; then \
3ce7d3
 		if test -n "${DESTDIR}" ; then \
3ce7d3
 			${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} @PYTHON_INSTALL_LIB@ ; \
3ce7d3
diff --git a/bin/tools/Makefile.in b/bin/tools/Makefile.in
3ce7d3
index 7bf2af4cea..c395bc7462 100644
3ce7d3
--- a/bin/tools/Makefile.in
3ce7d3
+++ b/bin/tools/Makefile.in
3ce7d3
@@ -119,17 +119,27 @@ installdirs:
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
3ce7d3
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-nzd:
3ce7d3
+nzd-man: named-nzd2nzf.8
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+
3ce7d3
+nzd: nzd-man
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-nzd2nzf@EXEEXT@ \
3ce7d3
 		${DESTDIR}${sbindir}
3ce7d3
-	${INSTALL_DATA} ${srcdir}/named-nzd2nzf.8 ${DESTDIR}${mandir}/man8
3ce7d3
 
3ce7d3
-dnstap:
3ce7d3
+dnstap-man: dnstap-read.1
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
3ce7d3
+
3ce7d3
+dnstap: dnstap-man
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} dnstap-read@EXEEXT@ \
3ce7d3
 		${DESTDIR}${bindir}
3ce7d3
-	${INSTALL_DATA} ${srcdir}/dnstap-read.1 ${DESTDIR}${mandir}/man1
3ce7d3
 
3ce7d3
-install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@
3ce7d3
+install-man1: arpaname.1 named-rrchecker.1 mdig.1
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
3ce7d3
+
3ce7d3
+install-man8: named-journalprint.8 nsec3hash.8
3ce7d3
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
3ce7d3
+
3ce7d3
+install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@ install-man1 install-man8
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} arpaname@EXEEXT@ \
3ce7d3
 		${DESTDIR}${bindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-journalprint@EXEEXT@ \
3ce7d3
@@ -144,13 +154,8 @@ install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@
3ce7d3
 		${DESTDIR}${sbindir}
3ce7d3
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} mdig@EXEEXT@ \
3ce7d3
 		${DESTDIR}${bindir}
3ce7d3
-	${INSTALL_DATA} ${srcdir}/arpaname.1 ${DESTDIR}${mandir}/man1
3ce7d3
 	${INSTALL_DATA} ${srcdir}/isc-hmac-fixup.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/named-journalprint.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/named-rrchecker.1 ${DESTDIR}${mandir}/man1
3ce7d3
-	${INSTALL_DATA} ${srcdir}/nsec3hash.8 ${DESTDIR}${mandir}/man8
3ce7d3
 	${INSTALL_DATA} ${srcdir}/genrandom.8 ${DESTDIR}${mandir}/man8
3ce7d3
-	${INSTALL_DATA} ${srcdir}/mdig.1 ${DESTDIR}${mandir}/man1
3ce7d3
 
3ce7d3
 uninstall::
3ce7d3
 	rm -f ${DESTDIR}${mandir}/man1/mdig.1
3ce7d3
-- 
3ce7d3
2.14.4
3ce7d3