Fix building nispor in Konflux

In newer rust-toolset build flags are now only applied when the
%cargo_build macro is used, via the RUSTFLAGS environment variable
it sets. nispor uses make rather than %cargo_build, so need to export
RUSTFLAGS in %build explicitly.

Resolves: RHEL-159656
This commit is contained in:
Jan Vaclav 2026-08-18 10:11:38 +02:00
parent 429439dc21
commit fd39fd82d5
No known key found for this signature in database
GPG Key ID: 157D02EF4DD5D752

View File

@ -1,6 +1,6 @@
Name: nispor
Version: 1.2.14
Release: 1%{?dist}
Release: 2%{?dist}
Summary: API for network status querying
License: ASL 2.0
URL: https://github.com/nispor/nispor
@ -108,15 +108,12 @@ This package contains C binding of %{name}.
# Source1 is vendored dependencies
%cargo_prep -V 1
# The cargo_prep will create `.cargo/config` which take precedence over
# `.cargo/config.toml` shipped by upstream which fix the SONAME of cdylib.
# To workaround that, merge upstream rustflags into cargo_prep created one.
_FLAGS=`sed -ne 's/rustflags = "\(.\+\)"/\1/p' .cargo/config.toml`
sed -i -e "s/rustflags = \[\(.\+\), \]$/rustflags = [\1, \"$_FLAGS\"]/" \
.cargo/config
rm .cargo/config.toml
%build
# Export RUSTFLAGS so that make's internal cargo invocation picks up the RPM
# build flags (debuginfo, hardening) and the cdylib SONAME flag. The new
# %%cargo_prep no longer embeds these in .cargo/config.toml, and %%cargo_build
# is not used here because the Makefile drives the full build.
export RUSTFLAGS="%{build_rustflags} -Clink-arg=-Wl,-soname=libnispor.so.1"
make
pushd src/python
%py3_build
@ -152,6 +149,9 @@ popd
%{_libdir}/pkgconfig/nispor.pc
%changelog
* Tue Aug 18 2026 Jan Vaclav <jvaclav@redhat.com> - 1.2.14-2
- Fix building nispor with Konflux (RHEL-159656)
* Wed Sep 20 2023 Matej Focko <mfocko@redhat.com> - 1.2.14-1
- New release 1.2.14 (Gris Ge)
- bond: support changing bond mode (Gris Ge)