]>
Commit | Line | Data |
---|---|---|
acf06844 JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname errors | |
6 | Summary: errors: Simplified error-handling | |
7 | Name: ghc-%{pkgname} | |
8 | Version: 2.3.0 | |
d84ddd6c | 9 | Release: 2 |
acf06844 JR |
10 | License: BSD |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/errors | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
14 | # Source0-md5: 43bec23a661dd4a5eefb5549b4fad8a8 | |
15 | URL: http://hackage.haskell.org/package/errors | |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | BuildRequires: ghc-safe >= 0.3.3 | |
18 | BuildRequires: ghc-transformers >= 0.2 | |
19 | BuildRequires: ghc-transformers-compat >= 0.4 | |
20 | %if %{with prof} | |
21 | BuildRequires: ghc-prof | |
22 | BuildRequires: ghc-safe-prof >= 0.3.3 | |
23 | BuildRequires: ghc-transformers-prof >= 0.2 | |
24 | BuildRequires: ghc-transformers-compat-prof >= 0.4 | |
25 | %endif | |
26 | BuildRequires: rpmbuild(macros) >= 1.608 | |
27 | %requires_eq ghc | |
28 | Requires(post,postun): /usr/bin/ghc-pkg | |
29 | Requires: ghc-safe >= 0.3.3 | |
30 | Requires: ghc-transformers >= 0.2 | |
31 | Requires: ghc-transformers-compat >= 0.4 | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | # debuginfo is not useful for ghc | |
35 | %define _enable_debug_packages 0 | |
36 | ||
37 | # don't compress haddock files | |
38 | %define _noautocompressdoc *.haddock | |
39 | ||
40 | %description | |
41 | The one-stop shop for all your error-handling needs! | |
42 | Just import Control.Error. | |
43 | ||
44 | This library encourages an error-handling style that directly uses | |
45 | the type system, rather than out-of-band exceptions. | |
46 | ||
47 | %package prof | |
48 | Summary: Profiling %{pkgname} library for GHC | |
49 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
50 | Group: Development/Libraries | |
51 | Requires: %{name} = %{version}-%{release} | |
52 | Requires: ghc-safe-prof >= 0.3.3 | |
53 | Requires: ghc-transformers-prof >= 0.2 | |
54 | Requires: ghc-transformers-compat-prof >= 0.4 | |
55 | ||
56 | %description prof | |
57 | Profiling %{pkgname} library for GHC. Should be installed when | |
58 | GHC's profiling subsystem is needed. | |
59 | ||
60 | %description prof -l pl.UTF-8 | |
61 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
62 | kiedy potrzebujemy systemu profilującego z GHC. | |
63 | ||
64 | %prep | |
65 | %setup -q -n %{pkgname}-%{version} | |
66 | ||
67 | %build | |
68 | runhaskell Setup.hs configure -v2 \ | |
69 | %{?with_prof:--enable-library-profiling} \ | |
70 | --prefix=%{_prefix} \ | |
71 | --libdir=%{_libdir} \ | |
72 | --libexecdir=%{_libexecdir} \ | |
73 | --docdir=%{_docdir}/%{name}-%{version} | |
74 | ||
75 | runhaskell Setup.hs build | |
76 | runhaskell Setup.hs haddock --executables | |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
81 | ||
82 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
83 | ||
84 | # work around automatic haddock docs installation | |
85 | %{__rm} -rf %{name}-%{version}-doc | |
86 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
87 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
88 | ||
89 | runhaskell Setup.hs register \ | |
90 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
91 | ||
92 | %clean | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %post | |
96 | %ghc_pkg_recache | |
97 | ||
98 | %postun | |
99 | %ghc_pkg_recache | |
100 | ||
101 | %files | |
102 | %defattr(644,root,root,755) | |
103 | %doc CHANGELOG.md %{name}-%{version}-doc/* | |
104 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
105 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
106 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so | |
107 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a | |
108 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
109 | ||
110 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control | |
111 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/*.hi | |
112 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/*.dyn_hi | |
113 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Error | |
114 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Error/*.hi | |
115 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Error/*.dyn_hi | |
116 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data | |
117 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/*.hi | |
118 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/*.dyn_hi | |
119 | ||
120 | %if %{with prof} | |
121 | %files prof | |
122 | %defattr(644,root,root,755) | |
123 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
124 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/*.p_hi | |
125 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Control/Error/*.p_hi | |
126 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/*.p_hi | |
127 | %endif |