Add the flags to %install section too

In this package, build runs twice. Once in %build phase, once again
in the %install phase. Although in the %install phase, make should
be happy with the results obtained in the previous phase and don't
do anything, it obviously happens that the bits are rebuilt. Not
always, but often.

Since the env variables are reset in next phase, binaries built in
%install phase (without flags) might clobber the original ones and
cause an annocheck fail.

Let's make sure that the flags are always set.

Related: rhbz#2038853
Signed-off-by: Michael Petlan <mpetlan@redhat.com>
This commit is contained in:
Michael Petlan 2022-01-14 17:58:40 +01:00
parent 48095317fc
commit be331d6a56

View File

@ -11,7 +11,7 @@
Name: libtracefs
Version: 1.0.2
Release: 6%{?dist}
Release: 7%{?dist}
License: LGPLv2+ and GPLv2+
Summary: Library for access kernel tracefs
@ -50,6 +50,8 @@ export GCCLDFLAGS="-Wl,-z,now"
%make_build prefix=%{_prefix} libdir=%{_libdir} all
%install
%set_build_flags
export GCCLDFLAGS="-Wl,-z,now"
%make_install prefix=%{_prefix} libdir=%{_libdir}
rm -rf %{buildroot}/%{_libdir}/libtracefs.a
@ -65,6 +67,10 @@ rm -rf %{buildroot}/%{_libdir}/libtracefs.a
%{_libdir}/%{name}.so
%changelog
* Fri Jan 14 2022 Michael Petlan <mpetlan@redhat.com> - 1.0.2-7
- Harden library linking; add the flags to install section too
Related: rhbz#2038853
* Wed Jan 12 2022 Michael Petlan <mpetlan@redhat.com> - 1.0.2-6
- Harden library linking
Related: rhbz#2038853