]>
Commit | Line | Data |
---|---|---|
6230a19a JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname polyparse | |
6 | Summary: A variety of alternative parser combinator libraries | |
7 | Name: ghc-%{pkgname} | |
60ada942 | 8 | Version: 1.13 |
40ca85ec | 9 | Release: 2 |
6230a19a JP |
10 | License: LGPL |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/polyparse | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
60ada942 JR |
14 | # Source0-md5: 6656b800ff52a842ca0fd8083bad2e7d |
15 | Patch0: ghc-8.10.patch | |
6230a19a JP |
16 | URL: http://hackage.haskell.org/package/polyparse |
17 | BuildRequires: ghc >= 6.12.3 | |
60ada942 | 18 | BuildRequires: ghc-base |
6230a19a JP |
19 | BuildRequires: ghc-bytestring |
20 | BuildRequires: ghc-text | |
21 | %if %{with prof} | |
22 | BuildRequires: ghc-prof >= 6.12.3 | |
60ada942 | 23 | BuildRequires: ghc-base-prof |
6230a19a JP |
24 | BuildRequires: ghc-bytestring-prof |
25 | BuildRequires: ghc-text-prof | |
26 | %endif | |
27 | BuildRequires: rpmbuild(macros) >= 1.608 | |
28 | Requires(post,postun): /usr/bin/ghc-pkg | |
29 | %requires_eq ghc | |
60ada942 | 30 | Requires: ghc-base |
6230a19a JP |
31 | Requires: ghc-bytestring |
32 | Requires: ghc-text | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | # debuginfo is not useful for ghc | |
36 | %define _enable_debug_packages 0 | |
37 | ||
38 | # don't compress haddock files | |
39 | %define _noautocompressdoc *.haddock | |
40 | ||
41 | %description | |
42 | A variety of alternative parser combinator libraries, including the | |
43 | original HuttonMeijer set. The Poly sets have features like good error | |
44 | reporting, arbitrary token type, running state, lazy parsing, and so | |
45 | on. Finally, Text.Parse is a proposed replacement for the standard | |
46 | Read class, for better deserialisation of Haskell values from Strings. | |
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} | |
60ada942 | 53 | Requires: ghc-base-prof |
6230a19a JP |
54 | Requires: ghc-bytestring-prof |
55 | Requires: ghc-text-prof | |
56 | ||
57 | %description prof | |
58 | Profiling %{pkgname} library for GHC. Should be installed when | |
59 | GHC's profiling subsystem is needed. | |
60 | ||
61 | %description prof -l pl.UTF-8 | |
62 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
63 | kiedy potrzebujemy systemu profilującego z GHC. | |
64 | ||
65 | %prep | |
66 | %setup -q -n %{pkgname}-%{version} | |
60ada942 | 67 | %patch0 -p1 |
6230a19a JP |
68 | |
69 | %build | |
70 | runhaskell Setup.hs configure -v2 \ | |
71 | %{?with_prof:--enable-library-profiling} \ | |
72 | --prefix=%{_prefix} \ | |
73 | --libdir=%{_libdir} \ | |
74 | --libexecdir=%{_libexecdir} \ | |
75 | --docdir=%{_docdir}/%{name}-%{version} | |
76 | ||
77 | runhaskell Setup.hs build | |
78 | runhaskell Setup.hs haddock --executables | |
79 | ||
80 | %install | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
83 | ||
84 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
85 | ||
86 | # work around automatic haddock docs installation | |
87 | %{__rm} -rf %{name}-%{version}-doc | |
88 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
89 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
90 | ||
91 | runhaskell Setup.hs register \ | |
92 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
93 | ||
94 | %clean | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %post | |
98 | %ghc_pkg_recache | |
99 | ||
100 | %postun | |
101 | %ghc_pkg_recache | |
102 | ||
103 | %files | |
104 | %defattr(644,root,root,755) | |
105 | %doc %{name}-%{version}-doc/* | |
106 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
107 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
60ada942 JR |
108 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSpolyparse-%{version}-*.so |
109 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSpolyparse-%{version}-*.a | |
110 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSpolyparse-%{version}-*_p.a | |
6230a19a JP |
111 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text |
112 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.hi | |
60ada942 | 113 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.dyn_hi |
6230a19a JP |
114 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Parse |
115 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Parse/*.hi | |
60ada942 | 116 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Parse/*.dyn_hi |
6230a19a JP |
117 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators |
118 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/*.hi | |
60ada942 | 119 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/*.dyn_hi |
6230a19a JP |
120 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/Poly |
121 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/Poly/*.hi | |
60ada942 | 122 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/Poly/*.dyn_hi |
6230a19a JP |
123 | |
124 | %if %{with prof} | |
125 | %files prof | |
126 | %defattr(644,root,root,755) | |
60ada942 | 127 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSpolyparse-%{version}-*_p.a |
6230a19a JP |
128 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.p_hi |
129 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Parse/*.p_hi | |
130 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/*.p_hi | |
131 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/Poly/*.p_hi | |
132 | %endif |