diff --git a/ghc-zlib.spec b/ghc-zlib.spec index b5e4167..e2caf24 100644 --- a/ghc-zlib.spec +++ b/ghc-zlib.spec @@ -1,18 +1,18 @@ %define pkg_name zlib -%define ghc_version 6.10.1 +%define ghc_version %(ghc --numeric-version) %define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version} %define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name} -%define build_prof 1 -%define build_doc 1 +%bcond_without prof +%bcond_without doc # ghc does not emit debug information %define debug_package %{nil} Name: ghc-%{pkg_name} Version: 0.5.0.0 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Group: Development/Libraries URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name} @@ -42,7 +42,7 @@ the few cases where more control is needed, it provides access to the full zlib feature set. -%if %{build_prof} +%if %{with prof} %package prof Summary: Profiling libraries for %{name} Group: Development/Libraries @@ -59,14 +59,9 @@ This package contains profiling libraries for %{name}. %build -%cabal_configure --ghc \ -%if %{build_prof} - -p -%else -%{nil} -%endif +%cabal_configure --ghc %{!?without_prof:-p} %cabal build -%if %{build_doc} +%if %{with doc} %cabal haddock %endif %ghc_gen_scripts @@ -85,7 +80,7 @@ rm -rf $RPM_BUILD_ROOT %post %ghc_register_pkg -%if %{build_doc} +%if %{with doc} %ghc_reindex_haddock %endif @@ -98,7 +93,7 @@ fi %postun if [ "$1" -eq 0 ] ; then -%if %{build_doc} +%if %{with doc} %ghc_reindex_haddock %endif fi @@ -107,18 +102,22 @@ fi %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE -%if %{build_doc} +%if %{with doc} %{pkg_docdir} %endif -%if %{build_prof} +%if %{with prof} %files prof -f %{name}-prof.files %defattr(-,root,root,-) %endif %changelog +* Wed Dec 17 2008 Jens Petersen - 0.5.0.0-4 +- no longer hard code ghc_version (Till Maas, #426751) +- use bcond for doc and prof build flags (Till Maas, #426751) + * Mon Dec 1 2008 Jens Petersen - 0.5.0.0-3 - sync with lib template: - add build_prof and build_doc