From 32a665951c0be8e277d06523c3ac4742595d20d7 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Mon, 18 Sep 2017 16:08:17 +0200 Subject: [PATCH] specfile: check if current gawk(abi) is correctly set --- gawk.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gawk.spec b/gawk.spec index efa5446..7524ee3 100644 --- a/gawk.spec +++ b/gawk.spec @@ -69,6 +69,7 @@ Requires(preun): info BuildRequires: ghostscript-core BuildRequires: git +BuildRequires: grep # Extending GAWK possibilities: BuildRequires: libsigsegv-devel @@ -189,6 +190,17 @@ makeinfo --html -I doc -o html/gawkinet doc/gawkinet.texi %check make check +# Check we have correctly specified the ABI version for the current sources: +api_major_vers=$(grep -e "gawk_api_major.*[[:digit:]]" gawkapi.h | grep -o -e "[[:digit:]]") +api_minor_vers=$(grep -e "gawk_api_minor.*[[:digit:]]" gawkapi.h | grep -o -e "[[:digit:]]") + +if [[ "$api_major_vers" != %{gawk_api_major} || "$api_minor_vers" != %{gawk_api_minor} ]]; then + echo "Build Error: specified gawk(abi) version [%{gawk_api_major}.%{gawk_api_minor}] is different than source code API version [$api_major_vers.$api_minor_vers]!" >&2 + exit 1 +else + unset api_major_vers api_minor_vers +fi + # --------------- %install