|
|
@ -3,61 +3,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
# configure
|
|
|
|
# configure
|
|
|
|
%cabal_configure \
|
|
|
|
%cabal_configure \
|
|
|
|
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' %{!?without_shared:--enable-shared} %{?with_dynamic:--ghc-option=-dynamic}
|
|
|
|
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' --ghc %{!?without_shared:--enable-shared} %{?with_dynamic:--ghc-option=-dynamic}
|
|
|
|
|
|
|
|
|
|
|
|
# install
|
|
|
|
# install
|
|
|
|
%cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
|
|
|
|
%cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
|
|
|
|
|
|
|
|
|
|
|
|
# root dir for ghc docs
|
|
|
|
# root dir for ghc docs
|
|
|
|
%ghcdocbasedir %{_docdir}/ghc/html
|
|
|
|
%ghcdocbasedir %{_docdir}/ghc/html
|
|
|
|
# ghcdocdir [pkgname]
|
|
|
|
# (deprecated) pkg doc dir
|
|
|
|
%ghcdocdir() %{ghcdocbasedir}/libraries/%{?1}%{!?1:%{pkg_name}}-%{version}
|
|
|
|
%ghcdocdir %{ghcdocbasedir}/libraries/%{pkg_name}-%{version}
|
|
|
|
# top library dir
|
|
|
|
# top library dir
|
|
|
|
%ghcpkgbasedir %{_libdir}/ghc-%{ghc_version}
|
|
|
|
%ghcpkgbasedir %{_libdir}/ghc-%{ghc_version}
|
|
|
|
# ghcpkgdir [pkgname]
|
|
|
|
# (deprecated) package dir
|
|
|
|
%ghcpkgdir() %{ghcpkgbasedir}/%{?1}%{!?1:%{pkg_name}}-%{version}
|
|
|
|
%ghcpkgdir %{ghcpkgbasedir}/%{pkg_name}-%{version}
|
|
|
|
|
|
|
|
|
|
|
|
# ghc_gen_filelists [pkgname]
|
|
|
|
# ghc_gen_filelists [name-version]
|
|
|
|
%ghc_gen_filelists() \
|
|
|
|
%ghc_gen_filelists()\
|
|
|
|
pkgname=%{?1}%{!?1:%{pkg_name}} \
|
|
|
|
pkgnamever=%{?1}%{!?1:%{pkg_name}-%{version}} \
|
|
|
|
basefile=ghc-${pkgname} \
|
|
|
|
pkgname=%{?pkg_name}%{!?pkg_name:$(echo ${pkgnamever} | sed -e "s/\\(.*\\)-.*/\\1/")} \
|
|
|
|
pkgnamever=${pkgname}-%{version} \
|
|
|
|
basepkg=ghc-${pkgname} \
|
|
|
|
rm -f ${basefile}.files ${basefile}-devel.files ${basefile}-prof.files \
|
|
|
|
pkgdir=%{ghcpkgbasedir}/${pkgnamever} \
|
|
|
|
|
|
|
|
docdir=%{ghcdocbasedir}/libraries/${pkgnamever} \
|
|
|
|
|
|
|
|
rm -f ${basepkg}.files ${basepkg}-devel.files ${basepkg}-prof.files \
|
|
|
|
%if 0%{!?without_shared:1} \
|
|
|
|
%if 0%{!?without_shared:1} \
|
|
|
|
echo "%defattr(-,root,root,-)" > ${basefile}.files \
|
|
|
|
echo "%defattr(-,root,root,-)" > ${basepkg}.files \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}${pkgdir}" ]; then \
|
|
|
|
echo "%dir %{ghcpkgdir}" >> ${basefile}.files \
|
|
|
|
echo "%dir ${pkgdir}" >> ${basepkg}.files \
|
|
|
|
echo "%attr(755,root,root) %{ghcpkgdir}/libHS${pkgnamever}-ghc%{ghc_version}.so" >> ${basefile}.files \
|
|
|
|
echo "%attr(755,root,root) ${pkgdir}/libHS${pkgnamever}-ghc%{ghc_version}.so" >> ${basepkg}.files \
|
|
|
|
fi \
|
|
|
|
fi \
|
|
|
|
%endif \
|
|
|
|
%endif \
|
|
|
|
echo "%defattr(-,root,root,-)" > ${basefile}-devel.files \
|
|
|
|
echo "%defattr(-,root,root,-)" > ${basepkg}-devel.files \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}" ]; then \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}%{_docdir}/ghc-${pkgnamever}" ]; then \
|
|
|
|
%{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}%{?without_shared:-devel}.files} %{?1::} \
|
|
|
|
echo "%{_docdir}/ghc-${pkgnamever}" >> ${basepkg}%{?without_shared:-devel}.files \
|
|
|
|
fi \
|
|
|
|
fi \
|
|
|
|
echo "%{ghcpkgbasedir}/package.conf.d/${pkgnamever}*.conf" >> ${basefile}-devel.files \
|
|
|
|
echo "%{ghcpkgbasedir}/package.conf.d/${pkgnamever}*.conf" >> ${basepkg}-devel.files \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}${pkgdir}" ]; then \
|
|
|
|
find ${RPM_BUILD_ROOT}%{ghcpkgdir} -type d | sed "s/^/%dir /" >> ${basefile}-devel.files \
|
|
|
|
find ${RPM_BUILD_ROOT}${pkgdir} -type d | sed "s/^/%dir /" >> ${basepkg}-devel.files \
|
|
|
|
find ${RPM_BUILD_ROOT}%{ghcpkgdir} ! \\( -type d -o -name "*_p.a" -o -name "*.p_hi" -o -name "libHS*.so" \\) >> ${basefile}-devel.files \
|
|
|
|
find ${RPM_BUILD_ROOT}${pkgdir} ! \\( -type d -o -name "*_p.a" -o -name "*.p_hi" -o -name "libHS*.so" \\) >> ${basepkg}-devel.files \
|
|
|
|
fi \
|
|
|
|
fi \
|
|
|
|
echo "%defattr(-,root,root,-)" > ${basefile}-prof.files \
|
|
|
|
echo "%defattr(-,root,root,-)" > ${basepkg}-prof.files \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}${pkgdir}" ]; then \
|
|
|
|
find ${RPM_BUILD_ROOT}%{ghcpkgdir} \\( -name "*_p.a" -o -name "*.p_hi" \\) >> ${basefile}-prof.files \
|
|
|
|
find ${RPM_BUILD_ROOT}${pkgdir} \\( -name "*_p.a" -o -name "*.p_hi" \\) >> ${basepkg}-prof.files \
|
|
|
|
fi \
|
|
|
|
fi \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}%{ghcdocdir}" ]; then \
|
|
|
|
if [ -d "${RPM_BUILD_ROOT}${docdir}" ]; then \
|
|
|
|
echo "%{ghcdocdir}" >> ${basefile}-devel.files \
|
|
|
|
echo "${docdir}" >> ${basepkg}-devel.files \
|
|
|
|
fi \
|
|
|
|
fi \
|
|
|
|
sed -i -e "s!${RPM_BUILD_ROOT}!!g" %{!?without_shared:${basefile}.files} ${basefile}-devel.files ${basefile}-prof.files \
|
|
|
|
sed -i -e "s!${RPM_BUILD_ROOT}!!g" %{!?without_shared:${basepkg}.files} ${basepkg}-devel.files ${basepkg}-prof.files \
|
|
|
|
%{nil}
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
|
|
|
# compiler version
|
|
|
|
# compiler version
|
|
|
|
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
|
|
|
|
%ghc_version %{!?ghc_version_override:%(ghc --numeric-version)}%{?ghc_version_override}
|
|
|
|
|
|
|
|
|
|
|
|
# create and install package.conf file
|
|
|
|
# create and install package.conf file
|
|
|
|
# cabal_pkg_conf [pkgname]
|
|
|
|
# cabal_pkg_conf [name-ver]
|
|
|
|
%cabal_pkg_conf \
|
|
|
|
%cabal_pkg_conf()\
|
|
|
|
|
|
|
|
pkgnamever=%{?1}%{!?1:%{pkg_name}-%{version}} \
|
|
|
|
%cabal register --gen-pkg-config \
|
|
|
|
%cabal register --gen-pkg-config \
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d \
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d \
|
|
|
|
install --mode=0644 %{?1}%{!?1:%{pkg_name}}-%{version}.conf $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d
|
|
|
|
install --mode=0644 ${pkgnamever}.conf $RPM_BUILD_ROOT%{ghcpkgbasedir}/package.conf.d \
|
|
|
|
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
|
|
|
# devel pkg basic requires
|
|
|
|
# devel pkg basic requires
|
|
|
|
%ghc_devel_requires Requires(post): ghc = %{ghc_version}\
|
|
|
|
%ghc_devel_requires Requires(post): ghc = %{ghc_version}\
|
|
|
@ -88,7 +92,7 @@ Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}} = %{-v:%{-v*}}%{!-v:%{version
|
|
|
|
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
|
|
|
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
|
|
|
|
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
|
|
|
%define ghc_pkg_name ghc-%{local_pkg_name}\
|
|
|
|
%package -n %{ghc_pkg_name}\
|
|
|
|
%package -n %{ghc_pkg_name}\
|
|
|
|
Summary: %{?common_summary}%{!?common_summary:%{local_pkg_name} library}\
|
|
|
|
Summary: %{?common_summary}%{!?common_summary:Haskell %{local_pkg_name} library}\
|
|
|
|
Group: System Environment/Libraries\
|
|
|
|
Group: System Environment/Libraries\
|
|
|
|
%{-v:Version: %{-v*}}\
|
|
|
|
%{-v:Version: %{-v*}}\
|
|
|
|
%{-l:License: %{-l*}}\
|
|
|
|
%{-l:License: %{-l*}}\
|
|
|
@ -179,23 +183,29 @@ find $RPM_BUILD_ROOT -type f -exec sh -c "file {} | grep -q 'dynamically linked'
|
|
|
|
|
|
|
|
|
|
|
|
# ghc_bin_build
|
|
|
|
# ghc_bin_build
|
|
|
|
%ghc_bin_build\
|
|
|
|
%ghc_bin_build\
|
|
|
|
%cabal_configure --ghc\
|
|
|
|
%cabal_configure\
|
|
|
|
%cabal build
|
|
|
|
%cabal build
|
|
|
|
|
|
|
|
|
|
|
|
# ghc_lib_build
|
|
|
|
# ghc_lib_build [name-version]
|
|
|
|
%ghc_lib_build\
|
|
|
|
%ghc_lib_build()\
|
|
|
|
%cabal_configure --ghc -p\
|
|
|
|
%{?1:cd %1}\
|
|
|
|
|
|
|
|
%cabal_configure -p %{?1:--docdir=%{_docdir}/ghc-%1 --htmldir=%{ghcdocbasedir}/libraries/%1}\
|
|
|
|
%cabal build\
|
|
|
|
%cabal build\
|
|
|
|
%cabal haddock %{!?without_hscolour:--hyperlink-source}
|
|
|
|
%cabal haddock %{!?without_hscolour:--hyperlink-source}\
|
|
|
|
|
|
|
|
%{?1:cd -}\
|
|
|
|
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
|
|
|
# ghc_bin_install
|
|
|
|
# install bin package
|
|
|
|
%ghc_bin_install\
|
|
|
|
%ghc_bin_install\
|
|
|
|
%cabal_install\
|
|
|
|
%cabal_install\
|
|
|
|
%ghc_strip_dynlinked
|
|
|
|
%ghc_strip_dynlinked
|
|
|
|
|
|
|
|
|
|
|
|
# ghc_lib_install
|
|
|
|
# ghc_lib_install [name-version]
|
|
|
|
%ghc_lib_install\
|
|
|
|
%ghc_lib_install()\
|
|
|
|
|
|
|
|
%{?1:cd %1}\
|
|
|
|
%cabal_install\
|
|
|
|
%cabal_install\
|
|
|
|
%cabal_pkg_conf\
|
|
|
|
%cabal_pkg_conf\
|
|
|
|
|
|
|
|
%{?1:cd -}\
|
|
|
|
%ghc_gen_filelists\
|
|
|
|
%ghc_gen_filelists\
|
|
|
|
%ghc_strip_dynlinked
|
|
|
|
%{!?1:%ghc_strip_dynlinked}\
|
|
|
|
|
|
|
|
%{nil}
|
|
|
|