From Fedora Project Wiki
< PackagingDrafts | Haskell
No edit summary |
(add _cabal) |
||
Line 4: | Line 4: | ||
<pre> | <pre> | ||
%_cabal %{_bindir}/runghc Setup | |||
%ghc_autotools(lf:p:) \ | %ghc_autotools(lf:p:) \ | ||
echo %{-p*} %{-f*} \ | echo %{-p*} %{-f*} \ | ||
if [ -f configure.ac -a ! -f configure ]; then autoreconf; fi \ | if [ -f configure.ac -a ! -f configure ]; then autoreconf; fi \ | ||
%{_cabal} configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --libsubdir='$compiler/$pkgid' %{-f:--flags%{-f*}} --%{-p:%{-p*}}-library-profiling --ghc \ | |||
%{-l:if | %{-l:if %{_cabal} makefile -f cabal-rpm.mk \ | ||
then \ | then \ | ||
make -f cabal-rpm.mk %{_smp_mflags} || : \ | make -f cabal-rpm.mk %{_smp_mflags} || : \ | ||
Line 15: | Line 17: | ||
%ghc_build \ | %ghc_build \ | ||
%{_cabal} build \ | |||
%{nil} | %{nil} | ||
%ghc_haddock \ | %ghc_haddock \ | ||
%{_cabal} haddock || : \ | |||
%{nil} | %{nil} | ||
%ghc_gen_scripts \ | %ghc_gen_scripts \ | ||
%{_cabal} register --gen-script \ | |||
%{_cabal} unregister --gen-script \ | |||
%{nil} | %{nil} | ||
%ghc_install \ | %ghc_install \ | ||
%{_cabal} copy --destdir=${RPM_BUILD_ROOT} \ | |||
%{nil} | %{nil} | ||
Line 34: | Line 36: | ||
install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir} \ | install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir} \ | ||
%{nil} | %{nil} | ||
%ghc_gen_filelists() \ | %ghc_gen_filelists() \ | ||
pushd ${RPM_BUILD_ROOT} \ | pushd ${RPM_BUILD_ROOT} \ | ||
echo "%defattr(-,root,root,-)" > | echo "%defattr(-,root,root,-)" > %1-files.prof \ | ||
find .%{pkg_libdir} \\\( -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> | find .%{pkg_libdir} \\\( -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> %1-files.prof \ | ||
echo "%defattr(-,root,root,-)" > | echo "%defattr(-,root,root,-)" > %1-files \ | ||
find .%{pkg_libdir} -type d | sed 's/^./%dir /' >> | find .%{pkg_libdir} -type d | sed 's/^./%dir /' >> %1-files \ | ||
find .%{pkg_libdir} ! \\\( -type d -o -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> | find .%{pkg_libdir} ! \\\( -type d -o -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> %1-files \ | ||
sed 's,^/,%exclude /,' %{ghc_tar_dir}/%1-files.prof >> | sed 's,^/,%exclude /,' %{ghc_tar_dir}/%1-files.prof >> %1-files \ | ||
pushd \ | pushd \ | ||
%{nil} | %{nil} |
Revision as of 08:00, 22 August 2008
These are the definitions for the macros for GHC. They are useful in debugging your spec files.
If your GHC does not ship with them, but you would like to use them anyways, they belong either in /etc/rpm/macros.ghc or in ~/.rpmmacros
%_cabal %{_bindir}/runghc Setup %ghc_autotools(lf:p:) \ echo %{-p*} %{-f*} \ if [ -f configure.ac -a ! -f configure ]; then autoreconf; fi \ %{_cabal} configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --libsubdir='$compiler/$pkgid' %{-f:--flags%{-f*}} --%{-p:%{-p*}}-library-profiling --ghc \ %{-l:if %{_cabal} makefile -f cabal-rpm.mk \ then \ make -f cabal-rpm.mk %{_smp_mflags} || : \ fi }\ %{nil} %ghc_build \ %{_cabal} build \ %{nil} %ghc_haddock \ %{_cabal} haddock || : \ %{nil} %ghc_gen_scripts \ %{_cabal} register --gen-script \ %{_cabal} unregister --gen-script \ %{nil} %ghc_install \ %{_cabal} copy --destdir=${RPM_BUILD_ROOT} \ %{nil} %ghc_install_scripts \ install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir} \ %{nil} %ghc_gen_filelists() \ pushd ${RPM_BUILD_ROOT} \ echo "%defattr(-,root,root,-)" > %1-files.prof \ find .%{pkg_libdir} \\\( -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> %1-files.prof \ echo "%defattr(-,root,root,-)" > %1-files \ find .%{pkg_libdir} -type d | sed 's/^./%dir /' >> %1-files \ find .%{pkg_libdir} ! \\\( -type d -o -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> %1-files \ sed 's,^/,%exclude /,' %{ghc_tar_dir}/%1-files.prof >> %1-files \ pushd \ %{nil} %ghc_preinst_script \ [ "$1" = 2 ] && %{pkg_libdir}/unregister.sh >&/dev/null || : \ %{nil} %ghc_postinst_script \ %{pkg_libdir}/register.sh >&/dev/null \ %{nil} %ghc_preun_script \ %{pkg_libdir}/unregister.sh >&/dev/null \ %{nil} %ghc_postun_script \ [ "$1" = 1 ] && %{pkg_libdir}/register.sh >& /dev/null || : \ %{nil}