From Fedora Project Wiki
(New page: These are the definitions for the macros for GHC. They are useful in debugging your spec files. <pre> %ghc_autotools(lf:p:) \ echo %{-p*} %{-f*} \ if [ -f configure.ac -a ! -f configure ...)
 
No edit summary
Line 1: Line 1:
These are the definitions for the macros for GHC.  They are useful in debugging your spec files.
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


<pre>
<pre>

Revision as of 14:44, 13 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

%ghc_autotools(lf:p:) \
echo %{-p*} %{-f*} \
if [ -f configure.ac -a ! -f configure ]; then autoreconf; fi \
runghc Setup configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{hsc_name}-%{pkg_name}-%{version} --libsubdir='$compiler/$pkgid' %{-f:--flags%{-f*}} --%{-p:%{-p*}}-library-profiling --ghc \
%{-l:if runghc Setup makefile -f cabal-rpm.mk \
then \
    make -f cabal-rpm.mk %{_smp_mflags} || : \
fi }\
%{nil}

%ghc_build \
runghc Setup build \
%{nil}

%ghc_haddock \
runghc Setup haddock || : \
%{nil}

%ghc_gen_scripts \
runghc Setup register --gen-script \
runghc Setup unregister --gen-script \
%{nil}

%ghc_install \
runghc Setup copy --destdir=${RPM_BUILD_ROOT} \
%{nil}

%ghc_install_scripts \
install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir} \
%{nil}

%ghc_tar_dir %{_builddir}/%{?buildsubdir}

%ghc_gen_filelists() \
pushd ${RPM_BUILD_ROOT} \
echo "%defattr(-,root,root,-)" > %{ghc_tar_dir}/%1-files.prof \
find .%{pkg_libdir} \\\( -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> %{ghc_tar_dir}/%1-files.prof \
echo "%defattr(-,root,root,-)" > %{ghc_tar_dir}/%1-files \
find .%{pkg_libdir} -type d | sed 's/^./%dir /' >> %{ghc_tar_dir}/%1-files \
find .%{pkg_libdir} ! \\\( -type d -o -name '*_p.a' -o -name '*.p_hi' \\\) | sed s/^.// >> %{ghc_tar_dir}/%1-files \
sed 's,^/,%exclude /,' %{ghc_tar_dir}/%1-files.prof >> %{ghc_tar_dir}/%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}