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