Fix tests on RHEL

Fedora uses -Wl,--enable-new-dtags by default, so the test programs do
not need RPATH to find the in-tree libwget2.  However, on RHEL that is
not the case, but logs show that -Wl,--rpath is only used in the test
programs which are not installed.  Also, lcov and lzip are not available
on RHEL.
This commit is contained in:
Yaakov Selkowitz 2023-12-21 15:13:31 -05:00
parent 28a85155a8
commit ee2f9d7832

View File

@ -56,9 +56,11 @@ BuildRequires: pkgconfig(libpsl)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(zlib)
%if ! 0%{?rhel}
# Test suite
BuildRequires: lcov
BuildRequires: lzip
%endif
# For gpg signature verification
BuildRequires: gnupg2
@ -119,9 +121,11 @@ the system provider of wget.
%build
%configure --disable-static
# Remove RPATH
%if ! 0%{?rhel}
# Remove RPATH, rely on default -Wl,--enable-new-dtags in Fedora.
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%endif
%make_build