summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-07-12 19:08:30 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-07-12 19:08:30 +0300
commitd873a09e956363e54bf58c577c8f7e487b6fb464 (patch)
tree25be1c6acc18be81939d7b72a187f0214f5c2a06 /Makefile.am
parentcd69a5a6c16c289f6f8e2823b03c72289472270f (diff)
downloadxz-d873a09e956363e54bf58c577c8f7e487b6fb464.tar.gz
Add dist-hook to create ChangeLog from the commit log,
and to conver the man pages to PDF and plain text, which may be convenient to those who cannot render man pages.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 58971db..1ddbdd8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,6 +27,37 @@ EXTRA_DIST = \
ACLOCAL_AMFLAGS = -I m4
+# List of man pages to conver to PDF and plain text in the dist-hook target.
+manfiles = \
+ src/xzdec/xzdec.1 \
+ src/scripts/xzdiff.1 \
+ src/scripts/xzgrep.1 \
+ src/scripts/xzless.1 \
+ src/scripts/xzmore.1
+
+# Create ChangeLog from output of "git log --date=iso --stat".
+# Convert the man pages to PDF and plain text (ASCII only) formats.
+dist-hook:
+ test -d "$(srcdir)/.git" && type git > /dev/null 2>&1 \
+ && ( cd "$(srcdir)" && git log --date=iso --stat ) \
+ > "$(distdir)/ChangeLog"
+ if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
+ dest="$(distdir)/doc/man" && \
+ mkdir "$$dest" && \
+ mkdir "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
+ for FILE in $(manfiles); do \
+ BASE=`basename $$FILE .1` && \
+ groff -man -t -Tps -P-pa4 < "$(srcdir)/$$FILE" \
+ | ps2pdf - - \
+ > "$$dest/pdf-a4/$$BASE-a4.pdf" && \
+ groff -man -t -Tps -P-pletter < "$(srcdir)/$$FILE" \
+ | ps2pdf - - \
+ > "$$dest/pdf-letter/$$BASE-letter.pdf" && \
+ groff -man -t -Tascii < "$(srcdir)/$$FILE" \
+ | col -bx > "$$dest/txt/$$BASE.txt"; \
+ done; \
+ fi
+
# This works with GNU tar and gives cleaner package than normal 'make dist'.
mydist:
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \