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