@ -3,7 +3,7 @@
# configure
%cabal_configure \
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' %{?with_shared:--enable-shared} %{?with_dynamic:--ghc-option=-dynamic}
%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}-%{version} --htmldir=%{ghcdocdir} --libsubdir='$compiler/$pkgid' %{! ?without _shared:--enable-shared} %{?with_dynamic:--ghc-option=-dynamic}
# install
%cabal_install %cabal copy --destdir=${RPM_BUILD_ROOT} -v
@ -25,16 +25,16 @@ pkgnamever=${pkgname}-%{version} \
rm -f ${basefile}.files ${basefile}-devel.files ${basefile}-prof.files \
echo "%defattr(-,root,root,-)" > ${basefile}.files \
if [ -d "${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}" ]; then \
%{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}%{! ?with_shared:-devel}.files} %{?1::} \
%{!?1:echo "%{_docdir}/%{name}-%{version}" >> ${basefile}%{?without _shared:-devel}.files} %{?1::} \
fi \
%if %{with shared } \
%if 0%{!?without_shared:1 } \
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
echo "%dir %{ghcpkgdir}" >> ${basefile}.files \
echo "%attr(755,root,root) %{ghcpkgdir}/libHS${pkgnamever}-ghc%{ghc_version}.so" >> ${basefile}.files \
fi \
%endif \
echo "%defattr(-,root,root,-)" > ${basefile}-devel.files \
echo "%{_libdir}/ghc-%{ghc_version }/package.conf.d/${pkgnamever}*.conf" >> ${basefile}-devel.files \
echo "%{ghcpkgbasedir }/package.conf.d/${pkgnamever}*.conf" >> ${basefile}-devel.files \
if [ -d "${RPM_BUILD_ROOT}%{ghcpkgdir}" ]; then \
find ${RPM_BUILD_ROOT}%{ghcpkgdir} -type d | sed "s/^/%dir /" >> ${basefile}-devel.files \
find ${RPM_BUILD_ROOT}%{ghcpkgdir} ! \\( -type d -o -name "*_p.a" -o -name "*.p_hi" -o -name "libHS*.so" \\) >> ${basefile}-devel.files \
@ -56,14 +56,14 @@ sed -i -e "s!${RPM_BUILD_ROOT}!!g" ${basefile}.files ${basefile}-devel.files ${b
# cabal_pkg_conf [pkgname]
%cabal_pkg_conf \
%cabal register --gen-pkg-config \
mkdir -p $RPM_BUILD_ROOT%{_libdir}/ghc-%{ghc_version }/package.conf.d \
install --mode=0644 %{?1}%{!?1:%{pkg_name}}-%{version}.conf $RPM_BUILD_ROOT%{_libdir}/ghc-%{ghc_version }/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
# devel pkg basic requires
%ghc_requires Requires: ghc = %{ghc_version}\
Requires(post): ghc = %{ghc_version}\
Requires(postun): ghc = %{ghc_version}\
%if %{with shared }\
%if 0%{!?without_shared:1 }\
Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}} = %{-v:%{-v*}}%{!-v:%{version}}-%{release}\
%endif
@ -76,10 +76,10 @@ Requires(postun): ghc-doc = %{ghc_version}
%ghc_prof_requires Requires: ghc-prof = %{ghc_version}\
Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}-devel = %{-v:%{-v*}}%{!-v:%{version}}-%{release}
# ghc_lib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-o obsolete-docver]
# ghc_lib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] (-o deprecated no-op)
%ghc_lib_package(n:c:h:o:)\
%define ghc_pkg_name %{-n:ghc- %{-n*}}%{!-n:ghc- %{pkg_name}}\
%if %{with shared }\
%define ghc_pkg_name ghc- %{-n:%{-n*}}%{!-n:%{pkg_name}}\
%if 0%{!?without_shared:1 }\
%files -n %{ghc_pkg_name} -f %{ghc_pkg_name}.files\
%defattr(-,root,root,-)\
%endif\
@ -89,7 +89,7 @@ Requires: ghc-%{-n:%{-n*}}%{!-n:%{pkg_name}}-devel = %{-v:%{-v*}}%{!-v:%{v
%ghc_package_prof\
%{nil}
# ghc_binlib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version] [-o obsolete-docver]
# ghc_binlib_package [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version] (-o deprecated no-op)
%ghc_binlib_package(n:c:h:l:v:o:)\
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
%define ghc_pkg_name ghc-%{local_pkg_name}\
@ -112,8 +112,12 @@ This package provides the shared library.\
# for docs post and postun
%ghc_reindex_haddock ( cd %{ghcdocbasedir}/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index ) || :
# ghc_package_devel [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version] [-o obsolete-docver]
# ghc_package_devel [-n pkgname] [-c cdepslist] [-h pkgdepslist] [-l licensetag] [-v version] (-o deprecated no-op)
%ghc_package_devel(n:c:h:l:v:o:)\
%global _use_internal_dependency_generator 0\
%global __find_provides /usr/lib/rpm/ghc-deps.sh --provides\
#%%global __find_requires /usr/lib/rpm/ghc-deps.sh --requires\
%global debug_package %{nil}\
%define local_pkg_name %{-n:%{-n*}}%{!-n:%{pkg_name}}\
%define ghc_pkg_name ghc-%{local_pkg_name}\
%package -n %{ghc_pkg_name}-devel\
@ -127,7 +131,9 @@ Group: Development/Libraries\
%{-h:Requires: %{-h*}}\
%{!-c:%{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}}\
%{-c:Requires: %{-c*}}\
%{-o:Obsoletes: %{ghc_pkg_name}-doc < %{-o*}}\
%{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-doc/g")}\
Obsoletes: %{ghc_pkg_name}-doc < %{version}-%{release}\
Provides: %{ghc_pkg_name}-doc = %{version}-%{release}\
\
%description -n %{ghc_pkg_name}-devel\
@ -157,8 +163,9 @@ Group: Development/Libraries\
%{-v:Version: %{-v*}}\
%{-l:License: %{-l*}}\
%{?ghc_prof_requires}\
%{!-h:%{?ghc_pkg_deps:Requires: %(echo %{ghc_pkg_deps} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}}\
%{-h:Requires: %(echo %{-h*} | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
%{!-h:%{?ghc_pkg_deps:Requires: %(echo "%{ghc_pkg_deps}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}}\
%{-h:Requires: %(echo "%{-h*}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
%{?ghc_pkg_obsoletes:Obsoletes: %(echo "%{ghc_pkg_obsoletes}" | sed -e "s/\\(ghc-[^, ]*\\)-devel/\\1-prof/g")}\
\
%description -n %{ghc_pkg_name}-prof\
%{?common_description}%{!?common_description:Haskell %{local_pkg_name} library.}\
@ -184,7 +191,7 @@ find $RPM_BUILD_ROOT -type f -exec sh -c "file {} | grep -q 'dynamically linked'
%ghc_lib_build\
%cabal_configure --ghc -p\
%cabal build\
%cabal haddock %{?with_hscolour:--hyperlink-source}
%cabal haddock %{! ?without _hscolour:--hyperlink-source} %{?with_devhelp:--haddock-option=--html-help=devhelp}
# ghc_bin_install
%ghc_bin_install\