%define pkg_name zip-archive %define ghc_version %(ghc --numeric-version) %define pkg_libdir %{_libdir}/ghc-%{ghc_version}/%{pkg_name}-%{version} %define pkg_docdir %{_datadir}/doc/ghc/libraries/%{pkg_name}-%{version} # ghc does not emit debug information %define debug_package %{nil} Name: ghc-%{pkg_name} Version: 0.1.1.3 Release: 0 Summary: Library for creating and modifying zip archives Group: Development/Libraries License: GPL 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.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ghc, ghc-doc, ghc-prof BuildRequires: ghc-binary-devel, ghc-binary-prof, ghc-binary-doc BuildRequires: ghc-zlib-devel, ghc-zlib-prof, ghc-zlib-doc BuildRequires: ghc-digest-devel, ghc-digest-prof, ghc-digest-doc BuildRequires: ghc-utf8-string-devel, ghc-utf8-string-prof, ghc-utf8-string-doc BuildRequires: licenses %description The zip-archive library provides functions for creating, modifying, and extracting files from zip archives. This package provides the Haskell %{pkg_name} library for ghc. %package devel Summary: Haskell %{pkg_name} library Group: Development/Libraries Requires: ghc = %{ghc_version} Requires(post): ghc = %{ghc_version} Requires(preun): ghc = %{ghc_version} Requires: ghc-binary-devel Requires: ghc-zlib-devel Requires: ghc-digest-devel Requires: ghc-utf8-string-devel Requires: licenses %description devel The zip-archive library provides functions for creating, modifying, and extracting files from zip archives. This package contains the development files for %{name} built for ghc-%{ghc_version}. %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} Requires: ghc-binary-doc Requires: ghc-zlib-doc Requires: ghc-digest-doc Requires: ghc-utf8-string-doc %description doc The zip-archive library provides functions for creating, modifying, and extracting files from zip archives. This package contains development documentation files for the %{name} library. %package prof Summary: Profiling libraries for %{name} Group: Development/Libraries Requires: %{name}-devel = %{version}-%{release} Requires: ghc-prof = %{ghc_version} Requires: ghc-binary-prof Requires: ghc-digest-prof Requires: ghc-utf8-string-prof %description prof The zip-archive library provides functions for creating, modifying, and extracting files from zip archives. This package contains profiling libraries for %{name}. %prep %setup -q -n %{pkg_name}-%{version} %build %cabal_configure --ghc %{!?without_prof:-p} %cabal build %cabal haddock %ghc_gen_scripts %install %cabal_install %ghc_install_scripts %ghc_gen_filelists %{name} for FILE in LICENSE ; do MD5SUM=$(md5sum $FILE | sed 's/ .*//') if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE fi done %post devel %ghc_register_pkg %post doc %ghc_reindex_haddock %preun devel if [ "$1" -eq 0 ] ; then %ghc_unregister_pkg fi %postun doc if [ "$1" -eq 0 ] ; then %ghc_reindex_haddock fi %files devel -f %{name}-devel.files %defattr(-,root,root,-) %{_docdir}/%{name}-%{version} %files doc %defattr(-,root,root,-) %{pkg_docdir} %files prof -f %{name}-prof.files %defattr(-,root,root,-) %changelog * Sun Aug 2 2009 Herbert Graeber - 0.1.1.3 - Require ghc-binary * Sat Aug 1 2009 Herbert Graeber - 0.1.1.3 - Build requires ghc-utf8-string - Require ghc-zlib, ghc-digest and ghc-utf8-string * Fri Jul 31 2009 Herbert Graeber - 0.1.1.3 - Initial Package