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