]>
Commit | Line | Data |
---|---|---|
fb89bcdb JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
83c9e572 ER |
5 | %define pkgname pcre-light |
6 | Summary: A library for Perl 5 compatible regular expressions | |
fb89bcdb | 7 | Summary(pl.UTF-8): Biblioteka wyrażeń regularnych zgodnych z Perlem 5 |
83c9e572 ER |
8 | Name: ghc-%{pkgname} |
9 | Version: 0.4 | |
4f16d537 | 10 | Release: 5 |
83c9e572 ER |
11 | License: BSD |
12 | Group: Development/Languages | |
fb89bcdb JB |
13 | #Source0Download: http://hackage.haskell.org/package/pcre-light |
14 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
83c9e572 | 15 | # Source0-md5: 4907d8d239d3c41f06855faee340d052 |
fb89bcdb | 16 | URL: http://hackage.haskell.org/package/pcre-light |
83c9e572 | 17 | BuildRequires: ghc >= 6.12.3 |
fb89bcdb JB |
18 | BuildRequires: ghc-base >= 3 |
19 | BuildRequires: ghc-base <= 5 | |
20 | BuildRequires: ghc-bytestring >= 0.9 | |
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-bytestring-prof >= 0.9 | |
26 | %endif | |
83c9e572 ER |
27 | BuildRequires: pcre-devel |
28 | BuildRequires: rpmbuild(macros) >= 1.608 | |
4f16d537 | 29 | Requires(post,postun): /usr/bin/ghc-pkg |
ac0421d1 | 30 | %requires_eq ghc |
fb89bcdb JB |
31 | Requires: ghc-base >= 3 |
32 | Requires: ghc-base <= 5 | |
33 | Requires: ghc-bytestring >= 0.9 | |
83c9e572 ER |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
36 | # debuginfo is not useful for ghc | |
37 | %define _enable_debug_packages 0 | |
38 | ||
fb89bcdb JB |
39 | # don't compress haddock files |
40 | %define _noautocompressdoc *.haddock | |
41 | ||
83c9e572 ER |
42 | %description |
43 | A small, efficient and portable regex library for Perl 5 compatible | |
fb89bcdb JB |
44 | regular expressions. |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Mała, wydajna i przenośna biblioteka wyrażeń regularnych zgodnych z | |
48 | Perlem 5. | |
49 | ||
50 | %package prof | |
51 | Summary: Profiling %{pkgname} library for GHC | |
52 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
53 | Group: Development/Libraries | |
54 | Requires: %{name} = %{version}-%{release} | |
55 | Requires: ghc-base-prof >= 3 | |
56 | Requires: ghc-base-prof <= 5 | |
57 | Requires: ghc-bytestring-prof >= 0.9 | |
58 | ||
59 | %description prof | |
4f16d537 JB |
60 | Profiling %{pkgname} library for GHC. Should be installed when GHC's |
61 | profiling subsystem is needed. | |
fb89bcdb JB |
62 | |
63 | %description prof -l pl.UTF-8 | |
64 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
65 | kiedy potrzebujemy systemu profilującego z GHC. | |
83c9e572 ER |
66 | |
67 | %package doc | |
fb89bcdb JB |
68 | Summary: HTML documentation for ghc %{pkgname} package |
69 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla pakietu ghc %{pkgname} | |
83c9e572 ER |
70 | Group: Documentation |
71 | ||
72 | %description doc | |
fb89bcdb | 73 | HTML documentation for ghc %{pkgname} package. |
83c9e572 ER |
74 | |
75 | %description doc -l pl.UTF-8 | |
fb89bcdb | 76 | Dokumentacja w formacie HTML dla pakietu ghc %{pkgname}. |
83c9e572 ER |
77 | |
78 | %prep | |
79 | %setup -q -n %{pkgname}-%{version} | |
80 | ||
81 | %build | |
82 | runhaskell Setup.lhs configure -v2 \ | |
fb89bcdb | 83 | %{?with_prof:--enable-library-profiling} \ |
83c9e572 ER |
84 | --prefix=%{_prefix} \ |
85 | --libdir=%{_libdir} \ | |
86 | --libexecdir=%{_libexecdir} \ | |
87 | --docdir=%{_docdir}/%{name}-%{version} | |
88 | ||
89 | runhaskell Setup.lhs build | |
90 | runhaskell Setup.lhs haddock --executables | |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
95 | ||
96 | runhaskell Setup.lhs copy --destdir=$RPM_BUILD_ROOT | |
97 | ||
98 | # work around automatic haddock docs installation | |
82247dfd | 99 | %{__rm} -rf %{name}-%{version}-doc |
83c9e572 | 100 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html %{name}-%{version}-doc |
cf7e5c58 | 101 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
83c9e572 ER |
102 | |
103 | runhaskell Setup.lhs register \ | |
fb89bcdb | 104 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf |
83c9e572 ER |
105 | |
106 | %clean | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
109 | %post | |
110 | %ghc_pkg_recache | |
111 | ||
112 | %postun | |
113 | %ghc_pkg_recache | |
114 | ||
115 | %files | |
116 | %defattr(644,root,root,755) | |
117 | %doc LICENSE TODO | |
118 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
fb89bcdb JB |
119 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} |
120 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/HSpcre-light-%{version}.o | |
121 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSpcre-light-%{version}.a | |
122 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text | |
123 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Regex | |
124 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Regex/PCRE | |
125 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Regex/PCRE/Light.hi | |
126 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Regex/PCRE/Light | |
127 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Regex/PCRE/Light/*.hi | |
128 | ||
129 | %if %{with prof} | |
130 | %files prof | |
131 | %defattr(644,root,root,755) | |
132 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSpcre-light-%{version}_p.a | |
133 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Regex/PCRE/Light.p_hi | |
134 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/Regex/PCRE/Light/*.p_hi | |
135 | %endif | |
83c9e572 ER |
136 | |
137 | %files doc | |
138 | %defattr(644,root,root,755) | |
139 | %doc %{name}-%{version}-doc/* |