change %ghc_fix_rpath %{subpkgs} to %ghc_fix_rpaths for all executables

needed for
https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
and rpminspect runpath DT_RUNPATH errors
epel9
Jens Petersen 4 years ago
parent d2347fa858
commit 9e31d7dd7d

@ -10,7 +10,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 2.1.0
Version: 2.2.0
Release: 1%{?dist}
Summary: RPM macros for building Haskell packages for GHC
@ -190,6 +190,10 @@ EOF
%changelog
* Mon Jun 7 2021 Jens Petersen <petersen@redhat.com> - 2.2.0-1
- ghc_fix_rpaths macro deletes all RPATHs, replacing ghc_fix_rpath(), for
https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
* Wed Mar 24 2021 Jens Petersen <petersen@redhat.com> - 2.1.0-1
- add ghc-filesystem subpackage to own /usr/share/doc/ghc/{,html/{,libraries/}}
(#1926757)

@ -167,7 +167,7 @@ fi\
%{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\
%{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\
%cabal_install\
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
%ghc_fix_rpaths\
%{nil}
# ghc_lib_install [name] [version]
@ -178,47 +178,22 @@ fi\
%cabal_install\
%cabal_pkg_conf %{?1} %{?2}\
%ghc_gen_filelists %{?1} %{?2}\
%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\
%ghc_fix_rpaths\
%{nil}
# ghc_fix_rpath lib-ver ...
%ghc_fix_rpath()\
%if %{undefined disable_ghc_fix_rpath}\
# ghc_fix_rpaths
%ghc_fix_rpaths\
%if %{undefined disable_ghc_fix_rpaths}\
echo "running ghc_fix_rpaths:"\
if ! type chrpath > /dev/null; then exit 1; fi\
echo "ghc_fix_rpath %*"\
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\
for lib in %*; do\
if [ -x "$i" ]; then\
rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\
case $rpath in\
*$PWD/$lib/dist/build*)\
case %{ghc_version} in\
7.10.*)\
pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\
8.0)\
pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\
*)\
syspath="" ;;\
esac\
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\
if [ "$newrpath" = "%{_libdir}" ]; then\
chrpath -d $i\
else\
chrpath -r $newrpath $i\
fi\
;;\
%{_libdir})\
chrpath -d $i\
;;\
esac\
else\
echo "%%ghc_fix_rpath: no $i executable"\
exit 1\
fi\
done\
done\
%endif
# deprecated for f31

Loading…
Cancel
Save