%bcond_without doc
%bcond_without prof
# ghc does not emit debug information
%global debug_package %{nil}
%define platform_progs()\
%{?1}Requires: ghc = 6.10.4\
%{?1}Requires: cabal-install >= 0.6.2\
%{?1}Requires: alex = 2.3.1\
%{?1}Requires: happy = 1.18.4\
%{nil}
%define platform_libs()\
%{?2}Requires: ghc-cgi-%1 = 3001.1.7.1\
%{?2}Requires: ghc-fgl-%1 = 5.4.2.2\
%{?2}Requires: ghc-editline-%1 = 0.2.1.0\
%{?2}Requires: ghc-GLUT-%1 = 2.1.1.2\
%{?2}Requires: ghc-network-%1 = 2.2.1.4\
%{?2}Requires: ghc-OpenGL-%1 = 2.2.1.1\
%{?2}Requires: ghc-time-%1 = 1.1.2.4\
%{?2}Requires: ghc-zlib-%1 = 0.5.0.0\
%{?2}Requires: ghc-HTTP-%1 = 4000.0.6\
# following are part of ghc-6.10 extralibs\
# %{?2}Requires: ghc-HUnit-%1 = 1.2.0.3\
# (all rest need to be packaged for 6.12):\
# %{?2}Requires: ghc-QuickCheck-%1 = 1.2.0.0\
# %{?2}Requires: ghc-haskell-src-%1 = 1.0.1.3\
# %{?2}Requires: ghc-html-%1 = 1.0.1.2\
# %{?2}Requires: ghc-mtl-%1 = 1.1.0.2\
# %{?2}Requires: ghc-parsec-%1 = 2.1.0.1\
# %{?2}Requires: ghc-parallel-%1 = 1.1.0.1\
# %{?2}Requires: ghc-regex-base-%1 = 0.72.0.2\
# %{?2}Requires: ghc-regex-compat-%1 = 0.71.0.1\
# %{?2}Requires: ghc-regex-posix-%1 = 0.72.0.3\
# %{?2}Requires: ghc-stm-%1 = 2.1.1.2\
# %{?2}Requires: ghc-xhtml-%1 = 3000.2.0.1\
%{nil}
Name: haskell-platform
Version: 2009.2.0.2
Release: 4%{?dist}
Summary: Standard Haskell distribution
Group: Development/Tools
License: BSD
URL: http://hackage.haskell.org/platform
Source0: http://hackage.haskell.org/platform/%{version}/cabal/%{name}-%{version}.tar.gz
Patch1: haskell-platform-2009.2.0.2-relax-cabal-install.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# fedora ghc archs:
ExclusiveArch: %{ix86} x86_64 ppc alpha
BuildRequires: ghc, ghc-rpm-macros
%if %{with doc}
BuildRequires: ghc-doc
%endif
%if %{with prof}
BuildRequires: ghc-prof
%endif
%platform_progs Build
%platform_libs devel Build
%platform_progs
Requires: ghc-haskell-platform-devel = %{version}
%description
The Haskell Platform is a blessed library and tool suite for Haskell
distilled from Hackage.
%package -n ghc-%{name}-devel
Summary: Standard Haskell distribution libraries
Group: Development/Libraries
Provides: ghc-%{name} = %{version}-%{release}
Requires: ghc = %{ghc_version}
Requires(post): ghc = %{ghc_version}
Requires(preun): ghc = %{ghc_version}
%platform_libs devel
%description -n ghc-%{name}-devel
This package contains the development files for %{name}
built for ghc-%{ghc_version}.
%if %{with doc}
%package -n ghc-%{name}-doc
Summary: Standard Haskell distribution documentation
Group: Development/Libraries
Requires: ghc-doc = %{ghc_version}
Requires(post): ghc-doc = %{ghc_version}
Requires(postun): ghc-doc = %{ghc_version}
%platform_libs doc
%description -n ghc-%{name}-doc
This package contains development documentation files for the
%{name} library.
%endif
%if %{with prof}
%package -n ghc-%{name}-prof
Summary: Standard Haskell distribution profiling libraries
Group: Development/Libraries
Requires: ghc-%{name}-devel = %{version}-%{release}
Requires: ghc-prof = %{ghc_version}
%platform_libs prof
%description -n ghc-%{name}-prof
This package contains profiling libraries for %{name}
built for ghc-%{ghc_version}.
%endif
%prep
%setup -q
# allow cabal-install > 0.6.2
%patch1 -p1 -b .orig
%build
%cabal_configure --ghc %{?with_prof:-p}
%cabal build
%if %{with doc}
%cabal haddock
%endif
%ghc_gen_scripts
%install
rm -rf $RPM_BUILD_ROOT
%cabal_install
# metapackage so need to create:
mkdir -p $RPM_BUILD_ROOT%{ghcpkgdir}
%ghc_install_scripts
%ghc_gen_filelists ghc-%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post -n ghc-%{name}-devel
%ghc_register_pkg
%if %{with doc}
%post -n ghc-%{name}-doc
%ghc_reindex_haddock
%endif
%preun -n ghc-%{name}-devel
if [ "$1" -eq 0 ] ; then
%ghc_unregister_pkg
fi
%if %{with doc}
%postun -n ghc-%{name}-doc
if [ "$1" -eq 0 ] ; then
%ghc_reindex_haddock
fi
%endif
%files
%defattr(-,root,root,-)
%doc LICENSE
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
%defattr(-,root,root,-)
%if %{with doc}
%files -n ghc-%{name}-doc -f ghc-%{name}-doc.files
%defattr(-,root,root,-)
%endif
%if %{with prof}
%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files
%defattr(-,root,root,-)
%endif
%changelog
* Tue Jan 19 2010 Jens Petersen <petersen@redhat.com> - 2009.2.0.2-4
- allow cabal-install >= 0.6.2 (#555966)
* Mon Sep 28 2009 Jens Petersen <petersen@redhat.com> - 2009.2.0.2-3
- fix rpmlint warnings (bos, #523883)
* Mon Sep 28 2009 Jens Petersen <petersen@redhat.com> - 2009.2.0.2-2
- add all the buildrequires (#523883)
- create ghcpkgdir since metapackage
- nothing in bindir
* Thu Sep 17 2009 Jens Petersen <petersen@redhat.com> - 2009.2.0.2-1
- initial packaging for Fedora