Blame SOURCES/generate-pdf.sh

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