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