Blame SOURCES/generate-pdf.sh

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