]>
Commit | Line | Data |
---|---|---|
08f497c2 JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname doctemplates | |
6 | Summary: Pandoc-style document templates | |
7 | Name: ghc-%{pkgname} | |
8 | Version: 0.8.2 | |
4b7ea02c | 9 | Release: 2 |
08f497c2 JR |
10 | License: BSD |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/doctemplates | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
14 | # Source0-md5: 84be788ba38ad7983076fe698260e028 | |
15 | URL: http://hackage.haskell.org/package/doctemplates | |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | BuildRequires: ghc-aeson | |
18 | BuildRequires: ghc-doclayout | |
19 | BuildRequires: ghc-HsYAML | |
20 | BuildRequires: ghc-scientific | |
21 | BuildRequires: ghc-semigroups | |
22 | BuildRequires: ghc-text-conversions | |
23 | BuildRequires: ghc-unordered-containers | |
24 | BuildRequires: ghc-vector | |
25 | %if %{with prof} | |
26 | BuildRequires: ghc-prof | |
27 | BuildRequires: ghc-aeson-prof | |
28 | BuildRequires: ghc-doclayout-prof | |
29 | BuildRequires: ghc-HsYAML-prof | |
30 | BuildRequires: ghc-scientific-prof | |
31 | BuildRequires: ghc-semigroups-prof | |
32 | BuildRequires: ghc-text-conversions-prof | |
33 | BuildRequires: ghc-unordered-containers-prof | |
34 | BuildRequires: ghc-vector-prof | |
35 | %endif | |
36 | BuildRequires: rpmbuild(macros) >= 1.608 | |
37 | %requires_eq ghc | |
38 | Requires: ghc-aeson | |
39 | Requires: ghc-doclayout | |
40 | Requires: ghc-HsYAML | |
41 | Requires: ghc-scientific | |
42 | Requires: ghc-semigroups | |
43 | Requires: ghc-text-conversions | |
44 | Requires: ghc-unordered-containers | |
45 | Requires: ghc-vector | |
46 | Requires(post,postun): /usr/bin/ghc-pkg | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | # debuginfo is not useful for ghc | |
50 | %define _enable_debug_packages 0 | |
51 | ||
52 | # don't compress haddock files | |
53 | %define _noautocompressdoc *.haddock | |
54 | ||
55 | %description | |
56 | This is the text templating system used by pandoc. It supports | |
57 | variable interpolation, iteration, tests for non-blank values, pipes, | |
58 | and partials. Templates are rendered to doclayout Docs, and variable | |
59 | values may come from a variety of different sources, including aeson | |
60 | Values. | |
61 | ||
62 | %package prof | |
63 | Summary: Profiling %{pkgname} library for GHC | |
64 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
65 | Group: Development/Libraries | |
66 | Requires: %{name} = %{version}-%{release} | |
67 | Requires: ghc-prof | |
68 | Requires: ghc-aeson-prof | |
69 | Requires: ghc-doclayout-prof | |
70 | Requires: ghc-HsYAML-prof | |
71 | Requires: ghc-scientific-prof | |
72 | Requires: ghc-semigroups-prof | |
73 | Requires: ghc-text-conversions-prof | |
74 | Requires: ghc-unordered-containers-prof | |
75 | Requires: ghc-vector-prof | |
76 | ||
77 | %description prof | |
78 | Profiling %{pkgname} library for GHC. Should be installed when | |
79 | GHC's profiling subsystem is needed. | |
80 | ||
81 | %description prof -l pl.UTF-8 | |
82 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
83 | kiedy potrzebujemy systemu profilującego z GHC. | |
84 | ||
85 | %prep | |
86 | %setup -q -n %{pkgname}-%{version} | |
87 | ||
88 | %build | |
89 | runhaskell Setup.hs configure -v2 \ | |
90 | %{?with_prof:--enable-library-profiling} \ | |
91 | --prefix=%{_prefix} \ | |
92 | --libdir=%{_libdir} \ | |
93 | --libexecdir=%{_libexecdir} \ | |
94 | --docdir=%{_docdir}/%{name}-%{version} | |
95 | ||
96 | runhaskell Setup.hs build | |
97 | runhaskell Setup.hs haddock --executables | |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
102 | ||
103 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
104 | ||
105 | # work around automatic haddock docs installation | |
106 | %{__rm} -rf %{name}-%{version}-doc | |
107 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
108 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
109 | ||
110 | runhaskell Setup.hs register \ | |
111 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
112 | ||
113 | %clean | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
116 | %post | |
117 | %ghc_pkg_recache | |
118 | ||
119 | %postun | |
120 | %ghc_pkg_recache | |
121 | ||
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc README.md changelog.md %{name}-%{version}-doc/* | |
125 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
126 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
127 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so | |
128 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a | |
129 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
130 | ||
131 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text | |
132 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.hi | |
133 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.dyn_hi | |
134 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/DocTemplates | |
135 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/DocTemplates/*.hi | |
136 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/DocTemplates/*.dyn_hi | |
137 | ||
138 | %if %{with prof} | |
139 | %files prof | |
140 | %defattr(644,root,root,755) | |
141 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
142 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.p_hi | |
143 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/DocTemplates/*.p_hi | |
144 | %endif |