]>
Commit | Line | Data |
---|---|---|
3ce3459f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
b23725ea | 5 | %define pkgname cpphs |
1badba1d | 6 | Summary: A liberalised re-implementation of cpp, the C pre-processor |
3ce3459f | 7 | Summary(pl.UTF-8): Swobodniejsza reimplementacja cpp (preprocesora C) |
13404ae7 | 8 | Name: cpphs |
3ce3459f | 9 | Version: 1.17.1 |
2460f3a8 | 10 | Release: 1 |
13404ae7 JR |
11 | License: LGPL |
12 | Group: Development/Languages | |
3ce3459f JB |
13 | #Source0Download: http://hackage.haskell.org/package/cpphs |
14 | Source0: http://hackage.haskell.org/package/cpphs-%{version}/%{name}-%{version}.tar.gz | |
15 | # Source0-md5: ef8982c386255b7b485110027690717c | |
13404ae7 JR |
16 | URL: http://haskell.org/cpphs/ |
17 | BuildRequires: ghc >= 6.12.3 | |
3ce3459f JB |
18 | BuildRequires: ghc-base >= 3 |
19 | BuildRequires: ghc-base < 6 | |
20 | BuildRequires: ghc-directory | |
21 | BuildRequires: ghc-old-locale | |
22 | BuildRequires: ghc-old-time | |
23 | %if %{with prof} | |
24 | BuildRequires: ghc-prof >= 6.12.3 | |
25 | BuildRequires: ghc-base-prof >= 3 | |
26 | BuildRequires: ghc-base-prof < 6 | |
27 | BuildRequires: ghc-directory-prof | |
28 | BuildRequires: ghc-old-locale-prof | |
29 | BuildRequires: ghc-old-time-prof | |
30 | %endif | |
a5caf914 | 31 | BuildRequires: rpmbuild(macros) >= 1.608 |
3ce3459f | 32 | Requires(post,postun): /usr/bin/ghc-pkg |
a5caf914 | 33 | %requires_eq ghc |
3ce3459f JB |
34 | Requires: ghc-base >= 3 |
35 | Requires: ghc-base < 6 | |
36 | Requires: ghc-directory | |
37 | Requires: ghc-old-locale | |
38 | Requires: ghc-old-time | |
4f7e6876 | 39 | Obsoletes: cpphs-doc |
13404ae7 JR |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
a5caf914 ER |
42 | # debuginfo is not useful for ghc |
43 | %define _enable_debug_packages 0 | |
13404ae7 | 44 | |
3ce3459f | 45 | # don't compress haddock files |
4f7e6876 JR |
46 | %define _noautocompressdoc *.haddock |
47 | ||
13404ae7 | 48 | %description |
a5caf914 ER |
49 | Cpphs is a re-implementation of the C pre-processor that is both more |
50 | compatible with Haskell, and itself written in Haskell so that it can | |
51 | be distributed with compilers. | |
1badba1d | 52 | |
a5caf914 ER |
53 | This version of the C pre-processor is pretty-much feature-complete |
54 | and compatible with traditional (K&R) pre-processors. Additional | |
55 | features include: a plain-text mode; an option to unlit literate code | |
56 | files; and an option to turn off macro-expansion. | |
57 | ||
3ce3459f JB |
58 | %description -l pl.UTF-8 |
59 | Cpphs to reimplementacja preprocesora C, która jest bardziej zgodna z | |
60 | Haskellem, a jednocześnie sama napisana w Haskellu, więc może być | |
61 | rozprowadzania z kompilatorami. | |
62 | ||
63 | Ta wersja preprocesora C jest w większości kompletna pod względem | |
64 | funkcjonalności i zgodna z tradycyjnymi preprocesorami (K&R). | |
65 | Dodatkowe funkcje obejmują m.in.: tryb zwykłego tekstu, opcję do | |
66 | wyłączania rozwijania makr. | |
67 | ||
160cb52d JR |
68 | %package prof |
69 | Summary: Profiling cpphs library for GHC | |
3ce3459f | 70 | Summary(pl.UTF-8): Biblioteka profilująca cpphs dla GHC |
160cb52d JR |
71 | Group: Development/Libraries |
72 | Requires: %{name} = %{version}-%{release} | |
3ce3459f JB |
73 | Requires: ghc-base-prof >= 3 |
74 | Requires: ghc-base-prof < 6 | |
75 | Requires: ghc-directory-prof | |
76 | Requires: ghc-old-locale-prof | |
77 | Requires: ghc-old-time-prof | |
160cb52d JR |
78 | |
79 | %description prof | |
3ce3459f JB |
80 | Profiling cpphs library for GHC. Should be installed when GHC's |
81 | profiling subsystem is needed. | |
160cb52d JR |
82 | |
83 | %description prof -l pl.UTF-8 | |
84 | Biblioteka profilująca cpphs dla GHC. Powinna być zainstalowana | |
85 | kiedy potrzebujemy systemu profilującego z GHC. | |
86 | ||
13404ae7 JR |
87 | %prep |
88 | %setup -q | |
89 | ||
90 | %build | |
3ce3459f JB |
91 | runhaskell Setup.hs configure -v2 \ |
92 | %{?with_prof:--enable-library-profiling} \ | |
13404ae7 JR |
93 | --prefix=%{_prefix} \ |
94 | --libdir=%{_libdir} \ | |
95 | --libexecdir=%{_libexecdir} \ | |
96 | --docdir=%{_docdir}/%{name}-%{version} | |
97 | ||
98 | runhaskell Setup.hs build | |
99 | runhaskell Setup.hs haddock --executables | |
100 | ||
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
104 | ||
105 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
106 | ||
107 | # work around automatic haddock docs installation | |
2460f3a8 | 108 | %{__rm} -rf %{name}-%{version}-doc |
4f7e6876 | 109 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc |
2460f3a8 | 110 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
13404ae7 JR |
111 | |
112 | runhaskell Setup.hs register \ | |
3ce3459f | 113 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{name}.conf |
13404ae7 JR |
114 | |
115 | %clean | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %post | |
a5caf914 | 119 | %ghc_pkg_recache |
13404ae7 JR |
120 | |
121 | %postun | |
a5caf914 | 122 | %ghc_pkg_recache |
13404ae7 JR |
123 | |
124 | %files | |
125 | %defattr(644,root,root,755) | |
4f7e6876 | 126 | %doc %{name}-%{version}-doc/* |
e389f860 | 127 | %attr(755,root,root) %{_bindir}/cpphs |
1badba1d | 128 | %{_libdir}/%{ghcdir}/package.conf.d/%{name}.conf |
160cb52d JR |
129 | |
130 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
3ce3459f JB |
131 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/HScpphs-%{version}.o |
132 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHScpphs-%{version}.a | |
160cb52d JR |
133 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Language |
134 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Language/Preprocessor | |
3ce3459f | 135 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Language/Preprocessor/*.hi |
160cb52d | 136 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Language/Preprocessor/Cpphs |
3ce3459f | 137 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Language/Preprocessor/Cpphs/*.hi |
160cb52d JR |
138 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text |
139 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators | |
160cb52d JR |
140 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/*.hi |
141 | ||
142 | %files prof | |
143 | %defattr(644,root,root,755) | |
3ce3459f | 144 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHScpphs-%{version}_p.a |
160cb52d JR |
145 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Language/Preprocessor/*.p_hi |
146 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Language/Preprocessor/Cpphs/*.p_hi | |
147 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/ParserCombinators/*.p_hi |