From d21c2b8eb39dd386552c8e8bef76984046fc9643 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Thu, 2 Nov 2017 17:01:00 +0100 Subject: [PATCH] specfile: cleanup in %gawk_api_* macros * Comments added/updated. * %gawk_api_version renamed to %gawk_api_major_next --- gawk.spec | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gawk.spec b/gawk.spec index bf9c958..f67cc52 100644 --- a/gawk.spec +++ b/gawk.spec @@ -30,7 +30,7 @@ # For more info: https://fedoraproject.org/wiki/Packaging:Guidelines#PIE %global _hardened_build 1 -# Extraction of API major & minor versions, so we can export them below: +# Extract the API major & minor versions, so we can export them below: %global gawk_api_major %%(tar -xf %{SOURCE0} gawk-%{version}/gawkapi.h --to-stdout | \ grep -i -e "gawk_api_major.*[[:digit:]]" | \ grep -o -e "[[:digit:]]") @@ -220,23 +220,26 @@ install -m 0644 -p html/gawkinet/* %{buildroot}%{_docdir}/%{name}/html/gaw install -m 0644 -p doc/gawk.{pdf,ps} %{buildroot}%{_docdir}/%{name} install -m 0644 -p doc/gawkinet.{pdf,ps} %{buildroot}%{_docdir}/%{name} +# NOTE: Upstream is referencing this specfile in README file, so we want +# to keep as much content as possible in this file... + # Generate latest version of 'macros.gawk' file used by gawk extensions: install -m 0755 -d %{buildroot}%{_rpmconfigdir}/macros.d cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.gawk << _EOF # Current API version: +%%gawk_api_version %{gawk_api_major}.%{gawk_api_minor} %%gawk_api_major %{gawk_api_major} %%gawk_api_minor %{gawk_api_minor} -%%gawk_api_version %{gawk_api_major}.%{gawk_api_minor} -# Next API version which will be incopatible with current API: -%%gawk_api_version_next $((%{gawk_api_major} + 1)).0 +# Next major API version which will be incopatible with current API: +%%gawk_api_major_next $((%{gawk_api_major} + 1)).0 # This macro will make sure that your current gawk extension -# is build against latest gawk API available in buildroot: +# is build against latest gawk API available in the buildroot: %%gawk_abi_requires \\ Requires: gawk(abi) >= %%{gawk_api_version} \\ -Requires: gawk(abi) < %%{gawk_api_version_next} \\ +Requires: gawk(abi) < %%{gawk_api_major_next} \\ %%{nil} _EOF