|
|
|
@ -39,7 +39,7 @@ export CFLAGS\
|
|
|
|
|
%global _hardened_ldflags %{nil}\
|
|
|
|
|
LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\
|
|
|
|
|
%cabal --version\
|
|
|
|
|
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" %{?cabal_configure_options} $cabal_configure_extra_options
|
|
|
|
|
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc --dynlibdir=%{_ghcdynlibdir} %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" %{?cabal_configure_options} $cabal_configure_extra_options
|
|
|
|
|
|
|
|
|
|
# install
|
|
|
|
|
%cabal_install %cabal copy --destdir=%{buildroot} %{?cabal_install_options}
|
|
|
|
@ -91,12 +91,15 @@ rm -f %{basepkg}.files %{basepkg}-devel.files\
|
|
|
|
|
touch %{basepkg}.files %{basepkg}-devel.files\
|
|
|
|
|
echo ${pkgconf} >> %{basepkg}-devel.files\
|
|
|
|
|
if [ -d "%{buildroot}${pkgdir}" ]; then\
|
|
|
|
|
%if %{defined ghc_version_override}\
|
|
|
|
|
echo "%%dir ${pkgdir}" >> %{basepkg}.files\
|
|
|
|
|
%if %{undefined ghc_without_shared}\
|
|
|
|
|
echo "%%attr(755,root,root) ${pkgdir}/libHS*-ghc%{ghc_version}.so" >> %{basepkg}.files\
|
|
|
|
|
%endif\
|
|
|
|
|
find %{buildroot}${pkgdir} -mindepth 1 -type d | sed "s/^/%dir /" >> %{basepkg}-devel.files\
|
|
|
|
|
find %{buildroot}${pkgdir} ! \\( -type d -o -name "libHS*.so" \\) >> %{basepkg}-devel.files\
|
|
|
|
|
%else\
|
|
|
|
|
echo "%%attr(755,root,root) %{_ghcdynlibdir}/libHS%{pkgnamever}-*ghc%{ghc_version}.so" >> %{basepkg}.files\
|
|
|
|
|
echo "${pkgdir}" >> %{basepkg}-devel.files\
|
|
|
|
|
%endif\
|
|
|
|
|
fi\
|
|
|
|
|
if [ -d "%{buildroot}%{docdir}" ]; then\
|
|
|
|
|
echo "%{docdir}" >> %{basepkg}-devel.files\
|
|
|
|
@ -135,7 +138,7 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
|
|
|
|
|
%if 0%{?rhel} && 0%{?rhel} < 8\
|
|
|
|
|
licensedirversion=%{?2:-%2}\
|
|
|
|
|
%endif\
|
|
|
|
|
%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
|
|
|
|
|
%cabal_configure %{!?without_prof:-p} --enable-shared %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_ghclicensedir}/ghc-%1${licensedirversion} --htmldir=%{ghclibdocdir}/%1-%2} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
|
|
|
|
|
%cabal build %{?ghc_smp_mflags} %{?cabal_build_options}\
|
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
@ -192,11 +195,13 @@ for lib in %*; do\
|
|
|
|
|
7.10.*)\
|
|
|
|
|
pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\
|
|
|
|
|
syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --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} --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")\
|
|
|
|
|
newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/")\
|
|
|
|
|
chrpath -r $newrpath $i\
|
|
|
|
|
;;\
|
|
|
|
|
esac\
|
|
|
|
|