spec: silence krb5 pkgconf errors in %krb5_base_version

Send stderr of pkgconf to /dev/null rather than printing the following
error text while parsing the spec file:

    Package krb5 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `krb5.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'krb5', required by 'virtual:world', not found

`BuildRequires: pkgconfig(krb5)` ensures this won't happen when running
a real build.  It simply avoids 4 lines of needless error output when
running something like `fedpkg prep`.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Todd Zullinger 2023-04-09 11:45:03 -04:00 committed by Florence Blanc-Renaud
parent 0d72a6cf5c
commit 4f9e6b1bed

View File

@ -178,7 +178,7 @@
# RHEL 8.2+, F32+ has 3.58
%global nss_version 3.44.0-4
%define krb5_base_version %(LC_ALL=C /usr/bin/pkgconf --modversion krb5 | grep -Eo '^[^.]+\.[^.]+' || echo %krb5_version)
%define krb5_base_version %(LC_ALL=C /usr/bin/pkgconf --modversion krb5 2>/dev/null | grep -Eo '^[^.]+\.[^.]+' || echo %krb5_version)
%global kdcproxy_version 0.4-3
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9