From 8d21c7a1707625d5536a440b2febfd7d48080b6d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 16 Jan 2010 05:40:31 +0000 Subject: [PATCH] Document how to generate PDF doc file. --- generate-pdf.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ postgresql.spec | 5 +++-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100755 generate-pdf.sh diff --git a/generate-pdf.sh b/generate-pdf.sh new file mode 100755 index 0000000..9158a45 --- /dev/null +++ b/generate-pdf.sh @@ -0,0 +1,46 @@ +#! /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. + +# Extract version from specfile + +VERSION=`sed -n 's/^Version: //p' postgresql.spec` + +TARGETFILE=postgresql-$VERSION-US.pdf + +echo Building $TARGETFILE ... + +# Unpack and configure postgresql + +tar xfj postgresql-$VERSION.tar.bz2 || exit 1 + +cd postgresql-$VERSION || exit 1 + +./configure >/dev/null || exit 1 + +# Build the PDF docs + +cd doc/src/sgml + +make postgres-US.pdf >make.log || exit 1 + +mv -f postgres-US.pdf ../../../../$TARGETFILE + +# Clean up + +cd ../../../.. + +rm -rf postgresql-$VERSION + +exit 0 diff --git a/postgresql.spec b/postgresql.spec index 058a6ac..933a858 100755 --- a/postgresql.spec +++ b/postgresql.spec @@ -61,6 +61,8 @@ Group: Applications/Databases Url: http://www.postgresql.org/ Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 +# The PDF file is generated by generate-pdf.sh, which see for comments +Source1: postgresql-%{version}-US.pdf Source3: postgresql.init Source4: Makefile.regress Source5: pg_config.h @@ -69,7 +71,6 @@ Source7: ecpg_config.h Source14: postgresql.pam Source15: postgresql-bashprofile Source16: filter-requires-perl-Pg.sh -Source17: http://www.postgresql.org/docs/manuals/postgresql-8.4.2-US.pdf Patch1: rpm-pgsql.patch Patch2: postgresql-ac-version.patch @@ -278,7 +279,7 @@ system, including regression tests and benchmarks. autoconf -cp -p %{SOURCE17} . +cp -p %{SOURCE1} . %build