]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname PACKAGE_NAME | |
6 | Summary: - | |
7 | Name: ghc-%{pkgname} | |
8 | Version: - | |
9 | Release: 0.1 | |
10 | License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here) | |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/PACKAGE_NAME | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
14 | # Source0-md5: - | |
15 | URL: http://hackage.haskell.org/package/PACKAGE_NAME | |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | #BuildRequires: ghc-OTHERMODULE | |
18 | %if %{with prof} | |
19 | BuildRequires: ghc-prof | |
20 | #BuildRequires: ghc-OTHERMODULE-prof | |
21 | %endif | |
22 | BuildRequires: rpmbuild(macros) >= 1.608 | |
23 | %requires_releq ghc | |
24 | Requires(post,postun): /usr/bin/ghc-pkg | |
25 | #Requires: ghc-OTHERMODULE | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | # debuginfo is not useful for ghc | |
29 | %define _enable_debug_packages 0 | |
30 | ||
31 | # don't compress haddock files | |
32 | %define _noautocompressdoc *.haddock | |
33 | ||
34 | %description | |
35 | ||
36 | %package prof | |
37 | Summary: Profiling %{pkgname} library for GHC | |
38 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC. | |
39 | Group: Development/Libraries | |
40 | Requires: %{name} = %{version}-%{release} | |
41 | #Requires: ghc-OTHERMODULE-prof | |
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 | ||
51 | %prep | |
52 | %setup -q -n %{pkgname}-%{version} | |
53 | ||
54 | %build | |
55 | runhaskell Setup.lhs configure -v2 \ | |
56 | %{?with_prof:--enable-library-profiling} \ | |
57 | --prefix=%{_prefix} \ | |
58 | --libdir=%{_libdir} \ | |
59 | --libexecdir=%{_libexecdir} \ | |
60 | --docdir=%{_docdir}/%{name}-%{version} | |
61 | ||
62 | runhaskell Setup.lhs build | |
63 | runhaskell Setup.lhs haddock --executables | |
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
68 | ||
69 | runhaskell Setup.lhs copy --destdir=$RPM_BUILD_ROOT | |
70 | ||
71 | # work around automatic haddock docs installation | |
72 | %{__rm} -rf %{name}-%{version}-doc | |
73 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
74 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
75 | ||
76 | runhaskell Setup.lhs register \ | |
77 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
78 | ||
79 | %clean | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %post | |
83 | %ghc_pkg_recache | |
84 | ||
85 | %postun | |
86 | %ghc_pkg_recache | |
87 | ||
88 | %files | |
89 | %defattr(644,root,root,755) | |
90 | %doc NEWS %{name}-%{version}-doc/* | |
91 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
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 | ||
100 | %if %{with prof} | |
101 | %files prof | |
102 | %defattr(644,root,root,755) | |
103 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/*_p.a | |
104 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/PACKAGE/*.p_hi | |
105 | %endif |