-# Copyright © 2018 Nick Bowler
+# Copyright © 2018, 2021 Nick Bowler
#
# License WTFPL2: Do What The Fuck You Want To Public License, version 2.
# This is free software: you are free to do what the fuck you want to.
dist_man_MANS = doc/slotifier.1
+# 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
+# manually 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) \
+ >'$(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
+
# Supporting rules for gettext.
include $(top_srcdir)/common/snippet/gettext.mk
noinst_DATA = $(MOFILES)
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this file. If not, see <http://www.gnu.org/licenses/>.
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk.in --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files getopt-gnu gettext hypot localcharset striconv
+# gnulib-tool --import \
+# --lib=libgnu \
+# --source-base=lib \
+# --m4-base=m4 \
+# --doc-base=doc \
+# --tests-base=tests \
+# --aux-dir=. \
+# --makefile-name=gnulib.mk.in \
+# --conditional-dependencies \
+# --libtool \
+# --macro-prefix=gl \
+# --no-vc-files \
+# getopt-gnu \
+# gettext \
+# gitlog-to-changelog \
+# hypot \
+# localcharset \
+# striconv
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
gl_MODULES([
getopt-gnu
gettext
+ gitlog-to-changelog
hypot
localcharset
striconv