From a6d80dec862712569bc67faf57753194a9c8964a Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 25 Jul 2018 11:38:03 +0200 Subject: [PATCH] don't generate PDF build time That only creates additional build requirements, wastes some time and the final PDF is not used anyways. Also note that the pdf was renamed to %name-%version.pdf to ensure that the PDF is always re-generated after version update. Version: 1.7.2-2 --- .gitignore | 2 +- generate-pdf.sh | 30 ++++++++++++++++++++++++++++++ libconfig.spec | 9 ++++----- sources | 2 +- 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100755 generate-pdf.sh diff --git a/.gitignore b/.gitignore index 8a7910a..f2eadcb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/libconfig.pdf +/libconfig-1.7.2.pdf /libconfig-1.7.2.tar.gz diff --git a/generate-pdf.sh b/generate-pdf.sh new file mode 100755 index 0000000..38df6b7 --- /dev/null +++ b/generate-pdf.sh @@ -0,0 +1,30 @@ +#! /bin/sh + +# This script builds the PDF version of the libconfig documentation. +# Inspired by the PostgreSQL package. + +set -e + +# Pass package version and name optionally as argument +VERSION=$1 +PKGNAME=${2-libconfig} + +test -z "$VERSION" && VERSION=`awk '/^Version:/ { print $2; }' "$PKGNAME".spec` + +TARGETFILE=`readlink -f "$PKGNAME-$VERSION.pdf"` +test -f "$TARGETFILE" && echo "$TARGETFILE exists" && exit 1 + +echo Building $TARGETFILE ... + +tar xf "$PKGNAME"-$VERSION.tar.* +cd "$PKGNAME"-$VERSION + +# Apply any patches that affect the PDF documentation +# patch -p1 < ../xxx.patch + +# Build the PDF docs +./configure >/dev/null +make pdf +mv -f doc/libconfig.pdf "$TARGETFILE" + +exit 0 diff --git a/libconfig.spec b/libconfig.spec index 986fd24..dccde68 100644 --- a/libconfig.spec +++ b/libconfig.spec @@ -8,10 +8,12 @@ License: LGPLv2+ URL: http://www.hyperrealm.com/libconfig/ Source0: https://hyperrealm.github.io/%name/dist/%name-%version.tar.gz # Generated from libconfig 1.7.2 on Fedora 28 x86_64 (2018-07-18) -Source1: libconfig.pdf +Source1: libconfig-%version.pdf +# Helper script to generate Source1 (locally) +Source2: generate-pdf.sh BuildRequires: gcc, gcc-c++ -BuildRequires: texinfo-tex, tex(ecbx1095.tfm), tex(ecrm1095.tfm), tex(cm-super-t1.enc) +BuildRequires: texinfo BuildRequires: bison, flex %description @@ -42,15 +44,12 @@ mv AUTHORS{.utf8,} --disable-static make %{?_smp_mflags} -make pdf %install %make_install rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la rm -rf $RPM_BUILD_ROOT%{_infodir}/dir -# Need to use a pre-built copy to support multilib -rm -rf doc/libconfig.pdf install -p %{SOURCE1} doc/ diff --git a/sources b/sources index 997f0ab..f334c6e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (libconfig-1.7.2.tar.gz) = b0fcc403325fde217bd6509f10e8458958c8a93ff0a400da2602d62b7873e87f43ee6f1763ba30b3316e35a282a766c781a94b4d021b8c7e6ae2cf2cf108dd84 -SHA512 (libconfig.pdf) = d956be4f0300a1a1343694f1d2ef0943318455940de44f77347619583f1d3077c7dd12609b95a5f4b9fc4068067b492a48e743bd706f17da7381f8122400e8b6 +SHA512 (libconfig-1.7.2.pdf) = d956be4f0300a1a1343694f1d2ef0943318455940de44f77347619583f1d3077c7dd12609b95a5f4b9fc4068067b492a48e743bd706f17da7381f8122400e8b6