Blame SOURCES/generate-pdf.sh

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