2009-05-13 07:37:39 +00:00
|
|
|
%cabal %{_bindir}/runghc Setup
|
|
|
|
|
|
|
|
%cabal_configure \
|
|
|
|
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid'
|
|
|
|
|
|
|
|
%cabal_makefile \
|
|
|
|
%cabal makefile -f cabal-rpm.mk \
|
|
|
|
make -f cabal-rpm.mk %{_smp_mflags} \
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
%cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
|
|
|
|
|
2009-09-22 10:08:17 +00:00
|
|
|
%ghcdocdir %{_docdir}/ghc/libraries/%{?pkg_name}%{!?pkg_name:%{name}}
|
2009-05-13 07:37:39 +00:00
|
|
|
%ghcpkgdir %{_libdir}/ghc-%(ghc --numeric-version)/%{?pkg_name}%{!?pkg_name:%name}-%{version}
|
|
|
|
|
|
|
|
%ghc_gen_filelists() \
|
|
|
|
rm -f %1-devel.files %1-prof.files %1-doc.files \
|
|
|
|
echo '%defattr(-,root,root,-)' > %1-devel.files \
|
|
|
|
find ${RPM_BUILD_ROOT}%{ghcpkgdir} -type d | sed 's/^/%dir /' >> %1-devel.files \
|
|
|
|
find ${RPM_BUILD_ROOT}%{ghcpkgdir} ! \\( -type d -o -name '*_p.a' -o -name '*.p_hi' \\) >> %1-devel.files \
|
|
|
|
echo '%defattr(-,root,root,-)' > %1-prof.files \
|
|
|
|
find ${RPM_BUILD_ROOT}%{ghcpkgdir} \\( -name '*_p.a' -o -name '*.p_hi' \\) >> %1-prof.files \
|
|
|
|
sed -i -e "s!${RPM_BUILD_ROOT}!!g" %1-devel.files %1-prof.files \
|
|
|
|
echo '%defattr(-,root,root,-)' > %1-doc.files \
|
|
|
|
echo '%{ghcdocdir}' >> %1-doc.files \
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
%ghc_gen_scripts %cabal register --gen-script ; %cabal unregister --gen-script
|
|
|
|
|
|
|
|
%ghc_install_scripts install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{ghcpkgdir}
|
|
|
|
|
|
|
|
%ghc_register_pkg %{ghcpkgdir}/register.sh >/dev/null || :
|
|
|
|
|
|
|
|
%ghc_unregister_pkg %{ghcpkgdir}/unregister.sh >/dev/null || :
|
|
|
|
|
|
|
|
%ghc_reindex_haddock ( cd %{_docdir}/ghc/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
|
|
|
|
|
|
|
|
%ghc_version %(ghc --numeric-version)
|
2009-11-16 07:45:33 +00:00
|
|
|
|
|
|
|
%GHCRequires() \
|
2009-11-16 09:14:11 +00:00
|
|
|
Requires: ghc-%1-%2 = %(ghc-pkg list --global --simple-output %1|sed -e "s/.*%1-//")
|