Blame SOURCES/generate-pdf.sh

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