bootstrapping: drop grep/gawk build-requirement

Per pull-request #2 discussion.
This commit is contained in:
Pavel Raiskup 2017-11-02 11:53:09 +01:00
parent 82798a77c1
commit d135a6574a
2 changed files with 13 additions and 5 deletions

View File

@ -45,16 +45,14 @@ Source0: https://ftp.gnu.org/gnu/gawk/gawk-%{version}.tar.xz
Source1: LICENSE.GPLv2
Source2: LICENSE.LGPLv2
Source3: LICENSE.BSD
Source4: get_api_version.sh
Provides: /bin/awk
Provides: /bin/gawk
# Extraction of API major & minor versions, so we can export them below. Put
# this below Source0 definition to have %%SOURCE0 defined.
%{expand:%(
tar xf %{SOURCE0} '*/gawkapi.h' --to-stdout 2>/dev/null | \
awk '/define\ gawk_api_/ {print "%%global " $2 " " $3 }'
)}
%{expand:%(%{SOURCE4} %{SOURCE0})}
Provides: gawk(abi) = %{gawk_api_major_version}.%{gawk_api_minor_version}
@ -66,7 +64,6 @@ Requires(preun): info
BuildRequires: ghostscript-core
BuildRequires: git
BuildRequires: grep
# Extending GAWK possibilities:
BuildRequires: libsigsegv-devel

11
get_api_version.sh Executable file
View File

@ -0,0 +1,11 @@
#! /bin/sh
tar xf "$1" '*/gawkapi.h' --to-stdout | \
while read line; do
set -- $line
case $2 in
gawk_api_*_version)
echo "%global $2 $3"
;;
esac
done