If gawkapi.h is not present, set %{gawk_api_version} to "." instead of "" to avoid a syntax error.

This commit is contained in:
Andrew J. Schorr 2017-10-07 22:17:32 -04:00
parent 75636413bc
commit 3360964761

View File

@ -15,7 +15,7 @@ BuildRequires: gawk(abi) >= 1.1
BuildRequires: gawk(abi) < 3.0
# At runtime, the ABI must be compatible with the compile-time version
%global gawk_api_version %(gawk 'match($0, /#define gawk_api_(major|minor)_version[[:space:]]+([[:digit:]]+)/, f) {v[f[1]] = f[2]} END {print (v["major"] "." v["minor"])}' /usr/include/gawkapi.h)
%global gawk_api_version %(gawk 'BEGINFILE {if (ERRNO) nextfile} match($0, /#define gawk_api_(major|minor)_version[[:space:]]+([[:digit:]]+)/, f) {v[f[1]] = f[2]} END {print (v["major"] "." v["minor"])}' /usr/include/gawkapi.h)
Requires: gawk(abi) >= %{gawk_api_version}
Requires: gawk(abi) < %(echo %{gawk_api_version} | gawk -F. '{printf "%d.0\n", $1+1}')