- no longer hard code ghc_version (Till Maas, #426751)

- use bcond for doc and prof build flags (Till Maas, #426751)
This commit is contained in:
Jens Petersen 2008-12-17 05:41:58 +00:00
parent 9dadcbd710
commit 59108cef1a

View File

@ -1,18 +1,18 @@
%define pkg_name zlib %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_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version}
%define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name} %define pkg_docdir %{_docdir}/ghc/libraries/%{pkg_name}
%define build_prof 1 %bcond_without prof
%define build_doc 1 %bcond_without doc
# ghc does not emit debug information # ghc does not emit debug information
%define debug_package %{nil} %define debug_package %{nil}
Name: ghc-%{pkg_name} Name: ghc-%{pkg_name}
Version: 0.5.0.0 Version: 0.5.0.0
Release: 3%{?dist} Release: 4%{?dist}
License: BSD License: BSD
Group: Development/Libraries Group: Development/Libraries
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name} 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. full zlib feature set.
%if %{build_prof} %if %{with prof}
%package prof %package prof
Summary: Profiling libraries for %{name} Summary: Profiling libraries for %{name}
Group: Development/Libraries Group: Development/Libraries
@ -59,14 +59,9 @@ This package contains profiling libraries for %{name}.
%build %build
%cabal_configure --ghc \ %cabal_configure --ghc %{!?without_prof:-p}
%if %{build_prof}
-p
%else
%{nil}
%endif
%cabal build %cabal build
%if %{build_doc} %if %{with doc}
%cabal haddock %cabal haddock
%endif %endif
%ghc_gen_scripts %ghc_gen_scripts
@ -85,7 +80,7 @@ rm -rf $RPM_BUILD_ROOT
%post %post
%ghc_register_pkg %ghc_register_pkg
%if %{build_doc} %if %{with doc}
%ghc_reindex_haddock %ghc_reindex_haddock
%endif %endif
@ -98,7 +93,7 @@ fi
%postun %postun
if [ "$1" -eq 0 ] ; then if [ "$1" -eq 0 ] ; then
%if %{build_doc} %if %{with doc}
%ghc_reindex_haddock %ghc_reindex_haddock
%endif %endif
fi fi
@ -107,18 +102,22 @@ fi
%files -f %{name}.files %files -f %{name}.files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc LICENSE %doc LICENSE
%if %{build_doc} %if %{with doc}
%{pkg_docdir} %{pkg_docdir}
%endif %endif
%if %{build_prof} %if %{with prof}
%files prof -f %{name}-prof.files %files prof -f %{name}-prof.files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%endif %endif
%changelog %changelog
* Wed Dec 17 2008 Jens Petersen <petersen@redhat.com> - 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 <petersen@redhat.com> - 0.5.0.0-3 * Mon Dec 1 2008 Jens Petersen <petersen@redhat.com> - 0.5.0.0-3
- sync with lib template: - sync with lib template:
- add build_prof and build_doc - add build_prof and build_doc