diff --git a/ghc-tar.spec b/ghc-tar.spec index e658d4d..7b1c9d2 100644 --- a/ghc-tar.spec +++ b/ghc-tar.spec @@ -1,25 +1,28 @@ %global pkg_name tar +%global common_summary Haskell %{pkg_name} library + +%global common_description A Haskell %{pkg_name} library for ghc. + %bcond_without doc %bcond_without prof +%bcond_without shared # ghc does not emit debug information -%global debug_package %{nil} +#%%global debug_package %{nil} Name: ghc-%{pkg_name} Version: 0.3.1.0 -Release: 1%{?dist} -Summary: Haskell %{pkg_name} library +Release: 2%{?dist} +Summary: %{common_summary} -Group: Development/Libraries +Group: System Environment/Libraries License: BSD URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name} Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # fedora ghc archs: ExclusiveArch: %{ix86} x86_64 ppc alpha -BuildRequires: ghc -BuildRequires: ghc-rpm-macros +BuildRequires: ghc, ghc-rpm-macros >= 0.4.0 %if %{with doc} BuildRequires: ghc-doc %endif @@ -28,44 +31,46 @@ BuildRequires: ghc-prof %endif %description -This package provides the Haskell %{pkg_name} library for ghc. +%{common_description} +%if %{with shared} +This package provides the shared library. +%endif %package devel -Summary: Haskell %{pkg_name} library +Summary: %{common_summary} development files Group: Development/Libraries -Requires: ghc = %{ghc_version} -Requires(post): ghc = %{ghc_version} -Requires(preun): ghc = %{ghc_version} +%{?ghc_requires} %description devel -This package contains the development files for %{name} -built for ghc-%{ghc_version}. +%{common_description} + +This package contains the development files. %if %{with doc} %package doc -Summary: Documentation for %{name} -Group: Development/Libraries -Requires: ghc-doc = %{ghc_version} -Requires(post): ghc-doc = %{ghc_version} -Requires(postun): ghc-doc = %{ghc_version} +Summary: Documentation for %{common_summary} +Group: Development/Libraries +%{?ghc_doc_requires} %description doc -This package contains development documentation files for the %{name} library. +%{common_description} + +This package contains development documentation files. %endif %if %{with prof} %package prof -Summary: Profiling libraries for %{name} -Group: Development/Libraries -Requires: %{name}-devel = %{version}-%{release} -Requires: ghc-prof = %{ghc_version} +Summary: Profiling libraries for %{common_summary} +Group: Development/Libraries +%{?ghc_prof_requires} %description prof -This package contains profiling libraries for %{name} -built for ghc-%{ghc_version}. +%{common_description} + +This package contains the profiling library. %endif @@ -79,13 +84,12 @@ built for ghc-%{ghc_version}. %if %{with doc} %cabal haddock %endif -%ghc_gen_scripts %install -rm -rf $RPM_BUILD_ROOT %cabal_install -%ghc_install_scripts +%cabal_pkg_conf + %ghc_gen_filelists %{name} @@ -94,7 +98,7 @@ rm -rf $RPM_BUILD_ROOT %post devel -%ghc_register_pkg +ghc-pkg recache %if %{with doc} @@ -103,10 +107,8 @@ rm -rf $RPM_BUILD_ROOT %endif -%preun devel -if [ "$1" -eq 0 ] ; then - %ghc_unregister_pkg -fi +%postun devel +ghc-pkg recache %if %{with doc} @@ -117,9 +119,18 @@ 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} @@ -135,6 +146,11 @@ fi %changelog +* Sat Dec 26 2009 Jens Petersen - 0.3.1.0-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 + * Fri Aug 28 2009 Yaakov M. Nemoy - 0.3.1.0-1 - updated to latest upstream