]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Build: Omit PDF man pages from the package
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 19 Apr 2024 11:10:39 +0000 (14:10 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 28 Apr 2024 15:34:45 +0000 (18:34 +0300)
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.

Makefile.am

index e32eb4c308dc7a3e545432e2aefd2d6d26091c2e..6e4738a0fa7be39dc4776cfab13001d3ac827346 100644 (file)
@@ -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