| 1 | %global pkg_name unix-handle | 
|---|
| 2 |  | 
|---|
| 3 | %bcond_without doc | 
|---|
| 4 | %bcond_without prof | 
|---|
| 5 |  | 
|---|
| 6 | # ghc does not emit debug information | 
|---|
| 7 | %global debug_package %{nil} | 
|---|
| 8 |  | 
|---|
| 9 | Name:           ghc-%{pkg_name} | 
|---|
| 10 | Version:        0.0.0 | 
|---|
| 11 | Release:        0.%{scriptsversion}%{?dist} | 
|---|
| 12 | Summary:        Haskell %{pkg_name} library | 
|---|
| 13 |  | 
|---|
| 14 | Group:          Development/Libraries | 
|---|
| 15 | License:        BSD | 
|---|
| 16 | URL:            http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{pkg_name} | 
|---|
| 17 | Source0:        http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz | 
|---|
| 18 | BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | 
|---|
| 19 | # fedora ghc archs: | 
|---|
| 20 | ExclusiveArch:  %{ix86} x86_64 ppc alpha | 
|---|
| 21 | BuildRequires:  ghc, ghc-rpm-macros | 
|---|
| 22 | %if %{with doc} | 
|---|
| 23 | BuildRequires:  ghc-doc | 
|---|
| 24 | %endif | 
|---|
| 25 | %if %{with prof} | 
|---|
| 26 | BuildRequires:  ghc-prof | 
|---|
| 27 | %endif | 
|---|
| 28 |  | 
|---|
| 29 | %description | 
|---|
| 30 | This package provides the Haskell %{pkg_name} library for ghc. | 
|---|
| 31 |  | 
|---|
| 32 |  | 
|---|
| 33 | %package devel | 
|---|
| 34 | Summary:        Haskell %{pkg_name} library | 
|---|
| 35 | Group:          Development/Libraries | 
|---|
| 36 | Requires:       ghc = %{ghc_version} | 
|---|
| 37 | Requires(post): ghc = %{ghc_version} | 
|---|
| 38 | Requires(preun): ghc = %{ghc_version} | 
|---|
| 39 |  | 
|---|
| 40 | %description devel | 
|---|
| 41 | This package contains the development files for %{name} | 
|---|
| 42 | built for ghc-%{ghc_version}. | 
|---|
| 43 |  | 
|---|
| 44 |  | 
|---|
| 45 | %if %{with doc} | 
|---|
| 46 | %package doc | 
|---|
| 47 | Summary:        Documentation for %{name} | 
|---|
| 48 | Group:          Development/Libraries | 
|---|
| 49 | Requires:       ghc-doc = %{ghc_version} | 
|---|
| 50 | Requires(post): ghc-doc = %{ghc_version} | 
|---|
| 51 | Requires(postun): ghc-doc = %{ghc_version} | 
|---|
| 52 |  | 
|---|
| 53 | %description doc | 
|---|
| 54 | This package contains development documentation files for | 
|---|
| 55 | the %{name} library. | 
|---|
| 56 | %endif | 
|---|
| 57 |  | 
|---|
| 58 |  | 
|---|
| 59 | %if %{with prof} | 
|---|
| 60 | %package prof | 
|---|
| 61 | Summary:        Profiling libraries for %{name} | 
|---|
| 62 | Group:          Development/Libraries | 
|---|
| 63 | Requires:       %{name}-devel = %{version}-%{release} | 
|---|
| 64 | Requires:       ghc-prof = %{ghc_version} | 
|---|
| 65 |  | 
|---|
| 66 | %description prof | 
|---|
| 67 | This package contains profiling libraries for %{name} | 
|---|
| 68 | built for ghc-%{ghc_version}. | 
|---|
| 69 | %endif | 
|---|
| 70 |  | 
|---|
| 71 |  | 
|---|
| 72 | %prep | 
|---|
| 73 | %setup -q -n %{pkg_name}-%{version} | 
|---|
| 74 |  | 
|---|
| 75 |  | 
|---|
| 76 | %build | 
|---|
| 77 | %cabal_configure --ghc %{?with_prof:-p} | 
|---|
| 78 | %cabal build | 
|---|
| 79 | %if %{with doc} | 
|---|
| 80 | %cabal haddock | 
|---|
| 81 | %endif | 
|---|
| 82 | %ghc_gen_scripts | 
|---|
| 83 |  | 
|---|
| 84 |  | 
|---|
| 85 | %install | 
|---|
| 86 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 87 | %cabal_install | 
|---|
| 88 | %ghc_install_scripts | 
|---|
| 89 | %ghc_gen_filelists %{name} | 
|---|
| 90 |  | 
|---|
| 91 |  | 
|---|
| 92 | %clean | 
|---|
| 93 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 94 |  | 
|---|
| 95 |  | 
|---|
| 96 | %post devel | 
|---|
| 97 | %ghc_register_pkg | 
|---|
| 98 |  | 
|---|
| 99 |  | 
|---|
| 100 | %if %{with doc} | 
|---|
| 101 | %post doc | 
|---|
| 102 | %ghc_reindex_haddock | 
|---|
| 103 | %endif | 
|---|
| 104 |  | 
|---|
| 105 |  | 
|---|
| 106 | %preun devel | 
|---|
| 107 | if [ "$1" -eq 0 ] ; then | 
|---|
| 108 | %ghc_unregister_pkg | 
|---|
| 109 | fi | 
|---|
| 110 |  | 
|---|
| 111 |  | 
|---|
| 112 | %if %{with doc} | 
|---|
| 113 | %postun doc | 
|---|
| 114 | if [ "$1" -eq 0 ] ; then | 
|---|
| 115 | %ghc_reindex_haddock | 
|---|
| 116 | fi | 
|---|
| 117 | %endif | 
|---|
| 118 |  | 
|---|
| 119 |  | 
|---|
| 120 | %files devel -f %{name}-devel.files | 
|---|
| 121 | %defattr(-,root,root,-) | 
|---|
| 122 | %{_docdir}/%{name}-%{version} | 
|---|
| 123 |  | 
|---|
| 124 |  | 
|---|
| 125 | %if %{with doc} | 
|---|
| 126 | %files doc -f %{name}-doc.files | 
|---|
| 127 | %defattr(-,root,root,-) | 
|---|
| 128 | %endif | 
|---|
| 129 |  | 
|---|
| 130 |  | 
|---|
| 131 | %if %{with prof} | 
|---|
| 132 | %files prof -f %{name}-prof.files | 
|---|
| 133 | %defattr(-,root,root,-) | 
|---|
| 134 | %endif | 
|---|
| 135 |  | 
|---|
| 136 |  | 
|---|
| 137 | %changelog | 
|---|
| 138 | * Mon Mar 15 2010 Anders Kaseorg <andersk@mit.edu> - 0.0.0-0 | 
|---|
| 139 | - initial packaging for Fedora automatically generated by cabal2spec | 
|---|