specfile: check if current gawk(abi) is correctly set

This commit is contained in:
David Kaspar [Dee'Kej] 2017-09-18 16:08:17 +02:00
parent d3418d05ed
commit 0fec7009b3
1 changed files with 12 additions and 0 deletions

View File

@ -69,6 +69,7 @@ Requires(preun): info
BuildRequires: ghostscript-core
BuildRequires: git
BuildRequires: grep
BuildRequires: libsigsegv-devel
BuildRequires: mpfr-devel
@ -185,6 +186,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