]>
Commit | Line | Data |
---|---|---|
8fb372cf JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without prof # profiling library | |
4 | # | |
5 | %define pkgname cmdargs | |
6 | Summary: Command line argument processing | |
7 | Name: ghc-%{pkgname} | |
5e0de2f5 | 8 | Version: 0.10.20 |
475fc579 | 9 | Release: 2 |
8fb372cf JP |
10 | License: BSD |
11 | Group: Development/Languages | |
12 | #Source0Download: http://hackage.haskell.org/package/cmdargs | |
13 | Source0: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz | |
5e0de2f5 | 14 | # Source0-md5: 744e15b86ef774ed06af4e37a565f36b |
8fb372cf JP |
15 | URL: http://hackage.haskell.org/package/cmdargs |
16 | BuildRequires: ghc >= 6.12.3 | |
17 | BuildRequires: ghc-base >= 4.4 | |
18 | BuildRequires: ghc-base < 5 | |
19 | BuildRequires: ghc-filepath | |
20 | BuildRequires: ghc-process >= 1.0 | |
21 | BuildRequires: ghc-transformers >= 0.2 | |
22 | %if %{with prof} | |
23 | BuildRequires: ghc-prof >= 6.12.3 | |
24 | BuildRequires: ghc-base-prof >= 4.4 | |
25 | BuildRequires: ghc-base-prof < 5 | |
26 | BuildRequires: ghc-filepath-prof | |
27 | BuildRequires: ghc-process-prof >= 1.0 | |
28 | BuildRequires: ghc-transformers-prof >= 0.2 | |
29 | %endif | |
30 | BuildRequires: rpmbuild(macros) >= 1.608 | |
31 | Requires(post,postun): /usr/bin/ghc-pkg | |
32 | %requires_eq ghc | |
33 | Requires: ghc-base >= 4.4 | |
34 | Requires: ghc-base < 5 | |
35 | Requires: ghc-filepath | |
36 | Requires: ghc-process >= 1.0 | |
37 | Requires: ghc-transformers >= 0.2 | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | # debuginfo is not useful for ghc | |
41 | %define _enable_debug_packages 0 | |
42 | ||
43 | # don't compress haddock files | |
44 | %define _noautocompressdoc *.haddock | |
45 | ||
46 | %description | |
47 | This library provides an easy way to define command line parsers. | |
48 | ||
49 | %package prof | |
50 | Summary: Profiling %{pkgname} library for GHC | |
51 | Summary(pl.UTF-8): Biblioteka profilująca %{pkgname} dla GHC | |
52 | Group: Development/Libraries | |
53 | Requires: %{name} = %{version}-%{release} | |
54 | Requires: ghc-base-prof >= 4.4 | |
55 | Requires: ghc-base-prof < 5 | |
56 | Requires: ghc-filepath-prof | |
57 | Requires: ghc-process-prof >= 1.0 | |
58 | Requires: ghc-transformers-prof >= 0.2 | |
59 | ||
60 | %description prof | |
61 | Profiling %{pkgname} library for GHC. Should be installed when | |
62 | GHC's profiling subsystem is needed. | |
63 | ||
64 | %description prof -l pl.UTF-8 | |
65 | Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana | |
66 | kiedy potrzebujemy systemu profilującego z GHC. | |
67 | ||
68 | %prep | |
69 | %setup -q -n %{pkgname}-%{version} | |
70 | ||
71 | %build | |
72 | runhaskell Setup.hs configure -v2 \ | |
73 | %{?with_prof:--enable-library-profiling} \ | |
74 | --prefix=%{_prefix} \ | |
75 | --libdir=%{_libdir} \ | |
76 | --libexecdir=%{_libexecdir} \ | |
77 | --docdir=%{_docdir}/%{name}-%{version} | |
78 | ||
79 | runhaskell Setup.hs build | |
80 | runhaskell Setup.hs haddock --executables | |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d | |
85 | ||
86 | runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT | |
87 | ||
88 | # work around automatic haddock docs installation | |
89 | %{__rm} -rf %{name}-%{version}-doc | |
90 | cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc | |
91 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} | |
92 | ||
93 | runhaskell Setup.hs register \ | |
94 | --gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %post | |
100 | %ghc_pkg_recache | |
101 | ||
102 | %postun | |
103 | %ghc_pkg_recache | |
104 | ||
105 | %files | |
106 | %defattr(644,root,root,755) | |
107 | %doc %{name}-%{version}-doc/* | |
108 | %{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf | |
109 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version} | |
5e0de2f5 JR |
110 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHScmdargs-%{version}-*.so |
111 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHScmdargs-%{version}-*.a | |
112 | %exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHScmdargs-%{version}-*_p.a | |
8fb372cf JP |
113 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data |
114 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics | |
115 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics/*.hi | |
5e0de2f5 | 116 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics/*.dyn_hi |
8fb372cf JP |
117 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics/Any |
118 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics/Any/*.hi | |
5e0de2f5 | 119 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics/Any/*.dyn_hi |
8fb372cf JP |
120 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System |
121 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console | |
122 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/*.hi | |
5e0de2f5 | 123 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/*.dyn_hi |
8fb372cf JP |
124 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs |
125 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/*.hi | |
5e0de2f5 | 126 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/*.dyn_hi |
8fb372cf JP |
127 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Implicit |
128 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Implicit/*.hi | |
5e0de2f5 | 129 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Implicit/*.dyn_hi |
8fb372cf JP |
130 | %dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Explicit |
131 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Explicit/*.hi | |
5e0de2f5 | 132 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Explicit/*.dyn_hi |
8fb372cf JP |
133 | |
134 | %if %{with prof} | |
135 | %files prof | |
136 | %defattr(644,root,root,755) | |
5e0de2f5 | 137 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHScmdargs-%{version}-*_p.a |
8fb372cf JP |
138 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics/*.p_hi |
139 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Generics/Any/*.p_hi | |
140 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/*.p_hi | |
141 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/*.p_hi | |
142 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Implicit/*.p_hi | |
143 | %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/System/Console/CmdArgs/Explicit/*.p_hi | |
144 | %endif |