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