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