8d21c7a
#! /bin/sh
8d21c7a
8d21c7a
# This script builds the PDF version of the PostgreSQL documentation.
8d21c7a
#
8d21c7a
# In principle we could do this as part of the RPM build, but there are
8d21c7a
# good reasons not to:
8d21c7a
# 1. The build would take longer and have a larger BuildRequires footprint.
8d21c7a
# 2. The generated PDF has timestamps in it, which would inevitably result
8d21c7a
#    in multilib conflicts due to slightly different timestamps.
8d21c7a
# So instead, we run this manually when rebasing to a new upstream release,
8d21c7a
# and treat the resulting PDF as a separate Source file.
8d21c7a
#
8d21c7a
# You will need to have the docbook packages installed to run this.
8d21c7a
# Expect it to take about 20 minutes and use about 160MB of disk.
8d21c7a
Tom Lane a60f809
set -e
8d21c7a
Tom Lane a60f809
# Pass package version (e.g., 9.1.2) as argument
Tom Lane a60f809
VERSION=$1
8d21c7a
8d21c7a
TARGETFILE=postgresql-$VERSION-US.pdf
8d21c7a
8d21c7a
echo Building $TARGETFILE ...
8d21c7a
Tom Lane 497da8c
# Unpack postgresql
8d21c7a
Tom Lane a60f809
rm -rf postgresql-$VERSION
Tom Lane a60f809
Tom Lane a60f809
tar xfj postgresql-$VERSION.tar.bz2
8d21c7a
Tom Lane a60f809
cd postgresql-$VERSION
8d21c7a
Tom Lane 497da8c
# Apply any patches that affect the PDF documentation
Tom Lane 497da8c
24c5bf3
# patch -p1 < ../xxx.patch
Tom Lane 497da8c
Tom Lane 497da8c
# Configure ...
Tom Lane 497da8c
Tom Lane a60f809
./configure >/dev/null
8d21c7a
8d21c7a
# Build the PDF docs
8d21c7a
8d21c7a
cd doc/src/sgml
8d21c7a
Tom Lane a60f809
make postgres-US.pdf >make.log
8d21c7a
8d21c7a
mv -f postgres-US.pdf ../../../../$TARGETFILE
8d21c7a
8d21c7a
# Clean up
8d21c7a
8d21c7a
cd ../../../..
8d21c7a
8d21c7a
rm -rf postgresql-$VERSION
8d21c7a
8d21c7a
exit 0