summaryrefslogtreecommitdiffstats
path: root/generate-pdf.sh
diff options
context:
space:
mode:
authorPavel Kajaba <pkajaba@redhat.com>2015-11-18 10:02:17 +0100
committerPavel Kajaba <pkajaba@redhat.com>2015-11-18 10:02:17 +0100
commitf51c859081bdb81b89293fa7a4d52782ce8429cb (patch)
treee0941f50fe65bcbe241150915e584e868e9a8ae0 /generate-pdf.sh
downloadpostgresql-f51c859081bdb81b89293fa7a4d52782ce8429cb.tar.gz
postgresql-f51c859081bdb81b89293fa7a4d52782ce8429cb.tar.xz
postgresql-f51c859081bdb81b89293fa7a4d52782ce8429cb.zip
Added initial files from branch rhscl-2.1-rh-postgresql94-rhel-7
Diffstat (limited to 'generate-pdf.sh')
-rwxr-xr-xgenerate-pdf.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/generate-pdf.sh b/generate-pdf.sh
new file mode 100755
index 0000000..1365bb4
--- /dev/null
+++ b/generate-pdf.sh
@@ -0,0 +1,55 @@
+#! /bin/sh
+
+# This script builds the PDF version of the PostgreSQL documentation.
+#
+# In principle we could do this as part of the RPM build, but there are
+# good reasons not to:
+# 1. The build would take longer and have a larger BuildRequires footprint.
+# 2. The generated PDF has timestamps in it, which would inevitably result
+# in multilib conflicts due to slightly different timestamps.
+# So instead, we run this manually when rebasing to a new upstream release,
+# and treat the resulting PDF as a separate Source file.
+#
+# You will need to have the docbook packages installed to run this.
+# Expect it to take about 20 minutes and use about 160MB of disk.
+
+set -e
+
+# Pass package version (e.g., 9.1.2) as argument
+VERSION=$1
+
+TARGETFILE=postgresql-$VERSION-US.pdf
+
+echo Building $TARGETFILE ...
+
+# Unpack postgresql
+
+rm -rf postgresql-$VERSION
+
+tar xfj postgresql-$VERSION.tar.bz2
+
+cd postgresql-$VERSION
+
+# Apply any patches that affect the PDF documentation
+
+patch -p1 < ../postgresql-multi-sockets.patch
+
+# Configure ...
+
+./configure >/dev/null
+
+# Build the PDF docs
+
+cd doc/src/sgml
+
+make postgres-US.pdf >make.log
+
+mv -f postgres-US.pdf ../../../../$TARGETFILE
+
+# Clean up
+
+cd ../../../..
+
+rm -rf postgresql-$VERSION
+
+exit 0