]>
Commit | Line | Data |
---|---|---|
da151a3e JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
c21b0a6d | 5 | %define pkgname PACKAGE_NAME |
8b1e5bb7 JR |
6 | Summary: - |
7 | Name: ghc-%{pkgname} | |
8 | Version: - | |
33f247fc | 9 | Release: 0.1 |
8b1e5bb7 | 10 | License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here) |
33f247fc | 11 | Group: Development/Languages |
da151a3e JB |
12 | #Source0Download: http://hackage.haskell.org/package/PACKAGE_NAME |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
33f247fc | 14 | # Source0-md5: - |
da151a3e | 15 | URL: http://hackage.haskell.org/package/PACKAGE_NAME |
4cc44b9e | 16 | BuildRequires: ghc >= 6.12.3 |
3454a91a | 17 | #BuildRequires: ghc-OTHERMODULE |
da151a3e JB |
18 | %if %{with prof} |
19 | BuildRequires: ghc-prof | |
20 | #BuildRequires: ghc-OTHERMODULE-prof | |
1239e613 | 21 | BuildRequires: rpmbuild(macros) >= 1.608 |
175c26ee | 22 | %requires_releq ghc |
3ea9522f | 23 | Requires(post,postun): /usr/bin/ghc-pkg |
cbca2db5 | 24 | #Requires: ghc-OTHERMODULE |
33f247fc JR |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
da37dde1 ER |
27 | # debuginfo is not useful for ghc |
28 | %define _enable_debug_packages 0 | |
29 | ||
da151a3e | 30 | # don't compress haddock files |
d2d5700e JR |
31 | %define _noautocompressdoc *.haddock |
32 | ||
33f247fc JR |
33 | %description |
34 | ||
bcbb32c6 JR |
35 | %package prof |
36 | Summary: Profiling %{pkgname} library for GHC | |
37 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC. | |
38 | Group: Development/Libraries | |
39 | Requires: %{name} = %{version}-%{release} | |
da151a3e | 40 | #Requires: ghc-OTHERMODULE-prof |
bcbb32c6 JR |
41 | |
42 | %description prof | |
43 | Profiling %{pkgname} library for GHC. Should be installed when | |
44 | GHC's profiling subsystem is needed. | |
45 | ||
46 | %description prof -l pl.UTF-8 | |
47 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
48 | kiedy potrzebujemy systemu profilującego z GHC. | |
49 | ||
33f247fc JR |
50 | %prep |
51 | %setup -q -n %{pkgname}-%{version} | |
52 | ||
53 | %build | |
da151a3e JB |
54 | runhaskell Setup.lhs configure -v2 \ |
55 | %{?with_prof:--enable-library-profiling} \ | |
33f247fc JR |
56 | --prefix=%{_prefix} \ |
57 | --libdir=%{_libdir} \ | |
58 | --libexecdir=%{_libexecdir} \ | |
78afb22b | 59 | --docdir=%{_docdir}/%{name}-%{version} |
33f247fc | 60 | |
e6e67c39 JR |
61 | runhaskell Setup.lhs build |
62 | runhaskell Setup.lhs haddock --executables | |
33f247fc JR |
63 | |
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
4cc44b9e JR |
66 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d |
67 | ||
e6e67c39 | 68 | runhaskell Setup.lhs copy --destdir=$RPM_BUILD_ROOT |
33f247fc | 69 | |
41e08a97 | 70 | # work around automatic haddock docs installation |
e9a2fb6c | 71 | %{__rm} -rf %{name}-%{version}-doc |
d2d5700e | 72 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc |
e9a2fb6c | 73 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
41e08a97 | 74 | |
e6e67c39 | 75 | runhaskell Setup.lhs register \ |
da151a3e | 76 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf |
33f247fc JR |
77 | |
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %post | |
1239e613 | 82 | %ghc_pkg_recache |
33f247fc JR |
83 | |
84 | %postun | |
1239e613 | 85 | %ghc_pkg_recache |
33f247fc JR |
86 | |
87 | %files | |
88 | %defattr(644,root,root,755) | |
da151a3e | 89 | %doc NEWS %{name}-%{version}-doc/* |
4cc44b9e | 90 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf |
bcbb32c6 JR |
91 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} |
92 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.o | |
93 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*.a | |
94 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
95 | ||
96 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/PACKAGE | |
97 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/PACKAGE/*.hi | |
98 | ||
da151a3e | 99 | %if %{with prof} |
bcbb32c6 JR |
100 | %files prof |
101 | %defattr(644,root,root,755) | |
102 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
103 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/PACKAGE/*.p_hi | |
da151a3e | 104 | %endif |