diff --git a/ghc-zlib.spec b/ghc-zlib.spec index 8374a58..817d5c0 100644 --- a/ghc-zlib.spec +++ b/ghc-zlib.spec @@ -1,8 +1,8 @@ %define pkg_name zlib -%define ghc_version %(ghc --numeric-version) +%define ghc_version 6.10.1 %define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version} -%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name} +%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name}-%{version} %bcond_without prof %bcond_without doc @@ -12,7 +12,7 @@ Name: ghc-%{pkg_name} Version: 0.5.0.0 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD Group: Development/Libraries URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name} @@ -21,15 +21,18 @@ Summary: Haskell compression and decompression library binding Provides: %{name}-devel = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExclusiveArch: i386 x86_64 ppc -BuildRequires: ghc -BuildRequires: ghc-prof +BuildRequires: ghc = %{ghc_version} +%if %{with doc} +BuildRequires: ghc-doc = %{ghc_version} +%endif +%if %{with prof} +BuildRequires: ghc-prof = %{ghc_version} +%endif BuildRequires: zlib-devel Requires: zlib-devel Requires: ghc = %{ghc_version} -# for ghc-pkg and haddock Requires(post): ghc = %{ghc_version} Requires(preun): ghc = %{ghc_version} -Requires(postun): ghc = %{ghc_version} %description This package provides a pure Haskell interface for compressing and @@ -42,6 +45,19 @@ the few cases where more control is needed, it provides access to the full zlib feature set. +%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} + +%description doc +This package contains development documentation files for the %{name} library. +%endif + + %if %{with prof} %package prof Summary: Profiling libraries for %{name} @@ -78,9 +94,12 @@ rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT -%post +%post %ghc_register_pkg + + %if %{with doc} +%post doc %ghc_reindex_haddock %endif @@ -91,18 +110,22 @@ if [ "$1" -eq 0 ] ; then fi -%postun -if [ "$1" -eq 0 ] ; then %if %{with doc} +%postun doc +if [ "$1" -eq 0 ] ; then %ghc_reindex_haddock -%endif fi +%endif %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE + + %if %{with doc} +%files doc +%defattr(-,root,root,-) %{pkg_docdir} %endif @@ -114,8 +137,12 @@ fi %changelog -* Wed Dec 17 2008 Jens Petersen - 0.5.0.0-4 -- no longer hard code ghc_version (Till Maas, #426751) +* Mon Feb 9 2009 Jens Petersen - 0.5.0.0-5 +- rebuild to fix unexpanded post preun macros +- add doc subpackage and BR ghc-doc +- add doc requires(post) ghc-doc + +* Mon Dec 22 2008 Jens Petersen - 0.5.0.0-4 - use bcond for doc and prof build flags (Till Maas, #426751) * Mon Dec 1 2008 Jens Petersen - 0.5.0.0-3