]>
Commit | Line | Data |
---|---|---|
3572beea JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname base-compat-batteries | |
6 | Summary: base-compat with extra batteries | |
7 | Name: ghc-%{pkgname} | |
8 | Version: 0.11.1 | |
27000609 | 9 | Release: 2 |
3572beea JR |
10 | License: MIT |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/base-compat-batteries | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
14 | # Source0-md5: c1975c1d453094193426762a9c59f786 | |
15 | URL: http://hackage.haskell.org/package/base-compat-batteries | |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | BuildRequires: ghc-base-compat = 0.11.1 | |
18 | %if %{with prof} | |
19 | BuildRequires: ghc-prof | |
20 | BuildRequires: ghc-base-compat-prof = 0.11.1 | |
21 | %endif | |
22 | BuildRequires: rpmbuild(macros) >= 1.608 | |
23 | %requires_eq ghc | |
24 | Requires(post,postun): /usr/bin/ghc-pkg | |
25 | Requires: ghc-base-compat = 0.11.1 | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | # debuginfo is not useful for ghc | |
29 | %define _enable_debug_packages 0 | |
30 | ||
31 | # don't compress haddock files | |
32 | %define _noautocompressdoc *.haddock | |
33 | ||
34 | %description | |
35 | Provides functions available in later versions of base to a wider | |
36 | range of compilers, without requiring you to use CPP pragmas in your | |
37 | code. | |
38 | ||
39 | This package provides the same API as the base-compat library, but | |
40 | depends on compatibility packages (such as semigroups) to offer a | |
41 | wider support window than base-compat, which has no dependencies. | |
42 | Most of the modules in this library have the same names as in | |
43 | base-compat to make it easier to switch between the two. There also | |
44 | exist versions of each module with the suffix .Repl.Batteries, which | |
45 | are distinct from anything in base-compat, to allow for easier use in | |
46 | GHCi. | |
47 | ||
48 | %package prof | |
49 | Summary: Profiling %{pkgname} library for GHC | |
50 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
51 | Group: Development/Libraries | |
52 | Requires: %{name} = %{version}-%{release} | |
53 | Requires: ghc-base-compat-prof = 0.11.1 | |
54 | ||
55 | %description prof | |
56 | Profiling %{pkgname} library for GHC. Should be installed when | |
57 | GHC's profiling subsystem is needed. | |
58 | ||
59 | %description prof -l pl.UTF-8 | |
60 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
61 | kiedy potrzebujemy systemu profilującego z GHC. | |
62 | ||
63 | %prep | |
64 | %setup -q -n %{pkgname}-%{version} | |
65 | ||
66 | %build | |
67 | runhaskell Setup.lhs configure -v2 \ | |
68 | %{?with_prof:--enable-library-profiling} \ | |
69 | --prefix=%{_prefix} \ | |
70 | --libdir=%{_libdir} \ | |
71 | --libexecdir=%{_libexecdir} \ | |
72 | --docdir=%{_docdir}/%{name}-%{version} | |
73 | ||
74 | runhaskell Setup.lhs build | |
75 | runhaskell Setup.lhs haddock --executables | |
76 | ||
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
80 | ||
81 | runhaskell Setup.lhs copy --destdir=$RPM_BUILD_ROOT | |
82 | ||
83 | # work around automatic haddock docs installation | |
84 | %{__rm} -rf %{name}-%{version}-doc | |
85 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
86 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
87 | ||
88 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -type d | %{__sed} "s|$RPM_BUILD_ROOT|%dir |" > %{name}.files | |
89 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}.files | |
90 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.dyn_hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}.files | |
91 | find $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/%{pkgname}-%{version} -name '*.p_hi' | %{__sed} "s|$RPM_BUILD_ROOT||" >> %{name}-prof.files | |
92 | ||
93 | runhaskell Setup.lhs register \ | |
94 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %post | |
100 | %ghc_pkg_recache | |
101 | ||
102 | %postun | |
103 | %ghc_pkg_recache | |
104 | ||
105 | %files -f %{name}.files | |
106 | %defattr(644,root,root,755) | |
107 | %doc CHANGES.markdown README.markdown %{name}-%{version}-doc/* | |
108 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
109 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so | |
110 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a | |
111 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
112 | ||
113 | %if %{with prof} | |
114 | %files prof -f %{name}-prof.files | |
115 | %defattr(644,root,root,755) | |
116 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
117 | %endif |