From be90720d6cd7fbb1b170794445815f579b444a6f Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Fri, 19 Apr 2024 14:10:39 +0300 Subject: [PATCH] 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. (cherry picked from commit dc684bf76ea23574ee9d88382057381e04e6089a) --- Makefile.am | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index e32eb4c3..6e4738a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -71,7 +71,8 @@ EXTRA_DIST = \ 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 = \ src/xz/xz.1 \ src/xzdec/xzdec.1 \ @@ -82,24 +83,18 @@ manfiles = \ 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. +# Convert the man pages to plain text (ASCII only) format. dist-hook: if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ ( cd "$(srcdir)" && git log --date=iso --stat \ b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \ > "$(distdir)/ChangeLog"; \ 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" && \ - $(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \ + $(MKDIR_P) "$$dest/txt" && \ 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" && \ sh "$(srcdir)/build-aux/manconv.sh" ascii \ < "$(srcdir)/$$FILE" \ > "$$dest/txt/$$BASE.txt"; \ @@ -125,3 +120,17 @@ mydist: fi; \ TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \ $(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