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