summaryrefslogtreecommitdiff
path: root/generate-pdf.sh
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-06-24 10:01:23 +0000
committerCoprDistGit <infra@openeuler.org>2024-06-24 10:01:23 +0000
commit2bf73940674385629e4eaed7d9df573671a12256 (patch)
tree1dd3991fe20aedb65e94fd2b680507f5e23da852 /generate-pdf.sh
parentce92b1d6b55661459c9ba8d7f30c3d63cf0fe81a (diff)
Diffstat (limited to 'generate-pdf.sh')
-rw-r--r--generate-pdf.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/generate-pdf.sh b/generate-pdf.sh
new file mode 100644
index 0000000..e0ed008
--- /dev/null
+++ b/generate-pdf.sh
@@ -0,0 +1,58 @@
+#! /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
+
+test -z "$VERSION" && VERSION=`awk '/^Version:/ { print $2; }' postgresql.spec`
+
+TARGETFILE=postgresql-$VERSION-US.pdf
+test -f "$TARGETFILE" && echo "$TARGETFILE exists" && exit 1
+
+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 < ../xxx.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