ghc-fgl/ghc-fgl.spec

157 lines
2.8 KiB
RPMSpec

%global pkg_name fgl
%global common_summary Haskell Functional Graph Library
%global common_description Martin Erwig's Functional Graph Library.
%bcond_without doc
%bcond_without prof
%bcond_without shared
# ghc does not emit debug information
#%%global debug_package %{nil}
Name: ghc-%{pkg_name}
# part of haskell-platform-2009.2.0.2
Version: 5.4.2.2
Release: 2%{?dist}
Summary: %{common_summary}
Group: System Environment/Libraries
License: BSD
URL: http://web.engr.oregonstate.edu/~erwig/fgl/haskell/
Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
# fedora ghc archs:
ExclusiveArch: %{ix86} x86_64 ppc alpha
BuildRequires: ghc, ghc-rpm-macros >= 0.4.0
%if %{with doc}
BuildRequires: ghc-doc
%endif
%if %{with prof}
BuildRequires: ghc-prof
%endif
%description
%{common_description}
%if %{with shared}
This package provides the shared library.
%endif
%package devel
Summary: %{common_summary} development files
Group: Development/Libraries
%{?ghc_requires}
%description devel
%{common_description}
This package contains the development files.
%if %{with doc}
%package doc
Summary: Documentation for %{common_summary}
Group: Development/Libraries
%{?ghc_doc_requires}
%description doc
%{common_description}
This package contains development documentation files.
%endif
%if %{with prof}
%package prof
Summary: Profiling libraries for %{common_summary}
Group: Development/Libraries
%{?ghc_prof_requires}
%description prof
%{common_description}
This package contains the profiling library.
%endif
%prep
%setup -q -n %{pkg_name}-%{version}
%build
%cabal_configure --ghc %{?with_prof:-p}
%cabal build
%if %{with doc}
%cabal haddock
%endif
%install
%cabal_install
%cabal_pkg_conf
%ghc_gen_filelists %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post devel
ghc-pkg recache
%if %{with doc}
%post doc
%ghc_reindex_haddock
%endif
%postun devel
ghc-pkg recache
%if %{with doc}
%postun doc
if [ "$1" -eq 0 ] ; then
%ghc_reindex_haddock
fi
%endif
%if %{with shared}
%files -f %{name}.files
%defattr(-,root,root,-)
%{_docdir}/%{name}-%{version}
%endif
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
%if %{without shared}
%{_docdir}/%{name}-%{version}
%endif
%if %{with doc}
%files doc -f %{name}-doc.files
%defattr(-,root,root,-)
%endif
%if %{with prof}
%files prof -f %{name}-prof.files
%defattr(-,root,root,-)
%endif
%changelog
* Sat Dec 26 2009 Jens Petersen <petersen@redhat.com> - 5.4.2.2-2
- update for ghc-6.12.1: add shared library support
- use new ghc*_requires macros: needs ghc-rpm-macros 0.4.0
- add common_summary and common_description
* Wed Aug 12 2009 Bryan O'Sullivan <bos@serpentine.com> - 5.4.2.2-1
- initial packaging for Fedora created by cabal2spec