0682b80
%define pkg_name @PACKAGE@
0682b80
%define ghc_version @GHC_VERSION@
0682b80
0682b80
%define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version}
0682b80
%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name}
0682b80
0682b80
%define build_prof 1
0682b80
%define build_doc 1
0682b80
0682b80
# ghc does not emit debug information
0682b80
%define debug_package %{nil}
0682b80
b17255a
Name:           ghc-%{pkg_name}
b17255a
Version:        @VERSION@
b17255a
Release:        1%{?dist}
b17255a
Summary:        Haskell %{pkg_name} library *FIXME*
b17255a
b17255a
Group:          Development/Libraries
b17255a
License:        BSD?
b17255a
URL:            http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name}
b17255a
Source0:        http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
b17255a
Provides:       %{name}-devel = %{version}-%{release}
b17255a
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
0682b80
# ghc has only been bootstrapped on the following archs:
b17255a
ExclusiveArch:  i386 x86_64 ppc
b17255a
BuildRequires:  ghc = %{ghc_version}
0682b80
%if %{build_prof}
b17255a
BuildRequires:  ghc-prof = %{ghc_version}
0682b80
%endif
b17255a
Requires:       ghc = %{ghc_version}
b17255a
Requires(post): ghc = %{ghc_version}
0682b80
Requires(preun): ghc = %{ghc_version}
0682b80
Requires(postun): ghc = %{ghc_version}
0682b80
0682b80
%description
0682b80
Haskell %{pkg_name} library for ghc-%{ghc_version}. *FIXME*
0682b80
0682b80
0682b80
%if %{build_prof}
0682b80
%package prof
0682b80
Summary: Profiling libraries for %{name}
0682b80
Group: Development/Libraries
0682b80
Requires: ghc-prof = %{ghc_version}
0682b80
0682b80
%description prof
0682b80
This package contains profiling libraries for ghc %{ghc_version}.
0682b80
%endif
0682b80
0682b80
0682b80
%prep
0682b80
%setup -q -n %{pkg_name}-%{version}
0682b80
0682b80
0682b80
%build
0682b80
%cabal_configure --ghc \
0682b80
%if %{build_prof}
0682b80
  -p
0682b80
%else
0682b80
%{nil}
0682b80
%endif
0682b80
%cabal_build
0682b80
%if %{build_doc}
0682b80
%cabal_haddock
0682b80
%endif
0682b80
%ghc_gen_scripts
0682b80
0682b80
0682b80
%install
0682b80
rm -rf $RPM_BUILD_ROOT
0682b80
%cabal_install
0682b80
%ghc_install_scripts
0682b80
%ghc_gen_filelists %{name}
0682b80
0682b80
0682b80
%clean
0682b80
rm -rf $RPM_BUILD_ROOT
0682b80
0682b80
0682b80
%post 
0682b80
%ghc_postinst_script
0682b80
%if %{build_doc}
0682b80
%ghc_reindex_haddock
0682b80
%endif
0682b80
0682b80
0682b80
%preun 
0682b80
%ghc_preun_script
0682b80
0682b80
0682b80
%postun
0682b80
if [ "$1" -eq 0 ] ; then
0682b80
%if %{build_doc}
0682b80
  %ghc_reindex_haddock
0682b80
%endif
0682b80
fi
0682b80
0682b80
0682b80
%files -f %{name}.files
0682b80
%defattr(-,root,root,-)
10d4eb0
%doc LICENSE
0682b80
%if %{build_doc}
0682b80
%{pkg_docdir}
0682b80
%endif
0682b80
0682b80
0682b80
%if %{build_prof}
0682b80
%files prof -f %{name}-prof.files
0682b80
%defattr(-,root,root,-)
0682b80
%endif
0682b80
0682b80
0682b80
%changelog
0682b80
* @DATE@ @PACKAGER@ <@EMAIL@> - @VERSION@-1
b17255a
- initial packaging for Fedora created by cabal2spec