From 5bbc6dd7f124685ce9408f97308ee3a75beecfaf Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Thu, 4 Jun 2020 19:02:27 +0200 Subject: [PATCH] Fix "make dist" Make various adjustments necessary to enable "make dist" to build a BIND source tarball whose contents are complete enough to build binaries, run unit & system tests, and generate documentation on Unix systems. Known outstanding issues: - "make distcheck" does not work yet. - Tests do not work for out-of-tree source-tarball-based builds. - Source tarballs are not complete enough for building on Windows. All of the above will be addressed in due course. --- Makefile.am | 11 +++ bin/named/Makefile.am | 3 + bin/tests/Makefile.am | 2 + bin/tests/system/Makefile.am | 9 ++ .../system/dlzexternal/driver/Makefile.am | 3 +- bin/tests/system/dyndb/driver/Makefile.am | 9 +- configure.ac | 2 +- doc/Makefile.am | 2 - doc/arm/Makefile.am | 88 +++++++++---------- doc/man/Makefile.am | 37 +++++++- doc/misc/Makefile.am | 9 +- lib/bind9/Makefile.am | 2 + lib/dns/Makefile.am | 6 +- lib/dns/tests/Makefile.am | 7 ++ lib/irs/Makefile.am | 2 + lib/irs/tests/Makefile.am | 2 + lib/isc/Makefile.am | 3 + lib/isc/tests/Makefile.am | 8 +- lib/isccc/Makefile.am | 2 + lib/isccfg/Makefile.am | 2 + lib/isccfg/tests/Makefile.am | 3 +- lib/ns/Makefile.am | 2 + lib/ns/tests/Makefile.am | 2 + 23 files changed, 162 insertions(+), 54 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6ea8e8d4ca..13e499f897 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,3 +11,14 @@ bind.keys.h: bind.keys Makefile dist_sysconf_DATA = bind.keys .PHONY: doc + +EXTRA_DIST = \ + util/bindkeys.pl \ + contrib \ + CHANGES \ + COPYRIGHT \ + LICENSE \ + *.md + +dist-hook: + find $(distdir) -type f -name .gitignore -delete diff --git a/bin/named/Makefile.am b/bin/named/Makefile.am index 718cfd405d..3717fb9fc9 100644 --- a/bin/named/Makefile.am +++ b/bin/named/Makefile.am @@ -37,6 +37,8 @@ nodist_named_SOURCES = xsl.c BUILT_SOURCES = xsl.c CLEANFILES = xsl.c +EXTRA_DIST = bind9.xsl + xsl.c: bind9.xsl Makefile (echo 'const char xslmsg[] =' && \ $(SED) -e 's,\",\\\",g' \ @@ -61,6 +63,7 @@ named_SOURCES = \ zoneconf.c \ unix/dlz_dlopen_driver.c \ unix/os.c \ + include/dlz/dlz_dlopen_driver.h \ include/named/builtin.h \ include/named/config.h \ include/named/control.h \ diff --git a/bin/tests/Makefile.am b/bin/tests/Makefile.am index fc017eb1f2..2947df96c9 100644 --- a/bin/tests/Makefile.am +++ b/bin/tests/Makefile.am @@ -11,3 +11,5 @@ AM_CPPFLAGS += \ LDADD = \ $(LIBISC_LIBS) \ $(LIBDNS_LIBS) + +EXTRA_DIST = prepare-softhsm2.sh diff --git a/bin/tests/system/Makefile.am b/bin/tests/system/Makefile.am index 003d8698a8..9c812ad8cf 100644 --- a/bin/tests/system/Makefile.am +++ b/bin/tests/system/Makefile.am @@ -1,5 +1,14 @@ include $(top_srcdir)/Makefile.top +EXTRA_DIST = . + +# Source tarballs must not contain configure/build artifacts. +dist-hook: + git clean -n -x -d | \ + grep -v "Makefile.in$$" | \ + sed -n "s|^Would remove \(.*\)|$(distdir)/\1|p" | \ + xargs -I{} rm -rf "{}" + SUBDIRS = dyndb/driver dlzexternal/driver AM_CPPFLAGS += \ diff --git a/bin/tests/system/dlzexternal/driver/Makefile.am b/bin/tests/system/dlzexternal/driver/Makefile.am index 418ec59de0..8d9bc0131e 100644 --- a/bin/tests/system/dlzexternal/driver/Makefile.am +++ b/bin/tests/system/dlzexternal/driver/Makefile.am @@ -8,6 +8,7 @@ dlzexternal_LTLIBRARIES = dlzexternal.la dlzexternaldir = $(abs_builddir) dlzexternal_la_SOURCES = \ - driver.c + driver.c \ + driver.h dlzexternal_la_LDFLAGS = -avoid-version -module -shared -export-dynamic diff --git a/bin/tests/system/dyndb/driver/Makefile.am b/bin/tests/system/dyndb/driver/Makefile.am index c8751239d8..c90510c80e 100644 --- a/bin/tests/system/dyndb/driver/Makefile.am +++ b/bin/tests/system/dyndb/driver/Makefile.am @@ -14,6 +14,13 @@ sample_la_SOURCES = \ lock.c \ log.c \ syncptr.c \ - zone.c + zone.c \ + db.h \ + instance.h \ + lock.h \ + log.h \ + syncptr.h \ + util.h \ + zone.h sample_la_LDFLAGS = -avoid-version -module -shared -export-dynamic diff --git a/configure.ac b/configure.ac index a1787adf66..8fb9cac1c9 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ AC_DEFINE_UNQUOTED([PACKAGE_CONFIGARGS], ["$bind_CONFIGARGS"], [Either 'defaults AC_DEFINE([PACKAGE_BUILDER], ["make"], [make or Visual Studio]) AC_CONFIG_SRCDIR([bin/named/main.c]) -AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz -Wall -Werror]) +AM_INIT_AUTOMAKE([1.9 tar-pax foreign subdir-objects dist-xz -Wall -Werror]) AM_SILENT_RULES([yes]) AM_EXTRA_RECURSIVE_TARGETS([test unit doc]) diff --git a/doc/Makefile.am b/doc/Makefile.am index c9722094dd..2811d5a65b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -7,5 +7,3 @@ endif if HAVE_SPHINX_BUILD SUBDIRS += man arm endif HAVE_SPHINX_BUILD - -EXTRA_DIST = notes/ diff --git a/doc/arm/Makefile.am b/doc/arm/Makefile.am index f20239ea66..ce17e48bc8 100644 --- a/doc/arm/Makefile.am +++ b/doc/arm/Makefile.am @@ -1,49 +1,49 @@ include $(top_srcdir)/Makefile.top include $(top_srcdir)/Makefile.docs -EXTRA_DIST = \ - conf.py \ - acl.grammar.rst \ - advanced.rst \ - catz.rst \ - configuration.rst \ - controls.grammar.rst \ - delegation-only.zoneopt.rst \ - dlz.rst \ - dnssec-keys.grammar.rst \ - dnssec.rst \ - dyndb.rst \ - forward.zoneopt.rst \ - general.rst \ - hint.zoneopt.rst \ - history.rst \ - in-view.zoneopt.rst \ - index.rst \ - introduction.rst \ - key.grammar.rst \ - logging-categories.rst \ - logging.grammar.rst \ - managed-keys.grammar.rst \ - managed-keys.rst \ - manpages.rst \ - master.zoneopt.rst \ - masters.grammar.rst \ - mirror.zoneopt.rst \ - notes.rst \ - options.grammar.rst \ - pkcs11.rst \ - plugins.rst \ - redirect.zoneopt.rst \ - reference.rst \ - requirements.rst \ - security.rst \ - server.grammar.rst \ - slave.zoneopt.rst \ - static-stub.zoneopt.rst \ - statistics-channels.grammar.rst \ - stub.zoneopt.rst \ - troubleshooting.rst \ - trusted-keys.grammar.rst +EXTRA_DIST = \ + conf.py \ + advanced.rst \ + catz.rst \ + configuration.rst \ + dlz.rst \ + dnssec.rst \ + dyndb.rst \ + general.rst \ + history.rst \ + index.rst \ + introduction.rst \ + logging-categories.rst \ + managed-keys.rst \ + manpages.rst \ + notes.rst \ + pkcs11.rst \ + plugins.rst \ + reference.rst \ + requirements.rst \ + security.rst \ + troubleshooting.rst \ + ../misc/acl.grammar.rst \ + ../misc/controls.grammar.rst \ + ../misc/delegation-only.zoneopt.rst \ + ../misc/forward.zoneopt.rst \ + ../misc/hint.zoneopt.rst \ + ../misc/in-view.zoneopt.rst \ + ../misc/key.grammar.rst \ + ../misc/logging.grammar.rst \ + ../misc/managed-keys.grammar.rst \ + ../misc/master.zoneopt.rst \ + ../misc/masters.grammar.rst \ + ../misc/mirror.zoneopt.rst \ + ../misc/options.grammar.rst \ + ../misc/redirect.zoneopt.rst \ + ../misc/server.grammar.rst \ + ../misc/slave.zoneopt.rst \ + ../misc/static-stub.zoneopt.rst \ + ../misc/statistics-channels.grammar.rst \ + ../misc/stub.zoneopt.rst \ + ../misc/trusted-keys.grammar.rst \ + ../notes/*.rst html-local: $(AM_V_SPHINX)$(SPHINX_BUILD) -b html -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html @@ -66,7 +66,7 @@ epub: install-epub: $(INSTALL) -d $(DESTDIR)/$(docdir) - $(INSTALL_DATA) $(SPHINXBUILDDIR)/epub/KnotDNS.epub $(DESTDIR)/$(docdir)/ + $(INSTALL_DATA) $(SPHINXBUILDDIR)/epub/*.epub $(DESTDIR)/$(docdir)/ if HAVE_XELATEX pdf-local: diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 5e661068a7..3821376f80 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -18,6 +18,7 @@ MANPAGES_RST = \ dnstap-read.rst \ filter-aaaa.rst \ host.rst \ + index.rst \ mdig.rst \ named-checkconf.rst \ named-checkzone.rst \ @@ -35,7 +36,41 @@ MANPAGES_RST = \ pkcs11-tokens.rst \ rndc-confgen.rst \ rndc.conf.rst \ - rndc.rst + rndc.rst \ + ../../bin/check/named-checkconf.rst \ + ../../bin/check/named-checkzone.rst \ + ../../bin/confgen/ddns-confgen.rst \ + ../../bin/confgen/rndc-confgen.rst \ + ../../bin/delv/delv.rst \ + ../../bin/dig/dig.rst \ + ../../bin/dig/host.rst \ + ../../bin/dig/nslookup.rst \ + ../../bin/dnssec/dnssec-cds.rst \ + ../../bin/dnssec/dnssec-dsfromkey.rst \ + ../../bin/dnssec/dnssec-importkey.rst \ + ../../bin/dnssec/dnssec-keyfromlabel.rst \ + ../../bin/dnssec/dnssec-keygen.rst \ + ../../bin/dnssec/dnssec-revoke.rst \ + ../../bin/dnssec/dnssec-settime.rst \ + ../../bin/dnssec/dnssec-signzone.rst \ + ../../bin/dnssec/dnssec-verify.rst \ + ../../bin/named/named.rst \ + ../../bin/nsupdate/nsupdate.rst \ + ../../bin/pkcs11/pkcs11-destroy.rst \ + ../../bin/pkcs11/pkcs11-keygen.rst \ + ../../bin/pkcs11/pkcs11-list.rst \ + ../../bin/pkcs11/pkcs11-tokens.rst \ + ../../bin/plugins/filter-aaaa.rst \ + ../../bin/rndc/rndc.conf.rst \ + ../../bin/rndc/rndc.rst \ + ../../bin/tools/arpaname.rst \ + ../../bin/tools/dnstap-read.rst \ + ../../bin/tools/mdig.rst \ + ../../bin/tools/named-journalprint.rst \ + ../../bin/tools/named-nzd2nzf.rst \ + ../../bin/tools/named-rrchecker.rst \ + ../../bin/tools/nsec3hash.rst + man_MANS = \ arpaname.1 \ diff --git a/doc/misc/Makefile.am b/doc/misc/Makefile.am index 3eaace0b59..26a3980b58 100644 --- a/doc/misc/Makefile.am +++ b/doc/misc/Makefile.am @@ -51,7 +51,14 @@ BUILT_SOURCES = \ managed-keys.grammar.rst \ trusted-keys.grammar.rst -EXTRA_DIST = $(BUILT_SOURCES) +EXTRA_DIST = \ + $(BUILT_SOURCES) \ + format-options.pl \ + rst-grammars.pl \ + rst-options.pl \ + rst-zoneopt.pl \ + sort-options.pl + MAINTAINERCLEANFILES = $(BUILT_SOURCES) options: cfg_test diff --git a/lib/bind9/Makefile.am b/lib/bind9/Makefile.am index ffba4ace11..3501cef49c 100644 --- a/lib/bind9/Makefile.am +++ b/lib/bind9/Makefile.am @@ -28,3 +28,5 @@ libbind9_la_LIBADD = \ libbind9_la_LDFLAGS = \ $(libbind9_VERSION_INFO) + +EXTRA_DIST = api diff --git a/lib/dns/Makefile.am b/lib/dns/Makefile.am index 5f6abc14db..78a2752c90 100644 --- a/lib/dns/Makefile.am +++ b/lib/dns/Makefile.am @@ -25,7 +25,11 @@ gen_SOURCES = gen.c gen-unix.h gen_CPPFLAGS = \ $(AM_CPPFLAGS) -EXTRA_DIST = gen-win32.h +EXTRA_DIST = \ + api \ + dnstap.proto \ + gen-win32.h \ + rdata/* include/dns/enumtype.h: gen Makefile mkdir -p include/dns diff --git a/lib/dns/tests/Makefile.am b/lib/dns/tests/Makefile.am index 9f3ee80cce..04ef09c0f5 100644 --- a/lib/dns/tests/Makefile.am +++ b/lib/dns/tests/Makefile.am @@ -109,4 +109,11 @@ rsa_test_CPPFLAGS = \ unit-local: check +EXTRA_DIST = \ + Kdh.+002+18602.key \ + Krsa.+005+29235.key \ + mkraw.pl \ + testdata \ + testkeys + LOG_COMPILER = $(builddir)/../../unit-test-driver.sh diff --git a/lib/irs/Makefile.am b/lib/irs/Makefile.am index 6330e4e986..75d514cbcb 100644 --- a/lib/irs/Makefile.am +++ b/lib/irs/Makefile.am @@ -29,3 +29,5 @@ libirs_la_LDFLAGS = \ if HAVE_CMOCKA SUBDIRS = tests endif + +EXTRA_DIST = api diff --git a/lib/irs/tests/Makefile.am b/lib/irs/tests/Makefile.am index 6b9bb583eb..d256663853 100644 --- a/lib/irs/tests/Makefile.am +++ b/lib/irs/tests/Makefile.am @@ -16,4 +16,6 @@ TESTS = $(check_PROGRAMS) unit-local: check +EXTRA_DIST = testdata + LOG_COMPILER = $(builddir)/../../unit-test-driver.sh diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index 8700832011..19bf5b677e 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -94,6 +94,7 @@ libisc_la_HEADERS = \ pthreads/include/isc/mutex.h \ pthreads/include/isc/once.h \ pthreads/include/isc/thread.h \ + unix/errno2result.h \ unix/include/isc/align.h \ unix/include/isc/dir.h \ unix/include/isc/netdb.h \ @@ -252,3 +253,5 @@ endif HAVE_LIBXML2 if HAVE_CMOCKA SUBDIRS = tests endif + +EXTRA_DIST = api diff --git a/lib/isc/tests/Makefile.am b/lib/isc/tests/Makefile.am index 3723a392de..443a925bdb 100644 --- a/lib/isc/tests/Makefile.am +++ b/lib/isc/tests/Makefile.am @@ -9,7 +9,10 @@ LDADD += \ $(LIBISC_LIBS) check_LTLIBRARIES = libisctest.la -libisctest_la_SOURCES = isctest.c isctest.h +libisctest_la_SOURCES = \ + ../unix/socket_p.h \ + isctest.c \ + isctest.h check_PROGRAMS = \ aes_test \ @@ -34,6 +37,7 @@ check_PROGRAMS = \ regex_test \ result_test \ safe_test \ + siphash_test \ sockaddr_test \ socket_test \ symtab_test \ @@ -66,4 +70,6 @@ random_test_LDADD = \ unit-local: check +EXTRA_DIST = testdata + LOG_COMPILER = $(builddir)/../../unit-test-driver.sh diff --git a/lib/isccc/Makefile.am b/lib/isccc/Makefile.am index 017f822a32..477cc525fb 100644 --- a/lib/isccc/Makefile.am +++ b/lib/isccc/Makefile.am @@ -40,3 +40,5 @@ libisccc_la_LDFLAGS = \ if HAVE_CMOCKA SUBDIRS = tests endif + +EXTRA_DIST = api diff --git a/lib/isccfg/Makefile.am b/lib/isccfg/Makefile.am index bd337f67ae..ef0cd16fc8 100644 --- a/lib/isccfg/Makefile.am +++ b/lib/isccfg/Makefile.am @@ -37,3 +37,5 @@ libisccfg_la_LDFLAGS = \ if HAVE_CMOCKA SUBDIRS = tests endif + +EXTRA_DIST = api diff --git a/lib/isccfg/tests/Makefile.am b/lib/isccfg/tests/Makefile.am index ce4ea0fd42..19b82a45b3 100644 --- a/lib/isccfg/tests/Makefile.am +++ b/lib/isccfg/tests/Makefile.am @@ -11,7 +11,8 @@ LDADD += \ $(LIBDNS_LIBS) \ $(LIBISCCFG_LIBS) -check_PROGRAMS = \ +check_PROGRAMS = \ + duration_test \ parser_test TESTS = $(check_PROGRAMS) diff --git a/lib/ns/Makefile.am b/lib/ns/Makefile.am index 06e39b9af4..b2f81ccf08 100644 --- a/lib/ns/Makefile.am +++ b/lib/ns/Makefile.am @@ -56,3 +56,5 @@ libns_la_LDFLAGS = \ if HAVE_CMOCKA SUBDIRS = tests endif + +EXTRA_DIST = api diff --git a/lib/ns/tests/Makefile.am b/lib/ns/tests/Makefile.am index 415a21ee96..092360cebd 100644 --- a/lib/ns/tests/Makefile.am +++ b/lib/ns/tests/Makefile.am @@ -46,4 +46,6 @@ endif unit-local: check +EXTRA_DIST = testdata + LOG_COMPILER = $(builddir)/../../unit-test-driver.sh