Blame SOURCES/generate-pdf.sh

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