7726ce
From c5b39725cd4f3f30eac7eeafd7802005a1fad533 Mon Sep 17 00:00:00 2001
20ccb8
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
20ccb8
Date: Wed, 25 Jul 2018 12:24:16 +0200
20ccb8
Subject: [PATCH] Use make automatic variables to install updated manuals
20ccb8
20ccb8
Make will choose modified manual from build directory or original from source
20ccb8
directory automagically. Take advantage of install tool feature.
20ccb8
Install all files in single command instead of iterating on each of them.
20ccb8
---
20ccb8
 bin/check/Makefile.in   |  8 +++++---
20ccb8
 bin/confgen/Makefile.in |  9 +++++----
20ccb8
 bin/delv/Makefile.in    |  6 ++++--
20ccb8
 bin/dig/Makefile.in     |  8 ++++----
20ccb8
 bin/dnssec/Makefile.in  |  6 ++++--
7726ce
 bin/named/Makefile.in   | 12 +++++++++---
20ccb8
 bin/pkcs11/Makefile.in  |  9 ++++-----
20ccb8
 bin/python/Makefile.in  |  8 ++++----
20ccb8
 bin/tools/Makefile.in   | 25 +++++++++++++++----------
7726ce
 9 files changed, 54 insertions(+), 37 deletions(-)
20ccb8
20ccb8
diff --git a/bin/check/Makefile.in b/bin/check/Makefile.in
7726ce
index 8f009a4..de3c066 100644
20ccb8
--- a/bin/check/Makefile.in
20ccb8
+++ b/bin/check/Makefile.in
7726ce
@@ -84,12 +84,14 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
-install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs
20ccb8
+install-man8: ${MANPAGES}
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+	(cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8)
20ccb8
+
20ccb8
+install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs install-man8
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkconf@EXEEXT@ ${DESTDIR}${sbindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkzone@EXEEXT@ ${DESTDIR}${sbindir}
20ccb8
 	(cd ${DESTDIR}${sbindir}; rm -f named-compilezone@EXEEXT@; ${LINK_PROGRAM} named-checkzone@EXEEXT@ named-compilezone@EXEEXT@)
ad7b3b
-	for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done
20ccb8
-	(cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8)
20ccb8
 
20ccb8
 uninstall::
20ccb8
 	rm -f ${DESTDIR}${mandir}/man8/named-compilezone.8
20ccb8
diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in
7726ce
index 0588f8b..44d87fd 100644
20ccb8
--- a/bin/confgen/Makefile.in
20ccb8
+++ b/bin/confgen/Makefile.in
7726ce
@@ -93,13 +93,14 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
-install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs
20ccb8
+install-man8: rndc-confgen.8 ddns-confgen.8
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+	(cd ${DESTDIR}${mandir}/man8; rm -f tsig-keygen.8; ${LINK_PROGRAM} ddns-confgen.8 tsig-keygen.8)
20ccb8
+
20ccb8
+install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs install-man8
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} rndc-confgen@EXEEXT@ ${DESTDIR}${sbindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ddns-confgen@EXEEXT@ ${DESTDIR}${sbindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/rndc-confgen.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/ddns-confgen.8 ${DESTDIR}${mandir}/man8
20ccb8
 	(cd ${DESTDIR}${sbindir}; rm -f tsig-keygen@EXEEXT@; ${LINK_PROGRAM} ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@)
20ccb8
-	(cd ${DESTDIR}${mandir}/man8; rm -f tsig-keygen.8; ${LINK_PROGRAM} ddns-confgen.8 tsig-keygen.8)
20ccb8
 
20ccb8
 uninstall::
20ccb8
 	rm -f ${DESTDIR}${mandir}/man8/tsig-keygen.8
20ccb8
diff --git a/bin/delv/Makefile.in b/bin/delv/Makefile.in
7726ce
index ea106f8..77adc91 100644
20ccb8
--- a/bin/delv/Makefile.in
20ccb8
+++ b/bin/delv/Makefile.in
20ccb8
@@ -63,10 +63,12 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
20ccb8
 
20ccb8
-install:: delv@EXEEXT@ installdirs
20ccb8
+install-man1: delv.1
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
20ccb8
+
20ccb8
+install:: delv@EXEEXT@ installdirs install-man1
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
20ccb8
 		delv@EXEEXT@ ${DESTDIR}${bindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/delv.1 ${DESTDIR}${mandir}/man1
20ccb8
 
20ccb8
 uninstall::
20ccb8
 	rm -f ${DESTDIR}${mandir}/man1/delv.1
20ccb8
diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in
7726ce
index 8ea146f..3a97024 100644
20ccb8
--- a/bin/dig/Makefile.in
20ccb8
+++ b/bin/dig/Makefile.in
7726ce
@@ -93,16 +93,16 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
20ccb8
 
20ccb8
-install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs
20ccb8
+install-man1: ${MANPAGES}
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
20ccb8
+
20ccb8
+install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs install-man1
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
20ccb8
 		dig@EXEEXT@ ${DESTDIR}${bindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
20ccb8
 		host@EXEEXT@ ${DESTDIR}${bindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
20ccb8
 		nslookup@EXEEXT@ ${DESTDIR}${bindir}
20ccb8
-	for m in ${MANPAGES}; do \
ad7b3b
-		${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1 || exit 1; \
ad7b3b
-	done
20ccb8
 
20ccb8
 uninstall::
20ccb8
 	for m in ${MANPAGES}; do \
20ccb8
diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in
7726ce
index dfaad27..be1ac3b 100644
20ccb8
--- a/bin/dnssec/Makefile.in
20ccb8
+++ b/bin/dnssec/Makefile.in
7726ce
@@ -114,9 +114,11 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
-install:: ${TARGETS} installdirs
20ccb8
+install-man8: ${MANPAGES}
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+
20ccb8
+install:: ${TARGETS} installdirs install-man8
ad7b3b
 	for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir} || exit 1; done
ad7b3b
-	for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done
20ccb8
 
20ccb8
 uninstall::
ad7b3b
 	for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done
20ccb8
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
7726ce
index 0485002..10d568f 100644
20ccb8
--- a/bin/named/Makefile.in
20ccb8
+++ b/bin/named/Makefile.in
7726ce
@@ -169,10 +169,16 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
20ccb8
 
7726ce
-install:: named@EXEEXT@ installdirs
20ccb8
+install-man5: named.conf.5
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man5
20ccb8
+
7726ce
+install-man8: named.8
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+
20ccb8
+install-man: install-man5 install-man8
20ccb8
+
7726ce
+install:: named@EXEEXT@ installdirs install-man
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5
20ccb8
 
20ccb8
 uninstall::
20ccb8
 	rm -f ${DESTDIR}${mandir}/man5/named.conf.5
20ccb8
diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in
7726ce
index 2fd9861..96aec05 100644
20ccb8
--- a/bin/pkcs11/Makefile.in
20ccb8
+++ b/bin/pkcs11/Makefile.in
7726ce
@@ -69,7 +69,10 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
-install:: ${TARGETS} installdirs
20ccb8
+install-man8: ${MANPAGES}
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+
20ccb8
+install:: ${TARGETS} installdirs install-man8
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-list@EXEEXT@ \
20ccb8
 		${DESTDIR}${sbindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-destroy@EXEEXT@ \
7726ce
@@ -78,10 +81,6 @@ install:: ${TARGETS} installdirs
20ccb8
 		${DESTDIR}${sbindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-tokens@EXEEXT@ \
20ccb8
 		${DESTDIR}${sbindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/pkcs11-list.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/pkcs11-destroy.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/pkcs11-keygen.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/pkcs11-tokens.8 ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
 uninstall::
20ccb8
 	rm -f ${DESTDIR}${mandir}/man8/pkcs11-tokens.8
20ccb8
diff --git a/bin/python/Makefile.in b/bin/python/Makefile.in
ad7b3b
index aa678d4..064c404 100644
20ccb8
--- a/bin/python/Makefile.in
20ccb8
+++ b/bin/python/Makefile.in
20ccb8
@@ -47,13 +47,13 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
-install:: ${TARGETS} installdirs
20ccb8
+install-man8: ${MANPAGES}
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+
20ccb8
+install:: ${TARGETS} installdirs install-man8
20ccb8
 	${INSTALL_SCRIPT} dnssec-checkds ${DESTDIR}${sbindir}
20ccb8
 	${INSTALL_SCRIPT} dnssec-coverage ${DESTDIR}${sbindir}
20ccb8
 	${INSTALL_SCRIPT} dnssec-keymgr ${DESTDIR}${sbindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/dnssec-checkds.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/dnssec-coverage.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/dnssec-keymgr.8 ${DESTDIR}${mandir}/man8
20ccb8
 	if test -n "${PYTHON}" ; then \
20ccb8
 		if test -n "${DESTDIR}" ; then \
20ccb8
 			${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} @PYTHON_INSTALL_LIB@ ; \
20ccb8
diff --git a/bin/tools/Makefile.in b/bin/tools/Makefile.in
7726ce
index 0fd2847..3c4f028 100644
20ccb8
--- a/bin/tools/Makefile.in
20ccb8
+++ b/bin/tools/Makefile.in
7726ce
@@ -107,17 +107,27 @@ installdirs:
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
20ccb8
 	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
-nzd:
20ccb8
+nzd-man: named-nzd2nzf.8
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+
20ccb8
+nzd: nzd-man
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-nzd2nzf@EXEEXT@ \
20ccb8
 		${DESTDIR}${sbindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/named-nzd2nzf.8 ${DESTDIR}${mandir}/man8
20ccb8
 
20ccb8
-dnstap:
20ccb8
+dnstap-man: dnstap-read.1
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
20ccb8
+
20ccb8
+dnstap: dnstap-man
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} dnstap-read@EXEEXT@ \
20ccb8
 		${DESTDIR}${bindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/dnstap-read.1 ${DESTDIR}${mandir}/man1
20ccb8
 
20ccb8
-install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@
20ccb8
+install-man1: arpaname.1 named-rrchecker.1 mdig.1
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1
20ccb8
+
20ccb8
+install-man8: named-journalprint.8 nsec3hash.8
20ccb8
+	${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
20ccb8
+
20ccb8
+install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@ install-man1 install-man8
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} arpaname@EXEEXT@ \
20ccb8
 		${DESTDIR}${bindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-journalprint@EXEEXT@ \
7726ce
@@ -128,11 +138,6 @@ install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@
20ccb8
 		${DESTDIR}${sbindir}
20ccb8
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} mdig@EXEEXT@ \
20ccb8
 		${DESTDIR}${bindir}
20ccb8
-	${INSTALL_DATA} ${srcdir}/arpaname.1 ${DESTDIR}${mandir}/man1
20ccb8
-	${INSTALL_DATA} ${srcdir}/named-journalprint.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/named-rrchecker.1 ${DESTDIR}${mandir}/man1
20ccb8
-	${INSTALL_DATA} ${srcdir}/nsec3hash.8 ${DESTDIR}${mandir}/man8
20ccb8
-	${INSTALL_DATA} ${srcdir}/mdig.1 ${DESTDIR}${mandir}/man1
20ccb8
 
20ccb8
 uninstall::
20ccb8
 	rm -f ${DESTDIR}${mandir}/man1/mdig.1
20ccb8
-- 
7726ce
2.20.1
20ccb8