]>
Commit | Line | Data |
---|---|---|
296e13ef JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname doclayout | |
6 | Summary: A prettyprinting library for laying out text documents | |
7 | Name: ghc-%{pkgname} | |
8 | Version: 0.3 | |
50acee14 | 9 | Release: 2 |
296e13ef JR |
10 | License: BSD |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/doclayout | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
14 | # Source0-md5: b5ce397205583a70965046864814e9f5 | |
15 | URL: http://hackage.haskell.org/package/doclayout | |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | BuildRequires: ghc-safe | |
18 | BuildRequires: ghc-semigroups | |
19 | %if %{with prof} | |
20 | BuildRequires: ghc-prof | |
21 | BuildRequires: ghc-safe-prof | |
22 | BuildRequires: ghc-semigroups-prof | |
23 | %endif | |
24 | BuildRequires: rpmbuild(macros) >= 1.608 | |
25 | %requires_eq ghc | |
26 | Requires(post,postun): /usr/bin/ghc-pkg | |
27 | Requires: ghc-safe | |
28 | Requires: ghc-semigroups | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | # debuginfo is not useful for ghc | |
32 | %define _enable_debug_packages 0 | |
33 | ||
34 | # don't compress haddock files | |
35 | %define _noautocompressdoc *.haddock | |
36 | ||
37 | %description | |
38 | doclayout is a prettyprinting library for laying out text documents, | |
39 | with several features not present in prettyprinting libraries designed | |
40 | for code. It was designed for use in pandoc. | |
41 | ||
42 | %package prof | |
43 | Summary: Profiling %{pkgname} library for GHC | |
44 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
45 | Group: Development/Libraries | |
46 | Requires: %{name} = %{version}-%{release} | |
47 | Requires: ghc-safe-prof | |
48 | Requires: ghc-semigroups-prof | |
49 | ||
50 | %description prof | |
51 | Profiling %{pkgname} library for GHC. Should be installed when | |
52 | GHC's profiling subsystem is needed. | |
53 | ||
54 | %description prof -l pl.UTF-8 | |
55 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
56 | kiedy potrzebujemy systemu profilującego z GHC. | |
57 | ||
58 | %prep | |
59 | %setup -q -n %{pkgname}-%{version} | |
60 | ||
61 | %build | |
62 | runhaskell Setup.hs configure -v2 \ | |
63 | %{?with_prof:--enable-library-profiling} \ | |
64 | --prefix=%{_prefix} \ | |
65 | --libdir=%{_libdir} \ | |
66 | --libexecdir=%{_libexecdir} \ | |
67 | --docdir=%{_docdir}/%{name}-%{version} | |
68 | ||
69 | runhaskell Setup.hs build | |
70 | runhaskell Setup.hs haddock --executables | |
71 | ||
72 | %install | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
75 | ||
76 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
77 | ||
78 | # work around automatic haddock docs installation | |
79 | %{__rm} -rf %{name}-%{version}-doc | |
80 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
81 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
82 | ||
83 | runhaskell Setup.hs register \ | |
84 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %post | |
90 | %ghc_pkg_recache | |
91 | ||
92 | %postun | |
93 | %ghc_pkg_recache | |
94 | ||
95 | %files | |
96 | %defattr(644,root,root,755) | |
97 | %doc README.md changelog.md %{name}-%{version}-doc/* | |
98 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
99 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
100 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so | |
101 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a | |
102 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
103 | ||
104 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text | |
105 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.hi | |
106 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.dyn_hi | |
107 | ||
108 | %if %{with prof} | |
109 | %files prof | |
110 | %defattr(644,root,root,755) | |
111 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
112 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Text/*.p_hi | |
113 | %endif |