]> git.draconx.ca Git - rarpd-dx.git/blobdiff - Makefile.am
Remove iputils headings from the man page.
[rarpd-dx.git] / Makefile.am
index 1367d07bbc22f62350955bb00d014d31ebce971a..d0fcc15420d4cf51644c6c19e0d7e1a60e5f60f8 100644 (file)
@@ -6,13 +6,13 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-AM_CPPFLAGS = -DIPUTILS_VERSION='PACKAGE_STRING,'
+EXTRA_DIST = COPYING COPYING.WTFPL2 INSTALL README.md bootstrap
 
 XSLTPROC_MAN = $(XSLTPROC) -o $@ --nonet \
                --stringparam man.output.quietly 1 \
                --stringparam funcsynopsis.style ansi \
                --stringparam man.th.extra1.suppress 1 \
-               --stringparam iputils.version 'rarpd' \
+               --stringparam package '$(PACKAGE)' \
                $(XSLTPROCFLAGS) $(srcdir)/doc/custom-man.xsl
 
 DEV_TOOL_ERROR = { \
@@ -32,7 +32,61 @@ endif
        $(AM_V_GEN) $(XSLTPROC_MAN) $<
 $(dist_man_MANS): $(srcdir)/doc/custom-man.xsl
 MAINTAINERCLEANFILES = $(dist_man_MANS)
-EXTRA_DIST = $(dist_man_MANS:.8=.xml) $(srcdir)/doc/custom-man.xsl
+EXTRA_DIST += $(dist_man_MANS:.8=.xml) $(srcdir)/doc/custom-man.xsl
 
 sbin_PROGRAMS = rarpd
-rarpd_SOURCES = src/rarpd.c src/iputils_common.c src/iputils_common.h
+rarpd_SOURCES = src/rarpd.c
+
+# When running "make dist" in a VPATH build with a read-only srcdir, Automake
+# will produce a distribution with all files read-only.  Moreover, the files
+# are read-only in distdir when the dist hooks are run.  This hook will fix
+# up the permissions.  All dist hooks that modify files in distdir should list
+# unfuck-distdir as a prerequisite.
+dist-hook: unfuck-distdir
+unfuck-distdir:
+       find '$(distdir)' -type f -exec chmod u+w {} +
+.PHONY: unfuck-distdir
+
+GITLOG_FLAGS = --format='%s%n%n%b%n'
+
+dist-hook: generate-changelog
+generate-changelog: unfuck-distdir
+       -: "$${GIT_DIR=$(top_srcdir)/.git}"; \
+         export GIT_DIR; test -d "$$GIT_DIR" || exit 0; { \
+           $(top_srcdir)/gitlog-to-changelog $(GITLOG_FLAGS) && \
+           echo && \
+           cat $(top_srcdir)/ChangeLog.iputils; \
+         } >$(distdir)/ChangeLog.gen && \
+         mv -f '$(distdir)/ChangeLog.gen' '$(distdir)/ChangeLog'
+       rm -f '$(distdir)/ChangeLog.gen'
+.PHONY: generate-changelog
+
+
+GENERIC_V   = $(GENERIC_V_@AM_V@)
+GENERIC_V_  = $(GENERIC_V_@AM_DEFAULT_V@)
+GENERIC_V_0 = @printf '%2.0s%$(DX_ALIGN_V)s %s\n'
+
+TEST_DISTRIBUTION = false
+TEST_DISTRIBUTION_OR_ERROR = if $(TEST_DISTRIBUTION); \
+  then echo 'Proceeding anyway...'; \
+  else echo 'Run $(MAKE) TEST_DISTRIBUTION=true to ignore this failure.'; \
+    false; \
+  fi
+
+distcheck-hook:
+       $(GENERIC_V) : 'CHECK   ' ChangeLog; \
+         $(AWK) '/^Stub/ { print FILENAME ":" NR ":", $$0; exit 1 }' \
+           $(distdir)/ChangeLog || { \
+             echo 'ERROR: *** Packaged ChangeLog was not properly generated from git log.'; \
+             echo '       *** The source version was used instead, but this appears to'; \
+             echo '       *** be the stub from a git checkout.  The "git" and "perl"'; \
+             echo '       *** programs are required for ChangeLog generation to work.'; \
+             $(TEST_DISTRIBUTION_OR_ERROR); } >&2
+       $(GENERIC_V) : 'CHECK   ' NEWS; \
+         $(AWK) 'NR == 1 && $$NF != "$(PACKAGE_VERSION):" \
+           { print FILENAME ":" NR ":", $$0; exit 1}' \
+           $(distdir)/NEWS || { \
+             echo 'ERROR: *** First line of NEWS should match the package version'; \
+             echo '       *** $(PACKAGE_VERSION), but that does not appear to be the case.'; \
+             echo '       *** Remember to update NEWS before preparing a release.'; \
+             $(TEST_DISTRIBUTION_OR_ERROR); } >&2