Commit 36916619f0b07b4412df5a96683579552dd96285

Authored by Jay Berkenbilt
1 parent e058247b

Stop adding pre-built documentation to the source distribution

.github/workflows/main.yml
@@ -21,14 +21,13 @@ on: @@ -21,14 +21,13 @@ on:
21 jobs: 21 jobs:
22 Prebuild: 22 Prebuild:
23 # Run steps that are needed by the Windows build but are easier to 23 # Run steps that are needed by the Windows build but are easier to
24 - # build on Linux. Although only the Windows builds need this,  
25 - # other jobs depend on it to force it to run early. 24 + # build on Linux. Also create the documentation distribution.
26 runs-on: ubuntu-latest 25 runs-on: ubuntu-latest
27 steps: 26 steps:
28 - uses: actions/checkout@v2 27 - uses: actions/checkout@v2
29 - name: 'Run pre-build steps' 28 - name: 'Run pre-build steps'
30 run: build-scripts/prebuild 29 run: build-scripts/prebuild
31 - - name: 'Upload extra distribution files' 30 + - name: 'Upload documentation for later build steps'
32 uses: actions/upload-artifact@v1 31 uses: actions/upload-artifact@v1
33 with: 32 with:
34 name: doc 33 name: doc
@@ -38,6 +37,11 @@ jobs: @@ -38,6 +37,11 @@ jobs:
38 with: 37 with:
39 name: external-libs 38 name: external-libs
40 path: external-libs-dist 39 path: external-libs-dist
  40 + - name: 'Upload doc distribution'
  41 + uses: actions/upload-artifact@v1
  42 + with:
  43 + name: distribution
  44 + path: distribution
41 Linux: 45 Linux:
42 runs-on: ubuntu-latest 46 runs-on: ubuntu-latest
43 steps: 47 steps:
.gitignore
@@ -5,8 +5,6 @@ autoconf.mk @@ -5,8 +5,6 @@ autoconf.mk
5 autom4te.cache/ 5 autom4te.cache/
6 config.log 6 config.log
7 config.status 7 config.status
8 -doc  
9 -doc.zip  
10 examples/build/ 8 examples/build/
11 external-libs 9 external-libs
12 fuzz/build/ 10 fuzz/build/
ChangeLog
  1 +2021-12-21 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * Discontinue inclusion of the pre-built documentation in the
  4 + source distribution. Consult the packaging documentation in the
  5 + manual for details. The file README-doc.txt is installed in the
  6 + doc directory by default and contains information that users will
  7 + need to know to find the documentation.
  8 +
1 2021-12-19 Jay Berkenbilt <ejb@ql.org> 9 2021-12-19 Jay Berkenbilt <ejb@ql.org>
2 10
3 * C API: clarify documentation around string lengths. Add two new 11 * C API: clarify documentation around string lengths. Add two new
Makefile
@@ -106,7 +106,6 @@ distclean: clean @@ -106,7 +106,6 @@ distclean: clean
106 106
107 maintainer-clean: distclean 107 maintainer-clean: distclean
108 $(RM) -r install-mingw* install-msvc* external-libs 108 $(RM) -r install-mingw* install-msvc* external-libs
109 - $(RM) -rf doc  
110 109
111 .PHONY: $(TEST_TARGETS) 110 .PHONY: $(TEST_TARGETS)
112 111
README-doc.txt 0 → 100644
  1 +WHERE TO FIND THE QPDF DOCUMENTATION
  2 +
  3 +Complete documentation for qpdf can be found online here:
  4 +https://qpdf.readthedocs.io
  5 +
  6 +Some distributions include offline documentation typically in a
  7 +location such as /usr/share/doc/qpdf. If it isn't there, you can find
  8 +a zip file containing the documentation in the qpdf release area:
  9 +https://github.com/qpdf/qpdf/releases
  10 +
  11 +Offline documentation contains the following:
  12 +
  13 +* PDF: qpdf-manual.pdf
  14 +* HTML: html/index.html
  15 +* SINGLE-PAGE HTML: singlehtml/index.html
  16 +
  17 +If you are reading this file from the source distribution, you can
  18 +find the documentation sources in the "manual" directory. There is
  19 +information in the manual about how to build and package the
  20 +documentation.
README-maintainer
@@ -4,10 +4,6 @@ ROUTINE DEVELOPMENT @@ -4,10 +4,6 @@ ROUTINE DEVELOPMENT
4 4
5 Default: 5 Default:
6 6
7 -./configure CXX="g++ --std=c++14" --enable-werror  
8 -  
9 -Doc:  
10 -  
11 ./configure CXX="g++ --std=c++14" --enable-werror --enable-doc-maintenance 7 ./configure CXX="g++ --std=c++14" --enable-werror --enable-doc-maintenance
12 8
13 Debugging: 9 Debugging:
@@ -363,13 +359,6 @@ rsync -vrlcO ./ jay_berkenbilt,qpdf@frs.sourceforge.net:/home/frs/project/q/qp/q @@ -363,13 +359,6 @@ rsync -vrlcO ./ jay_berkenbilt,qpdf@frs.sourceforge.net:/home/frs/project/q/qp/q
363 359
364 OTHER NOTES 360 OTHER NOTES
365 361
366 -To construct a source distribution from a pristine checkout,  
367 -`make_dist` does the following:  
368 -  
369 -./configure --enable-doc-maintenance --enable-werror  
370 -make build_manual  
371 -make distclean  
372 -  
373 For local iteration on the AppImage generation, it works to just 362 For local iteration on the AppImage generation, it works to just
374 ./build-scripts/build-appimage and get the resulting AppImage from 363 ./build-scripts/build-appimage and get the resulting AppImage from
375 the distribution directory. You can also pass -e SKIP_TESTS=1 364 the distribution directory. You can also pass -e SKIP_TESTS=1
README-windows-install.txt
@@ -6,6 +6,7 @@ have the bin directory in your path. To compile with qpdf, just add @@ -6,6 +6,7 @@ have the bin directory in your path. To compile with qpdf, just add
6 the lib directory to your library path and the include directory to 6 the lib directory to your library path and the include directory to
7 your include path. If you are going to use Pl_DCT in your code, you 7 your include path. If you are going to use Pl_DCT in your code, you
8 will also need to have jpeg library development files in your build 8 will also need to have jpeg library development files in your build
9 -environment. Detailed documentation may be found in the doc directory. 9 +environment. Detailed documentation may be found in the doc directory
  10 +and at https://qpdf.readthedocs.io.
10 11
11 Enjoy! 12 Enjoy!
README.md
@@ -67,10 +67,6 @@ Please see the section on crypto providers in the manual for more details. @@ -67,10 +67,6 @@ Please see the section on crypto providers in the manual for more details.
67 67
68 The PDF file format used to rely on RC4 for encryption. Using 256-bit keys always uses AES instead, and with 128-bit keys, you can elect to use AES. qpdf does its best to warn when someone is writing a file with weak cryptographic algorithms, but qpdf must always retain support for being able to read and even write files with weak encryption to be able to fully support older PDF files and older PDF readers. 68 The PDF file format used to rely on RC4 for encryption. Using 256-bit keys always uses AES instead, and with 128-bit keys, you can elect to use AES. qpdf does its best to warn when someone is writing a file with weak cryptographic algorithms, but qpdf must always retain support for being able to read and even write files with weak encryption to be able to fully support older PDF files and older PDF readers.
69 69
70 -# Building from a pristine checkout  
71 -  
72 -When building qpdf from a pristine checkout from version control, generated HTML and PDF documentation files are not present. You don't need them unless you are going to run `make install` and want the documentation to be installed. If you want them, you can either extract the `doc` directory from a source distribution, or you can satisfy the additional requirements for building documentation and pass `--enable-doc-maintenance` to `./configure`.  
73 -  
74 # Building from source distribution on UNIX/Linux 70 # Building from source distribution on UNIX/Linux
75 71
76 For UNIX and UNIX-like systems, you can usually get by with just 72 For UNIX and UNIX-like systems, you can usually get by with just
@@ -81,7 +77,9 @@ make @@ -81,7 +77,9 @@ make
81 make install 77 make install
82 ``` 78 ```
83 79
84 -Packagers may set DESTDIR, in which case make install will install inside of DESTDIR, as is customary with many packages. For more detailed general information, see the "INSTALL" file in this directory. If you are already accustomed to building and installing software that uses autoconf, there's nothing new for you in the INSTALL file. Note that qpdf uses `autoconf` but not `automake`. We have our own system of Makefiles that allows cross-directory dependencies, doesn't use recursive make, and works better on non-UNIX platforms. 80 +Packagers may set DESTDIR, in which case make install will install inside of DESTDIR, as is customary with many packages. Please also see the "Notes for Packagers" section of the manual.
  81 +
  82 +For more detailed general information, see the "INSTALL" file in this directory. If you are already accustomed to building and installing software that uses autoconf, there's nothing new for you in the INSTALL file. Note that qpdf uses `autoconf` but not `automake`. We have our own system of Makefiles that allows cross-directory dependencies, doesn't use recursive make, and works better on non-UNIX platforms.
85 83
86 # Building without wchar_t 84 # Building without wchar_t
87 85
@@ -101,12 +99,14 @@ Note qpdf will never define QPDF_NO_WCHAR_T using autoconf or any other automate @@ -101,12 +99,14 @@ Note qpdf will never define QPDF_NO_WCHAR_T using autoconf or any other automate
101 99
102 QPDF is known to build and pass its test suite with mingw (latest version tested: gcc 7.2.0), mingw64 (latest version tested: 7.2.0) and Microsoft Visual C++ 2015, both 32-bit and 64-bit versions. MSYS2 is required to build as well in order to get make and other related tools. See [README-windows.md](README-windows.md) for details on how to build under Windows. 100 QPDF is known to build and pass its test suite with mingw (latest version tested: gcc 7.2.0), mingw64 (latest version tested: 7.2.0) and Microsoft Visual C++ 2015, both 32-bit and 64-bit versions. MSYS2 is required to build as well in order to get make and other related tools. See [README-windows.md](README-windows.md) for details on how to build under Windows.
103 101
  102 +# Building Documentation
  103 +
  104 +The QPDF manual is written in reStructured Text format and is build with [sphinx](https://www.sphinx-doc.org). The sources to the user manual can be found in the `manual` directory. For more detailed information, consult the [Building and Installing QPDF section of the manual](manual/installation.rst) or consult the [build-doc script used in CI](build-scripts/build-doc).
  105 +
104 # Additional Notes on Build 106 # Additional Notes on Build
105 107
106 QPDF's build system can optionally use its own built-in rules rather than using libtool and obeying the compiler specified with configure. This can be enabled by passing `--with-buildrules=buildrules` where buildrules corresponds to one of the `.mk` files (other than `rules.mk`) in the make directory. This should never be necessary on a UNIX system, but may be necessary on a Windows system. See [README-windows.md](README-windows.md) for details. 108 QPDF's build system can optionally use its own built-in rules rather than using libtool and obeying the compiler specified with configure. This can be enabled by passing `--with-buildrules=buildrules` where buildrules corresponds to one of the `.mk` files (other than `rules.mk`) in the make directory. This should never be necessary on a UNIX system, but may be necessary on a Windows system. See [README-windows.md](README-windows.md) for details.
107 109
108 -The QPDF package provides some executables and a software library. A user manual can be found in the "doc" directory. The sources to the user manual can be found in the `manual` directory.  
109 -  
110 The software library is just `libqpdf`, and all the header files are in the `qpdf` subdirectories of `include` and `libqpdf`. If you link statically with `-lqpdf`, then you will also need to link with `-lz` and `-ljpeg`. The shared qpdf library is linked with `-lz` and `-ljpeg`, none of qpdf's public header files directly include files from `libz`, and only `Pl_DCT.hh` includes files from `libjpeg`, so for most cases, qpdf's development files are self contained. If you need to use `Pl_DCT` in your application code, you will need to have the header files for some libjpeg distribution in your include path. 110 The software library is just `libqpdf`, and all the header files are in the `qpdf` subdirectories of `include` and `libqpdf`. If you link statically with `-lqpdf`, then you will also need to link with `-lz` and `-ljpeg`. The shared qpdf library is linked with `-lz` and `-ljpeg`, none of qpdf's public header files directly include files from `libz`, and only `Pl_DCT.hh` includes files from `libjpeg`, so for most cases, qpdf's development files are self contained. If you need to use `Pl_DCT` in your application code, you will need to have the header files for some libjpeg distribution in your include path.
111 111
112 To learn about using the library, please read comments in the header files in `include/qpdf`, especially `QPDF.hh`, `QPDFObjectHandle.hh`, and 112 To learn about using the library, please read comments in the header files in `include/qpdf`, especially `QPDF.hh`, `QPDFObjectHandle.hh`, and
appimage/build-appimage
@@ -100,6 +100,7 @@ mkdir -p $appdir @@ -100,6 +100,7 @@ mkdir -p $appdir
100 100
101 # Install build result into AppDir: 101 # Install build result into AppDir:
102 make install DESTDIR=$appdir; find $appdir 102 make install DESTDIR=$appdir; find $appdir
  103 +make doc-dist DOC_DEST=appdir/usr/share/doc/qpdf
103 104
104 # Change into build directory: 105 # Change into build directory:
105 cd $here/build 106 cd $here/build
build-scripts/build-doc 0 → 100755
  1 +#!/bin/bash
  2 +# The manual references this file.
  3 +cd $(dirname $0)/..
  4 +set -ex
  5 +sudo apt-get update
  6 +sudo apt-get -y install \
  7 + autoconf build-essential zlib1g-dev libjpeg-dev \
  8 + python3-pip texlive-latex-extra latexmk
  9 +pip3 install sphinx sphinx_rtd_theme
  10 +./configure --enable-doc-maintenance
  11 +make -j$(nproc) doc-dist DOC_DEST=doc
  12 +zip -r doc.zip doc
  13 +version=$(egrep '^release' manual/conf.py | cut -d"'" -f 2)
  14 +mv doc qpdf-${version}-doc
  15 +mkdir distribution
  16 +zip -r distribution/qpdf-${version}-doc.zip qpdf-${version}-doc
  17 +sha256sum distribution/*
build-scripts/build-linux
@@ -3,10 +3,8 @@ set -ex @@ -3,10 +3,8 @@ set -ex
3 sudo apt-get update 3 sudo apt-get update
4 sudo apt-get -y install \ 4 sudo apt-get -y install \
5 autoconf build-essential zlib1g-dev libjpeg-dev libgnutls28-dev \ 5 autoconf build-essential zlib1g-dev libjpeg-dev libgnutls28-dev \
6 - libssl-dev python3-pip texlive-latex-extra latexmk \  
7 - inkscape imagemagick libtiff-tools ghostscript  
8 -pip3 install sphinx sphinx_rtd_theme  
9 -./configure --enable-werror --enable-doc-maintenance \ 6 + libssl-dev libtiff-tools ghostscript
  7 +./configure --enable-werror \
10 --enable-crypto-native --enable-crypto-openssl --enable-crypto-gnutls \ 8 --enable-crypto-native --enable-crypto-openssl --enable-crypto-gnutls \
11 --enable-show-failed-test-output --enable-test-compare-images 9 --enable-show-failed-test-output --enable-test-compare-images
12 make -j$(nproc) -k 10 make -j$(nproc) -k
@@ -16,7 +14,7 @@ for i in $(./qpdf/build/qpdf --show-crypto); do @@ -16,7 +14,7 @@ for i in $(./qpdf/build/qpdf --show-crypto); do
16 done 14 done
17 export TMPDIR=$PWD/dist-tmp 15 export TMPDIR=$PWD/dist-tmp
18 rm -rf $TMPDIR 16 rm -rf $TMPDIR
19 -./make_dist --ci --no-tests 17 +./make_dist --ci
20 mkdir distribution 18 mkdir distribution
21 cp $TMPDIR/qpdf*-ci.tar.gz distribution 19 cp $TMPDIR/qpdf*-ci.tar.gz distribution
22 sha256sum distribution/* 20 sha256sum distribution/*
build-scripts/prebuild
1 #!/bin/bash 1 #!/bin/bash
2 cd $(dirname $0)/.. 2 cd $(dirname $0)/..
3 -set -ex  
4 -sudo apt-get update  
5 -sudo apt-get -y install \  
6 - autoconf build-essential zlib1g-dev libjpeg-dev \  
7 - python3-pip texlive-latex-extra latexmk inkscape imagemagick  
8 -pip3 install sphinx sphinx_rtd_theme  
9 -./configure --enable-doc-maintenance  
10 -make -j$(nproc) build_manual  
11 -zip -r doc.zip doc/*html doc/*.pdf 3 +build-scripts/build-doc
12 build-scripts/download-external-libs 4 build-scripts/download-external-libs
make/installwin.mk
@@ -8,7 +8,6 @@ installwin: all @@ -8,7 +8,6 @@ installwin: all
8 mkdir $(DEST)/lib 8 mkdir $(DEST)/lib
9 mkdir $(DEST)/include 9 mkdir $(DEST)/include
10 mkdir $(DEST)/include/qpdf 10 mkdir $(DEST)/include/qpdf
11 - mkdir $(DEST)/doc  
12 cp libqpdf/$(OUTPUT_DIR)/$(IMPORT_LIB_NAME) $(DEST)/lib 11 cp libqpdf/$(OUTPUT_DIR)/$(IMPORT_LIB_NAME) $(DEST)/lib
13 cp libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin 12 cp libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin
14 perl copy_dlls libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin $(OBJDUMP) $(WINDOWS_WORDSIZE) 13 perl copy_dlls libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin $(OBJDUMP) $(WINDOWS_WORDSIZE)
@@ -17,12 +16,6 @@ installwin: all @@ -17,12 +16,6 @@ installwin: all
17 cp qpdf/$(OUTPUT_DIR)/fix-qdf.exe $(DEST)/bin 16 cp qpdf/$(OUTPUT_DIR)/fix-qdf.exe $(DEST)/bin
18 cp include/qpdf/*.h $(DEST)/include/qpdf 17 cp include/qpdf/*.h $(DEST)/include/qpdf
19 cp include/qpdf/*.hh $(DEST)/include/qpdf 18 cp include/qpdf/*.hh $(DEST)/include/qpdf
20 - if [ -f doc/qpdf-manual.pdf ]; then \  
21 - cp doc/qpdf-manual.pdf $(DEST)/doc; \  
22 - fi  
23 - if [ -d doc/html ]; then \  
24 - cp -r doc/html $(DEST)/doc; \  
25 - fi  
26 - if [ -d doc/singlehtml ]; then \  
27 - cp -r doc/singlehtml $(DEST)/doc; \ 19 + if [ -d doc ]; then \
  20 + cp -r doc $(DEST); \
28 fi 21 fi
make/libtool.mk
@@ -137,13 +137,5 @@ install: all install-libs @@ -137,13 +137,5 @@ install: all install-libs
137 $(LIBTOOL) --mode=install ./install-sh \ 137 $(LIBTOOL) --mode=install ./install-sh \
138 qpdf/$(OUTPUT_DIR)/fix-qdf \ 138 qpdf/$(OUTPUT_DIR)/fix-qdf \
139 $(DESTDIR)$(bindir)/fix-qdf 139 $(DESTDIR)$(bindir)/fix-qdf
140 - if [ -f doc/qpdf-manual.pdf ]; then \  
141 - ./install-sh -m 0644 doc/qpdf-manual.pdf $(DESTDIR)$(docdir); \  
142 - fi  
143 - if [ -d doc/html ]; then \  
144 - cp -r doc/html $(DESTDIR)/$(docdir); \  
145 - fi  
146 - if [ -d doc/singlehtml ]; then \  
147 - cp -r doc/singlehtml $(DESTDIR)/$(docdir); \  
148 - fi  
149 - ./install-sh -m 0644 doc/*.1 $(DESTDIR)$(mandir)/man1 140 + ./install-sh -m 0644 README-doc.txt $(DESTDIR)$(docdir); \
  141 + ./install-sh -m 0644 manual/$(OUTPUT_DIR)/*.1 $(DESTDIR)$(mandir)/man1
make_dist
1 #!/usr/bin/env perl 1 #!/usr/bin/env perl
2 # 2 #
3 # This program creates a source distribution of qpdf. For details, 3 # This program creates a source distribution of qpdf. For details,
4 -# see README-maintainer.md. 4 +# see README-maintainer.
5 # 5 #
6 6
7 require 5.008; 7 require 5.008;
@@ -16,7 +16,6 @@ use File::Path qw(rmtree make_path); @@ -16,7 +16,6 @@ use File::Path qw(rmtree make_path);
16 my $whoami = basename($0); 16 my $whoami = basename($0);
17 17
18 my $tmp = $ENV{'TMPDIR'} || '/tmp'; 18 my $tmp = $ENV{'TMPDIR'} || '/tmp';
19 -my $run_tests = 1;  
20 my $keep_tmp = 0; 19 my $keep_tmp = 0;
21 my $ci_mode = 0; 20 my $ci_mode = 0;
22 my $version = undef; 21 my $version = undef;
@@ -24,7 +23,7 @@ foreach my $arg (@ARGV) @@ -24,7 +23,7 @@ foreach my $arg (@ARGV)
24 { 23 {
25 if ($arg eq '--no-tests') 24 if ($arg eq '--no-tests')
26 { 25 {
27 - $run_tests = 0; 26 + # ignore for compatibility
28 } 27 }
29 elsif ($arg eq '--keep-tmp') 28 elsif ($arg eq '--keep-tmp')
30 { 29 {
@@ -93,19 +92,8 @@ if ($version_error) @@ -93,19 +92,8 @@ if ($version_error)
93 die "$whoami: version numbers are not consistent\n"; 92 die "$whoami: version numbers are not consistent\n";
94 } 93 }
95 94
96 -run("./configure --disable-shared --enable-doc-maintenance --enable-werror");  
97 -run("make -j8 build_manual");  
98 -run("make distclean");  
99 cd($tmp); 95 cd($tmp);
100 run("tar czvf $distname.tar.gz-candidate $distname"); 96 run("tar czvf $distname.tar.gz-candidate $distname");
101 -if ($run_tests)  
102 -{  
103 - cd($tmpdir);  
104 - run("./configure");  
105 - run("make -j8");  
106 - run("make check");  
107 - cd($tmp);  
108 -}  
109 my $distfile = ($ci_mode ? "$distname-ci.tar.gz" : "$distname.tar.gz"); 97 my $distfile = ($ci_mode ? "$distname-ci.tar.gz" : "$distname.tar.gz");
110 rename "$distname.tar.gz-candidate", $distfile or die; 98 rename "$distname.tar.gz-candidate", $distfile or die;
111 99
manual/README deleted
1 -This directory contains sources to the documentation. If you are  
2 -looking for pre-built documentation, please look in the "doc"  
3 -directory.  
manual/build.mk
@@ -6,7 +6,10 @@ HTML_TARGET := $(HTML_OUT)/index.html @@ -6,7 +6,10 @@ HTML_TARGET := $(HTML_OUT)/index.html
6 PDF_OUT := $(DOC_OUT)/latex 6 PDF_OUT := $(DOC_OUT)/latex
7 PDF_TARGET := $(PDF_OUT)/qpdf.pdf 7 PDF_TARGET := $(PDF_OUT)/qpdf.pdf
8 8
9 -TARGETS_manual := doc/qpdf.1 doc/fix-qdf.1 doc/zlib-flate.1 9 +TARGETS_manual := \
  10 + $(DOC_OUT)/qpdf.1 \
  11 + $(DOC_OUT)/fix-qdf.1 \
  12 + $(DOC_OUT)/zlib-flate.1
10 ifeq ($(BUILD_HTML),1) 13 ifeq ($(BUILD_HTML),1)
11 TARGETS_manual += $(HTML_TARGET) $(S_HTML_TARGET) 14 TARGETS_manual += $(HTML_TARGET) $(S_HTML_TARGET)
12 endif 15 endif
@@ -22,23 +25,31 @@ MANUAL_DEPS = $(wildcard manual/*.rst) manual/conf.py @@ -22,23 +25,31 @@ MANUAL_DEPS = $(wildcard manual/*.rst) manual/conf.py
22 # the error "_pickle.UnpicklingError: pickle data was truncated" 25 # the error "_pickle.UnpicklingError: pickle data was truncated"
23 $(HTML_TARGET): $(MANUAL_DEPS) 26 $(HTML_TARGET): $(MANUAL_DEPS)
24 $(SPHINX) -M html manual $(DOC_OUT) -W 27 $(SPHINX) -M html manual $(DOC_OUT) -W
25 - mkdir -p doc  
26 - rm -rf doc/html  
27 - cp -r $(DOC_OUT)/html doc  
28 28
29 $(S_HTML_TARGET): $(MANUAL_DEPS) | $(HTML_TARGET) 29 $(S_HTML_TARGET): $(MANUAL_DEPS) | $(HTML_TARGET)
30 $(SPHINX) -M singlehtml manual $(DOC_OUT) -W 30 $(SPHINX) -M singlehtml manual $(DOC_OUT) -W
31 - mkdir -p doc  
32 - rm -rf doc/singlehtml  
33 - cp -r $(DOC_OUT)/singlehtml doc  
34 31
35 $(PDF_TARGET): $(MANUAL_DEPS) | $(S_HTML_TARGET) $(HTML_TARGET) 32 $(PDF_TARGET): $(MANUAL_DEPS) | $(S_HTML_TARGET) $(HTML_TARGET)
36 $(SPHINX) -M latexpdf manual $(DOC_OUT) -W 33 $(SPHINX) -M latexpdf manual $(DOC_OUT) -W
37 - mkdir -p doc  
38 - cp $(PDF_TARGET) doc/qpdf-manual.pdf  
39 34
40 -doc/%.1: manual/%.1.in  
41 - mkdir -p doc  
42 - sed -e 's:@PACKAGE_VERSION@:$(PACKAGE_VERSION):g' \  
43 - -e 's:@docdir@:$(docdir):g' \  
44 - < $< > $@ 35 +$(DOC_OUT)/%.1: manual/%.1.in
  36 + sed -e 's:@PACKAGE_VERSION@:$(PACKAGE_VERSION):g' < $< > $@
  37 +
  38 +# The doc-dist target must not removed $(DOC_DEST) so that it works to
  39 +# do stuff like make doc-dist DOC_DEST=$(DESTDIR)/$(docdir). Make sure
  40 +# what this does is consistent with ../README-doc.txt and the
  41 +# information in the manual and ../README.md.
  42 +.PHONY: doc-dist
  43 +doc-dist: build_manual
  44 + @if test x"$(DOC_DEST)" = x; then \
  45 + echo DOC_DEST must be set 1>& 2; \
  46 + false; \
  47 + fi
  48 + if test -d $(DOC_DEST); then \
  49 + $(RM) -rf $(DOC_DEST)/*html $(DOC_DEST)/*.pdf; \
  50 + else \
  51 + mkdir -p $(DOC_DEST); \
  52 + fi
  53 + cp -r $(DOC_OUT)/html doc
  54 + cp -r $(DOC_OUT)/singlehtml doc
  55 + cp $(PDF_TARGET) $(DOC_DEST)/qpdf-manual.pdf
manual/conf.py
@@ -11,6 +11,7 @@ import sphinx_rtd_theme # noQA F401 @@ -11,6 +11,7 @@ import sphinx_rtd_theme # noQA F401
11 project = 'QPDF' 11 project = 'QPDF'
12 copyright = '2005-2021, Jay Berkenbilt' 12 copyright = '2005-2021, Jay Berkenbilt'
13 author = 'Jay Berkenbilt' 13 author = 'Jay Berkenbilt'
  14 +# make_dist and the CI build lexically find the release version from this file.
14 release = '10.5.0' 15 release = '10.5.0'
15 version = release 16 version = release
16 extensions = [ 17 extensions = [
manual/fix-qdf.1.in
@@ -14,8 +14,6 @@ the same file with stream lengths, cross-reference table entries, and @@ -14,8 +14,6 @@ the same file with stream lengths, cross-reference table entries, and
14 object stream offset tables regenerated. 14 object stream offset tables regenerated.
15 .PP 15 .PP
16 For details about fix-qdf and about PDF files in QDF mode, please see 16 For details about fix-qdf and about PDF files in QDF mode, please see
17 -the qpdf manual, which can be found in @docdir@/html/index.html or  
18 -@docdir@/qpdf-manual.pdf. The latest version of the documentation can  
19 -be found at https://qpdf.readthedocs.io. 17 +the qpdf manual, which can be found at https://qpdf.readthedocs.io.
20 .SH "SEE ALSO" 18 .SH "SEE ALSO"
21 qpdf(1) 19 qpdf(1)
manual/index.rst
@@ -21,6 +21,7 @@ documentation, please visit `https://qpdf.readthedocs.io @@ -21,6 +21,7 @@ documentation, please visit `https://qpdf.readthedocs.io
21 license 21 license
22 download 22 download
23 installation 23 installation
  24 + packaging
24 cli 25 cli
25 qdf 26 qdf
26 library 27 library
manual/installation.rst
@@ -60,14 +60,7 @@ suite. Note that in no case are these items required to use qpdf. @@ -60,14 +60,7 @@ suite. Note that in no case are these items required to use qpdf.
60 If you do not enable this, then you do not need to have tiff and 60 If you do not enable this, then you do not need to have tiff and
61 ghostscript. 61 ghostscript.
62 62
63 -Pre-built documentation is distributed with qpdf, so you should  
64 -generally not need to rebuild the documentation. In order to build the  
65 -documentation from source, you need to install `Sphinx  
66 -<https://sphinx-doc.org>`__ along with the ``sphinx_rtd_doc`` theme  
67 -(``pip install sphinx sphinx_rtd_theme``). To build the PDF version of  
68 -the documentation, you need ``pdflatex``, ``latexmk``, and a fairly  
69 -complete LaTeX installation. Detailed requirements can be found in the  
70 -Sphinx documentation. 63 +For information on building the documentation, see :ref:`build-doc`.
71 64
72 .. _building: 65 .. _building:
73 66
@@ -113,6 +106,23 @@ hand-crafted non-recursive Makefile that requires gnu make. If you&#39;re @@ -113,6 +106,23 @@ hand-crafted non-recursive Makefile that requires gnu make. If you&#39;re
113 really interested, please read the comments in the top-level 106 really interested, please read the comments in the top-level
114 :file:`Makefile`. 107 :file:`Makefile`.
115 108
  109 +.. _build-doc:
  110 +
  111 +Building Documentation
  112 +----------------------
  113 +
  114 +The qpdf manual is written in reStructured Text and built with `Sphinx
  115 +<https://www.sphinx-doc.org>`__ using the `Read the Docs Sphinx Theme
  116 +<https://sphinx-rtd-theme.readthedocs.io>`__. In order to build the
  117 +HTML documentation from source, you need to install sphinx and the
  118 +theme, which you can typically do with ``pip install sphinx
  119 +sphinx_rtd_theme``. To build the PDF version of the documentation, you
  120 +need ``pdflatex``, ``latexmk``, and a fairly complete LaTeX
  121 +installation. Detailed requirements can be found in the Sphinx
  122 +documentation. To see how the documentation is built for the qpdf
  123 +distribution, refer to the :file:`build-scripts/build-doc` file in the
  124 +qpdf source distribution.
  125 +
116 .. _crypto: 126 .. _crypto:
117 127
118 Crypto Providers 128 Crypto Providers
@@ -298,46 +308,3 @@ provide their own implementations for basic filters like @@ -298,46 +308,3 @@ provide their own implementations for basic filters like
298 Implementing the registration functions and internal storage of 308 Implementing the registration functions and internal storage of
299 registered providers was also easier using C++-11's functional 309 registered providers was also easier using C++-11's functional
300 interfaces, which was another reason to require C++-11 at this time. 310 interfaces, which was another reason to require C++-11 at this time.
301 -  
302 -.. _packaging:  
303 -  
304 -Notes for Packagers  
305 --------------------  
306 -  
307 -If you are packaging qpdf for an operating system distribution, here are  
308 -some things you may want to keep in mind:  
309 -  
310 -- Starting in qpdf version 9.1.1, qpdf no longer has a runtime  
311 - dependency on perl. This is because fix-qdf was rewritten in C++.  
312 - However, qpdf still has a build-time dependency on perl.  
313 -  
314 -- Make sure you are getting the intended behavior with regard to crypto  
315 - providers. Read :ref:`crypto.build` for details.  
316 -  
317 -- Passing :samp:`--enable-show-failed-test-output` to  
318 - :command:`./configure` will cause any failed test  
319 - output to be written to the console. This can be very useful for  
320 - seeing test failures generated by autobuilders where you can't access  
321 - qtest.log after the fact.  
322 -  
323 -- If qpdf's build environment detects the presence of autoconf and  
324 - related tools, it will check to ensure that automatically generated  
325 - files are up-to-date with recorded checksums and fail if it detects a  
326 - discrepancy. This feature is intended to prevent you from  
327 - accidentally forgetting to regenerate automatic files after modifying  
328 - their sources. If your packaging environment automatically refreshes  
329 - automatic files, it can cause this check to fail. Suppress qpdf's  
330 - checks by passing :samp:`--disable-check-autofiles`  
331 - to :command:`/.configure`. This is safe since qpdf's  
332 - :command:`autogen.sh` just runs autotools in the  
333 - normal way.  
334 -  
335 -- QPDF's :command:`make install` does not install  
336 - completion files by default, but as a packager, it's good if you  
337 - install them wherever your distribution expects such files to go. You  
338 - can find completion files to install in the  
339 - :file:`completions` directory.  
340 -  
341 -- Packagers are encouraged to install the source files from the  
342 - :file:`examples` directory along with qpdf  
343 - development packages.  
manual/packaging.rst 0 → 100644
  1 +.. _packaging:
  2 +
  3 +Notes for Packagers
  4 +===================
  5 +
  6 +If you are packaging qpdf for an operating system distribution, this
  7 +chapter is for you. Otherwise, feel free to skip.
  8 +
  9 +Build Options
  10 +-------------
  11 +
  12 +- Perl must be present at build time. Prior to qpdf version 9.1.1,
  13 + there was a runtime dependency on perl, but this is no longer the
  14 + case.
  15 +
  16 +- Make sure you are getting the intended behavior with regard to crypto
  17 + providers. Read :ref:`crypto.build` for details.
  18 +
  19 +- Passing :samp:`--enable-show-failed-test-output` to
  20 + :command:`./configure` will cause any failed test
  21 + output to be written to the console. This can be very useful for
  22 + seeing test failures generated by autobuilders where you can't access
  23 + qtest.log after the fact.
  24 +
  25 +- If qpdf's build environment detects the presence of autoconf and
  26 + related tools, it will check to ensure that automatically generated
  27 + files are up-to-date with recorded checksums and fail if it detects a
  28 + discrepancy. This feature is intended to prevent you from
  29 + accidentally forgetting to regenerate automatic files after modifying
  30 + their sources. If your packaging environment automatically refreshes
  31 + automatic files, it can cause this check to fail. Suppress qpdf's
  32 + checks by passing :samp:`--disable-check-autofiles`
  33 + to :command:`/.configure`. This is safe since qpdf's
  34 + :command:`autogen.sh` just runs autotools in the
  35 + normal way.
  36 +
  37 +- QPDF's :command:`make install` does not install completion files by
  38 + default, but as a packager, it's good if you install them wherever
  39 + your distribution expects such files to go. You can find completion
  40 + files to install in the :file:`completions` directory.
  41 +
  42 +- Packagers are encouraged to install the source files from the
  43 + :file:`examples` directory along with qpdf development packages.
  44 +
  45 +.. _packaging-doc:
  46 +
  47 +Packaging Documentation
  48 +-----------------------
  49 +
  50 +Starting in qpdf version 10.5, pre-built documentation is no longer
  51 +distributed with the qpdf source distribution. Here are a few options
  52 +you may want to consider for your packages:
  53 +
  54 +- **Do nothing**
  55 +
  56 + When you run ``make install``, the file :file:`README-doc.txt` is
  57 + installed in ``$(docdir)``. That file tells the reader where to find
  58 + the documentation online and where to go to download offline copies
  59 + of the documentation. This is the option selected by the debian
  60 + packages.
  61 +
  62 +- **Embed pre-built documentation**
  63 +
  64 + You can obtain pre-built documentation and extract its contents into
  65 + your distribution. This is what the Windows binary distributions
  66 + available from the qpdf release site do. You can find the pre-build
  67 + documentation in the release area in the file
  68 + :file:`qpdf-{version}-doc.zip`.
  69 +
  70 +- **Build the documentation yourself**
  71 +
  72 + You can build the documentation as part of your build process. Be
  73 + sure to pass ``--enable-doc-maintenance`` to ``./configure``, and
  74 + install it with ``make doc-dist DOC_DEST=...``. This is what the
  75 + AppImage build does. The latest version of Sphinx at the time of the
  76 + initial conversion a sphinx-based documentation was 4.3.2. Older
  77 + versions are not guaranteed to work.
  78 +
  79 +Documentation Packaging Rationale
  80 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81 +
  82 +This section describes the reason for things being the way they are.
  83 +It's for information only; you don't have to know any of this to
  84 +package qpdf.
  85 +
  86 +What is the reason for this change? Prior to qpdf 10.5, the qpdf
  87 +manual was a docbook XML file. The generated documents were the
  88 +product of running the file through build-time style sheets and
  89 +contained no copyrighted material of their own. Starting with version
  90 +10.5, the manual is written produced with `Sphinx
  91 +<https://www.sphinx-doc.org>`__. This change was made to make it much
  92 +easier to automatically generate portions of the documentation and to
  93 +make the documentation easier to work with. The HTML output of Sphinx
  94 +is also much more readable, usable, and suitable for online
  95 +consumption than the output of the docbook style sheets. The downsides
  96 +are that the generated HTML documentation now contains Javascript code
  97 +and embedded fonts, and the PDF version of the documentation is no
  98 +longer as suitable for printing (at least as of the 10.5 distribution)
  99 +since external link targets are no longer shown and cross references
  100 +no longer contain page number information. The presence of copyrighted
  101 +material in the generated documentation, even though things are
  102 +licensed with MIT and BSD licenses, complicates the job of the
  103 +packager in various ways. For one thing, it means the
  104 +:file:`NOTICE.md` file in the source repository would have to keep up
  105 +with the copyright information for files that are not controlled in
  106 +the repository. Additionally, some distributions (notably
  107 +Debian/Ubuntu) discourage inclusion of sphinx-generated documentation
  108 +in packages, preferring you instead to build the documentation as part
  109 +of the package build process and to depend at runtime on a shared
  110 +package that contains the code. At the time of the conversion of the
  111 +qpdf manual from docbook to sphinx, newer versions of both sphinx and
  112 +the html theme were required than were available in some of most of
  113 +the Debian/Ubuntu versions for which qpdf was packaged.
  114 +
  115 +Since always-on Internet connectivity is much more common than it used
  116 +to be, many users of qpdf would prefer to consume the documentation
  117 +online anyway, and the lack of pre-built documentation in the
  118 +distribution won't be as big of a deal. However there are still some
  119 +people who can't or choose not to view documentation online. For them,
  120 +pre-built documentation is still available.
manual/qpdf.1.in
@@ -15,6 +15,4 @@ options for inspecting or checking PDF files, some of which are @@ -15,6 +15,4 @@ options for inspecting or checking PDF files, some of which are
15 useful primarily to PDF developers. 15 useful primarily to PDF developers.
16 .PP 16 .PP
17 For a summary of qpdf's options, please run \fBqpdf \-\-help\fR. A 17 For a summary of qpdf's options, please run \fBqpdf \-\-help\fR. A
18 -complete manual can be found in @docdir@/html/index.html or  
19 -@docdir@/qpdf-manual.pdf. The latest version of the documentation can  
20 -be found at https://qpdf.readthedocs.io. 18 +complete manual can be found at https://qpdf.readthedocs.io.
manual/release-notes.rst
@@ -6,29 +6,25 @@ Release Notes @@ -6,29 +6,25 @@ Release Notes
6 For a detailed list of changes, please see the file 6 For a detailed list of changes, please see the file
7 :file:`ChangeLog` in the source distribution. 7 :file:`ChangeLog` in the source distribution.
8 8
9 -10.5.0: December 20, 2021 9 +10.5.0: December 21, 2021
10 - Packaging changes 10 - Packaging changes
11 11
12 - - The structure of the ``doc`` directory is different. The PDF  
13 - documentation is in the same place, but the files for the  
14 - previous HTML documentation are no longer there. Instead, there  
15 - are ``html`` and ``singlehtml`` directories, each of which  
16 - contain ``index.html`` and other files and directories. The  
17 - distribution files and ``make install`` target handle this, but  
18 - if you are building your own packages and including  
19 - documentation, please double check to make sure that you are  
20 - including the right documentation files. 12 + - Pre-built documentation is no longer distributed with the source
  13 + distribution. The AppImage and Windows binary distributions
  14 + still contain embedded documentation, and a separate ``doc``
  15 + distribution file is available from the qpdf release site.
  16 + Documentation is now available at `https://qpdf.readthedocs.io
  17 + <https://qpdf.readthedocs.io>`__ for every major/minor version
  18 + starting with version 10.5. Please see :ref:`packaging-doc` for
  19 + details on how packagers should handle documentation.
21 20
22 - The documentation sources have been switched from docbook to 21 - The documentation sources have been switched from docbook to
23 reStructuredText processed with `Sphinx 22 reStructuredText processed with `Sphinx
24 - <https://sphinx-doc.org>`__. This will break previous 23 + <https://www.sphinx-doc.org>`__. This will break previous
25 documentation links. A redirect is in place on the main website. 24 documentation links. A redirect is in place on the main website.
26 A top-to-bottom review of the documentation is planned for an 25 A top-to-bottom review of the documentation is planned for an
27 upcoming release. 26 upcoming release.
28 27
29 - - Documentation is now available at `https://qpdf.readthedocs.io  
30 - <https://qpdf.readthedocs.io>`__.  
31 -  
32 - Library Enhancements 28 - Library Enhancements
33 29
34 - Since qpdf version 8, using object accessor methods on an 30 - Since qpdf version 8, using object accessor methods on an
manual/zlib-flate.1.in
@@ -21,8 +21,6 @@ This program should not be used as a general purpose compression @@ -21,8 +21,6 @@ This program should not be used as a general purpose compression
21 tool. Use something like gzip(1) instead. 21 tool. Use something like gzip(1) instead.
22 .PP 22 .PP
23 For details about qpdf, please see the qpdf manual, which can be found 23 For details about qpdf, please see the qpdf manual, which can be found
24 -in @docdir@/html/index.html or @docdir@/qpdf-manual.pdf. The latest  
25 -version of the documentation can be found at  
26 -https://qpdf.readthedocs.io. 24 +at https://qpdf.readthedocs.io.
27 .SH "SEE ALSO" 25 .SH "SEE ALSO"
28 qpdf(1), gzip(1) 26 qpdf(1), gzip(1)