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