]>
Commit | Line | Data |
---|---|---|
02be16cb JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
6a02fcf1 | 5 | %define pkgname random |
f8442377 JB |
6 | Summary: A random number library |
7 | Summary(pl.UTF-8): Biblioteka liczb losowych | |
6a02fcf1 | 8 | Name: ghc-%{pkgname} |
1ca8d67f | 9 | Version: 1.1 |
54d4cee8 | 10 | Release: 1 |
6a02fcf1 JR |
11 | License: BSD |
12 | Group: Development/Languages | |
1430df25 JB |
13 | #Source0Download: http://hackage.haskell.org/package/random |
14 | Source0: http://hackage.haskell.org/package/random-%{version}/%{pkgname}-%{version}.tar.gz | |
1ca8d67f | 15 | # Source0-md5: 474f10b9389b316e4472b71d20298993 |
6a02fcf1 JR |
16 | URL: http://hackage.haskell.org/package/random/ |
17 | BuildRequires: ghc >= 6.12.3 | |
414a68a3 JB |
18 | BuildRequires: ghc-base >= 3 |
19 | BuildRequires: ghc-base < 5 | |
20 | BuildRequires: ghc-time | |
21 | %if %{with prof} | |
22 | BuildRequires: ghc-prof >= 6.12.3 | |
23 | BuildRequires: ghc-base-prof >= 3 | |
24 | BuildRequires: ghc-base-prof < 5 | |
25 | BuildRequires: ghc-time-prof | |
26 | %endif | |
6a02fcf1 JR |
27 | BuildRequires: rpmbuild(macros) >= 1.608 |
28 | %requires_releq ghc | |
414a68a3 JB |
29 | Requires: ghc-base >= 3 |
30 | Requires: ghc-base < 5 | |
31 | Requires: ghc-time | |
2f48e81a | 32 | Obsoletes: ghc-random-doc |
6a02fcf1 JR |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
35 | # debuginfo is not useful for ghc | |
36 | %define _enable_debug_packages 0 | |
37 | ||
414a68a3 | 38 | # don't compress haddock files |
9f85fa41 | 39 | %define _noautocompressdoc *.haddock |
a3c6b797 | 40 | |
6a02fcf1 JR |
41 | %description |
42 | This package provides a random number library. | |
43 | ||
f8442377 JB |
44 | %description -l pl.UTF-8 |
45 | Ten pakiet zawiera bibliotekę liczb losowych. | |
46 | ||
ec1f01cc JR |
47 | %package prof |
48 | Summary: Profiling %{pkgname} library for GHC | |
f8442377 | 49 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC |
ec1f01cc JR |
50 | Group: Development/Libraries |
51 | Requires: %{name} = %{version}-%{release} | |
414a68a3 JB |
52 | Requires: ghc-base-prof >= 3 |
53 | Requires: ghc-base-prof < 5 | |
54 | Requires: ghc-time-prof | |
ec1f01cc JR |
55 | |
56 | %description prof | |
f8442377 | 57 | Profiling %{pkgname} library for GHC. Should be installed when |
ec1f01cc JR |
58 | GHC's profiling subsystem is needed. |
59 | ||
60 | %description prof -l pl.UTF-8 | |
f8442377 | 61 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana |
ec1f01cc JR |
62 | kiedy potrzebujemy systemu profilującego z GHC. |
63 | ||
6a02fcf1 JR |
64 | %prep |
65 | %setup -q -n %{pkgname}-%{version} | |
66 | ||
f8442377 JB |
67 | # it relies on ld.bfd specific options |
68 | mkdir -p ld-dir | |
69 | if [ -x /usr/bin/ld.bfd ]; then | |
70 | ln -sf /usr/bin/ld.bfd ld-dir/ld | |
71 | fi | |
72 | ||
6a02fcf1 | 73 | %build |
f8442377 | 74 | PATH=$(pwd)/ld-dir:$PATH |
02be16cb JB |
75 | runhaskell Setup.hs configure -v2 \ |
76 | %{?with_prof:--enable-library-profiling} \ | |
6a02fcf1 JR |
77 | --prefix=%{_prefix} \ |
78 | --libdir=%{_libdir} \ | |
79 | --libexecdir=%{_libexecdir} \ | |
80 | --docdir=%{_docdir}/%{name}-%{version} | |
81 | ||
82 | runhaskell Setup.hs build | |
83 | runhaskell Setup.hs haddock --executables | |
84 | ||
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
88 | ||
89 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
90 | ||
91 | # work around automatic haddock docs installation | |
92 | rm -rf %{name}-%{version}-doc | |
2f48e81a | 93 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc |
6a02fcf1 JR |
94 | |
95 | runhaskell Setup.hs register \ | |
02be16cb | 96 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf |
6a02fcf1 | 97 | |
fe17e319 ER |
98 | rm -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
99 | ||
6a02fcf1 JR |
100 | %clean |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %post | |
104 | %ghc_pkg_recache | |
105 | ||
106 | %postun | |
107 | %ghc_pkg_recache | |
108 | ||
109 | %files | |
110 | %defattr(644,root,root,755) | |
2f48e81a | 111 | %doc %{name}-%{version}-doc/* |
6a02fcf1 | 112 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf |
ec1f01cc | 113 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} |
1ca8d67f JR |
114 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSrandom-%{version}-*.a |
115 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSrandom-%{version}-*_p.a | |
116 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSrandom-%{version}-*.so | |
ec1f01cc JR |
117 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System |
118 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/*.hi | |
1ca8d67f | 119 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/*.dyn_hi |
ec1f01cc | 120 | |
02be16cb | 121 | %if %{with prof} |
ec1f01cc JR |
122 | %files prof |
123 | %defattr(644,root,root,755) | |
1ca8d67f | 124 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSrandom-%{version}-*_p.a |
ec1f01cc | 125 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/*.p_hi |
02be16cb | 126 | %endif |