specfile: extraction of API version is now automated
This commit is contained in:
parent
f318f0d9b8
commit
7fc194cb68
28
gawk.spec
28
gawk.spec
@ -30,15 +30,14 @@
|
|||||||
# For more info: https://fedoraproject.org/wiki/Packaging:Guidelines#PIE
|
# For more info: https://fedoraproject.org/wiki/Packaging:Guidelines#PIE
|
||||||
%global _hardened_build 1
|
%global _hardened_build 1
|
||||||
|
|
||||||
# We are defining the gawk(abi) version value based on these values, because
|
# Extraction of API major & minor versions, so we can export them below:
|
||||||
# upstream updates the API from time to time, which breaks the ABI for packages
|
%global gawk_api_major %%(tar -xf %{SOURCE0} gawk-%{version}/gawkapi.h --to-stdout | \
|
||||||
# depending on gawk's shared objects. The gawk(abi) version value is exported
|
grep -i -e "gawk_api_major.*[[:digit:]]" | \
|
||||||
# below via the Provides: field.
|
grep -o -e "[[:digit:]]")
|
||||||
#
|
|
||||||
# These values are defined in the gawkapi.h header file. To see them, run:
|
%global gawk_api_minor %%(tar -xf %{SOURCE0} gawk-%{version}/gawkapi.h --to-stdout | \
|
||||||
# grep -E "gawk_api_(major|minor).*[[:digit:]]" gawkapi.h
|
grep -i -e "gawk_api_minor.*[[:digit:]]" | \
|
||||||
%global gawk_api_major 1
|
grep -o -e "[[:digit:]]")
|
||||||
%global gawk_api_minor 1
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
@ -190,17 +189,6 @@ makeinfo --html -I doc -o html/gawkinet doc/gawkinet.texi
|
|||||||
%check
|
%check
|
||||||
make check
|
make check
|
||||||
|
|
||||||
# Check we have correctly specified the ABI version for the current sources:
|
|
||||||
api_major_vers=$(grep -i -e "gawk_api_major.*[[:digit:]]" gawkapi.h | grep -o -e "[[:digit:]]")
|
|
||||||
api_minor_vers=$(grep -i -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
|
%install
|
||||||
|
Loading…
Reference in New Issue
Block a user