]>
Commit | Line | Data |
---|---|---|
23b1b5d2 JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname haddock-library | |
6 | Summary: Library exposing some functionality of Haddock | |
7 | Name: ghc-%{pkgname} | |
8 | Version: 1.9.0 | |
8bcb4444 | 9 | Release: 2 |
23b1b5d2 JR |
10 | License: BSD-like |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/haddock-library | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
14 | # Source0-md5: 27cbfc7dbd7f4294cee44c876bbc57f9 | |
15 | URL: http://hackage.haskell.org/package/haddock-library | |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | %if %{with prof} | |
18 | BuildRequires: ghc-prof | |
19 | %endif | |
20 | BuildRequires: rpmbuild(macros) >= 1.608 | |
21 | %requires_eq ghc | |
22 | Requires(post,postun): /usr/bin/ghc-pkg | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | # debuginfo is not useful for ghc | |
26 | %define _enable_debug_packages 0 | |
27 | ||
28 | # don't compress haddock files | |
29 | %define _noautocompressdoc *.haddock | |
30 | ||
31 | %description | |
32 | Haddock is a documentation-generation tool for Haskell libraries. | |
33 | These modules expose some functionality of it without pulling in the | |
34 | GHC dependency. Please note that the API is likely to change so be | |
35 | sure to specify upper bounds in your projects. For interacting with | |
36 | Haddock itself, see the haddock package. | |
37 | ||
38 | %package prof | |
39 | Summary: Profiling %{pkgname} library for GHC | |
40 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
41 | Group: Development/Libraries | |
42 | Requires: %{name} = %{version}-%{release} | |
43 | ||
44 | %description prof | |
45 | Profiling %{pkgname} library for GHC. Should be installed when | |
46 | GHC's profiling subsystem is needed. | |
47 | ||
48 | %description prof -l pl.UTF-8 | |
49 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
50 | kiedy potrzebujemy systemu profilującego z GHC. | |
51 | ||
52 | %prep | |
53 | %setup -q -n %{pkgname}-%{version} | |
54 | ||
55 | %build | |
56 | runhaskell Setup.hs configure -v2 \ | |
57 | %{?with_prof:--enable-library-profiling} \ | |
58 | --prefix=%{_prefix} \ | |
59 | --libdir=%{_libdir} \ | |
60 | --libexecdir=%{_libexecdir} \ | |
61 | --docdir=%{_docdir}/%{name}-%{version} | |
62 | ||
63 | runhaskell Setup.hs build | |
64 | runhaskell Setup.hs haddock --executables | |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
69 | ||
70 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
71 | ||
72 | # work around automatic haddock docs installation | |
73 | %{__rm} -rf %{name}-%{version}-doc | |
74 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
75 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
76 | ||
77 | runhaskell Setup.hs register \ | |
78 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %post | |
84 | %ghc_pkg_recache | |
85 | ||
86 | %postun | |
87 | %ghc_pkg_recache | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc CHANGES.md %{name}-%{version}-doc/* | |
92 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
93 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
94 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.so | |
95 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a | |
96 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
97 | ||
98 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.hi | |
99 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.dyn_hi | |
100 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/ | |
101 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock | |
102 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock/*.hi | |
103 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock/*.dyn_hi | |
104 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock/Parser | |
105 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock/Parser/*.hi | |
106 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock/Parser/*.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}/*.p_hi | |
113 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock/*.p_hi | |
114 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Documentation/Haddock/Parser/*.p_hi | |
115 | %endif |