Fix build with package notes

The issue that in %prep the flags are sligtly different than in %build
or %install (%buildsubdir is not set), and we end up with the wrong
path in the Makefile, see rhbz#2055863.

This moves the sed into %build, which is somewhat ugly, but solves the
issue. The sequence of commands that is executed is the same, except
that the sed is invoked as first thing in %build, not as the last in
%prep. I think that for such a simple package this is acceptable, and
it's not worth waiting for a "proper" solution (which will likely
require some new funtionality in rpm).
epel10
Zbigniew Jędrzejewski-Szmek 3 years ago
parent c5f0d0e8cf
commit 6680a34f8e

@ -18,7 +18,7 @@
Name: argon2
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
Release: 8%{?dist}
Release: 9%{?dist}
Summary: The password-hashing tools
License: Public Domain or ASL 2.0
@ -88,6 +88,7 @@ fi
# Fix pkgconfig file
sed -e 's:lib/@HOST_MULTIARCH@:%{_lib}:;s/@UPSTREAM_VER@/%{version}/' -i %{libname}.pc
%build
# Honours default RPM build options and library path, do not use -march=native
sed -e '/^CFLAGS/s:^CFLAGS:LDFLAGS=%{build_ldflags}\nCFLAGS:' \
-e 's:-O3 -Wall:%{optflags}:' \
@ -96,7 +97,6 @@ sed -e '/^CFLAGS/s:^CFLAGS:LDFLAGS=%{build_ldflags}\nCFLAGS:' \
-e 's:CFLAGS += -march=\$(OPTTARGET)::' \
-i Makefile
%build
# parallel build is not supported
make -j1
@ -135,6 +135,9 @@ make test
%changelog
* Mon Mar 28 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 20171227-9
- Fix build with package notes (rhbz#2066558)
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 20171227-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

Loading…
Cancel
Save