Blame SOURCES/generate-pdf.sh

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