Build: Omit PDF man pages from the package

pdf-local rule was added to create the PDFs still with "make pdf".
The install rules are missing but that likely doesn't matter at all.
This commit is contained in:
Lasse Collin 2024-04-19 14:10:39 +03:00
parent e3531ab412
commit dc684bf76e
1 changed files with 19 additions and 10 deletions

View File

@ -71,7 +71,8 @@ EXTRA_DIST = \
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
# List of man pages to convert to PDF and plain text in the dist-hook target. # List of man pages to convert to plain text in the dist-hook target
# or to PDF in the pdf-local target.
manfiles = \ manfiles = \
src/xz/xz.1 \ src/xz/xz.1 \
src/xzdec/xzdec.1 \ src/xzdec/xzdec.1 \
@ -82,24 +83,18 @@ manfiles = \
src/scripts/xzmore.1 src/scripts/xzmore.1
# Create ChangeLog from output of "git log --date=iso --stat". # Create ChangeLog from output of "git log --date=iso --stat".
# Convert the man pages to PDF and plain text (ASCII only) formats. # Convert the man pages to plain text (ASCII only) format.
dist-hook: dist-hook:
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
( cd "$(srcdir)" && git log --date=iso --stat \ ( cd "$(srcdir)" && git log --date=iso --stat \
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \ b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
> "$(distdir)/ChangeLog"; \ > "$(distdir)/ChangeLog"; \
fi fi
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \ if type groff > /dev/null 2>&1; then \
dest="$(distdir)/doc/man" && \ dest="$(distdir)/doc/man" && \
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \ $(MKDIR_P) "$$dest/txt" && \
for FILE in $(manfiles); do \ for FILE in $(manfiles); do \
BASE=`basename $$FILE .1` && \ BASE=`basename $$FILE .1` && \
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-letter/$$BASE-letter.pdf" && \
sh "$(srcdir)/build-aux/manconv.sh" ascii \ sh "$(srcdir)/build-aux/manconv.sh" ascii \
< "$(srcdir)/$$FILE" \ < "$(srcdir)/$$FILE" \
> "$$dest/txt/$$BASE.txt"; \ > "$$dest/txt/$$BASE.txt"; \
@ -125,3 +120,17 @@ mydist:
fi; \ fi; \
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \ TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
$(MAKE) VERSION="$$VERSION" dist-gzip $(MAKE) VERSION="$$VERSION" dist-gzip
# NOTE: This only creates the PDFs. The install rules are missing.
pdf-local:
dest="doc/man" && \
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" && \
for FILE in $(manfiles); do \
BASE=`basename $$FILE .1` && \
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
< "$(srcdir)/$$FILE" \
> "$$dest/pdf-letter/$$BASE-letter.pdf"; \
done