]>
Commit | Line | Data |
---|---|---|
1 | # NOTE: for botan 2.x see botan2.spec | |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without apidocs # Sphinx based HTML documentation | |
6 | %bcond_without static_libs # static library | |
7 | %bcond_without python # Python bindings | |
8 | %bcond_without python2 # CPython 2.x binding | |
9 | %bcond_without python3 # CPython 3.x binding | |
10 | ||
11 | %if %{without python} | |
12 | %undefine with_python2 | |
13 | %undefine with_python3 | |
14 | %endif | |
15 | Summary: Crypto library written in C++ | |
16 | Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++ | |
17 | Name: botan | |
18 | Version: 1.10.17 | |
19 | Release: 4 | |
20 | License: BSD | |
21 | Group: Libraries | |
22 | Source0: https://botan.randombit.net/releases/Botan-%{version}.tgz | |
23 | # Source0-md5: e5ed5dc70edd238c5a2116670b2cb3f3 | |
24 | Patch0: %{name}-includes.patch | |
25 | Patch1: %{name}-python.patch | |
26 | URL: https://botan.randombit.net/ | |
27 | BuildRequires: bzip2-devel | |
28 | BuildRequires: gmp-devel | |
29 | BuildRequires: libstdc++-devel | |
30 | BuildRequires: openssl-devel | |
31 | BuildRequires: python >= 1:2.6 | |
32 | BuildRequires: rpm-pythonprov | |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
34 | %{?with_apidocs:BuildRequires: sphinx-pdg} | |
35 | BuildRequires: zlib-devel | |
36 | %if %{with python2} | |
37 | BuildRequires: boost-python-devel | |
38 | BuildRequires: python-devel >= 1:2.6 | |
39 | %endif | |
40 | %if %{with python3} | |
41 | BuildRequires: boost-python3-devel | |
42 | BuildRequires: python3-devel >= 1:3.2 | |
43 | %endif | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | Botan is a BSD-licensed crypto library written in C++. It provides a | |
48 | wide variety of basic cryptographic algorithms, X.509 certificates and | |
49 | CRLs, PKCS#10 certificate requests, a filter/pipe message processing | |
50 | system, and a wide variety of other features, all written in portable | |
51 | C++. The API reference, tutorial, and examples may help impart the | |
52 | flavor of the library. | |
53 | ||
54 | %description -l pl.UTF-8 | |
55 | Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++. | |
56 | Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty | |
57 | X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania | |
58 | komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko | |
59 | napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API, | |
60 | wprowadzenie oraz przykłady. | |
61 | ||
62 | %package devel | |
63 | Summary: Header files for Botan library | |
64 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan | |
65 | Group: Development/Libraries | |
66 | Requires: %{name} = %{version}-%{release} | |
67 | Requires: bzip2-devel | |
68 | Requires: gmp-devel | |
69 | Requires: openssl-devel | |
70 | Requires: zlib-devel | |
71 | ||
72 | %description devel | |
73 | This package contains the header files for developing applications | |
74 | that use Botan. | |
75 | ||
76 | %description devel | |
77 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
78 | wykorzystujących bibliotekę Botan. | |
79 | ||
80 | %package static | |
81 | Summary: Static Botan library | |
82 | Summary(pl.UTF-8): Statyczna biblioteka Botan | |
83 | Group: Development/Libraries | |
84 | Requires: %{name}-devel = %{version}-%{release} | |
85 | ||
86 | %description static | |
87 | Static Botan library. | |
88 | ||
89 | %description static -l pl.UTF-8 | |
90 | Statyczna biblioteka Botan. | |
91 | ||
92 | %package apidocs | |
93 | Summary: Botan API documentation | |
94 | Summary(pl.UTF-8): Dokumentacja API biblioteki Botan | |
95 | Group: Documentation | |
96 | BuildArch: noarch | |
97 | ||
98 | %description apidocs | |
99 | API and internal documentation for Botan library. | |
100 | ||
101 | %description apidocs -l pl.UTF-8 | |
102 | Dokumentacja API biblioteki Botan. | |
103 | ||
104 | %package -n python-botan | |
105 | Summary: Python 2.x binding for Botan library | |
106 | Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan | |
107 | Group: Libraries/Python | |
108 | Requires: %{name} = %{version}-%{release} | |
109 | ||
110 | %description -n python-botan | |
111 | Python 2.x binding for Botan library. | |
112 | ||
113 | %description -n python-botan -l pl.UTF-8 | |
114 | Wiązanie Pythona 2.x do biblioteki Botan. | |
115 | ||
116 | %package -n python3-botan | |
117 | Summary: Python 3.x binding for Botan library | |
118 | Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan | |
119 | Group: Libraries/Python | |
120 | Requires: %{name} = %{version}-%{release} | |
121 | ||
122 | %description -n python3-botan | |
123 | Python 3.x binding for Botan library. | |
124 | ||
125 | %description -n python3-botan -l pl.UTF-8 | |
126 | Wiązanie Pythona 3.x do biblioteki Botan. | |
127 | ||
128 | %prep | |
129 | %setup -q -n Botan-%{version} | |
130 | %patch0 -p1 | |
131 | %patch1 -p1 | |
132 | ||
133 | %build | |
134 | # we have the necessary prerequisites, so enable optional modules | |
135 | %define enable_modules gnump,bzip2,zlib,openssl | |
136 | ||
137 | # fixme: maybe disable unix_procs, very slow. | |
138 | %define disable_modules %{nil} | |
139 | ||
140 | ./configure.py \ | |
141 | --prefix=%{_prefix} \ | |
142 | --libdir=%{_lib} \ | |
143 | --cc=gcc \ | |
144 | --os=linux \ | |
145 | --cpu=%{_target_base_arch} \ | |
146 | --enable-modules=%{enable_modules} \ | |
147 | --disable-modules=%{disable_modules} \ | |
148 | %if %{with python} | |
149 | --with-boost-python \ | |
150 | --with-python-version=x.y \ | |
151 | %endif | |
152 | %{?with_apidocs:--with-sphinx} | |
153 | ||
154 | # (ab)using CXX as an easy way to inject our CXXFLAGS | |
155 | %{__make} \ | |
156 | CXX="%{__cxx} %{rpmcxxflags}" | |
157 | ||
158 | %if %{with apidocs} | |
159 | %{__make} docs | |
160 | %endif | |
161 | ||
162 | %if %{with tests} | |
163 | %{__make} check \ | |
164 | CXX="%{__cxx} %{rpmcxxflags}" | |
165 | ||
166 | LD_LIBRARY_PATH=. ./check --validate | |
167 | %endif | |
168 | ||
169 | %if %{with python2} | |
170 | install -d build/python%{py_ver} | |
171 | %{__make} -f Makefile.python \ | |
172 | CXX="%{__cxx}" \ | |
173 | CFLAGS="%{rpmcxxflags}" \ | |
174 | LDFLAGS="%{rpmldflags}" \ | |
175 | PY_VER=%{py_ver} \ | |
176 | PYTHON_ROOT=%{py_libdir}/config \ | |
177 | PYTHON_INC=-I%{py_incdir} | |
178 | %endif | |
179 | ||
180 | %if %{with python3} | |
181 | install -d build/python%{py3_ver} | |
182 | %{__make} -f Makefile.python \ | |
183 | CXX="%{__cxx}" \ | |
184 | CFLAGS="%{rpmcxxflags}" \ | |
185 | LDFLAGS="%{rpmldflags}" \ | |
186 | BOOST_PYTHON=boost_python3 \ | |
187 | PY_VER=%{py3_ver} \ | |
188 | PYTHON_ROOT=%{py3_libdir}/config \ | |
189 | PYTHON_INC=-I%{py3_incdir} | |
190 | %endif | |
191 | ||
192 | %install | |
193 | rm -rf $RPM_BUILD_ROOT | |
194 | ||
195 | %{__make} install \ | |
196 | INSTALL_CMD_EXEC="install -p -m 755" \ | |
197 | INSTALL_CMD_DATA="install -p -m 644" \ | |
198 | DOCDIR=_doc \ | |
199 | DESTDIR=$RPM_BUILD_ROOT%{_prefix} | |
200 | ||
201 | %if %{with python2} | |
202 | %{__make} -f Makefile.python install \ | |
203 | PY_VER=%{py_ver} \ | |
204 | PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir} | |
205 | ||
206 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
207 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
208 | %py_postclean | |
209 | %endif | |
210 | ||
211 | %if %{with python3} | |
212 | %{__make} -f Makefile.python install \ | |
213 | PY_VER=%{py3_ver} \ | |
214 | PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir} | |
215 | ||
216 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
217 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
218 | %endif | |
219 | ||
220 | %if %{with apidocs} | |
221 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
222 | cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
223 | %endif | |
224 | ||
225 | %clean | |
226 | rm -rf $RPM_BUILD_ROOT | |
227 | ||
228 | %post -p /sbin/ldconfig | |
229 | %postun -p /sbin/ldconfig | |
230 | ||
231 | %files | |
232 | %defattr(644,root,root,755) | |
233 | %doc readme.txt doc/{algos,credits,faq,index,license,log,support,users}.txt | |
234 | %attr(755,root,root) %{_libdir}/libbotan-1.10.so.*.* | |
235 | %attr(755,root,root) %ghost %{_libdir}/libbotan-1.10.so.1 | |
236 | ||
237 | %files devel | |
238 | %defattr(644,root,root,755) | |
239 | %attr(755,root,root) %{_bindir}/botan-config-1.10 | |
240 | %attr(755,root,root) %{_libdir}/libbotan-1.10.so | |
241 | %{_includedir}/botan-1.10 | |
242 | %{_pkgconfigdir}/botan-1.10.pc | |
243 | ||
244 | %if %{with static_libs} | |
245 | %files static | |
246 | %defattr(644,root,root,755) | |
247 | %{_libdir}/libbotan-1.10.a | |
248 | %endif | |
249 | ||
250 | %if %{with apidocs} | |
251 | %files apidocs | |
252 | %defattr(644,root,root,755) | |
253 | %doc _doc/manual/{_static,*.html,*.js} | |
254 | %{_examplesdir}/%{name}-%{version} | |
255 | %endif | |
256 | ||
257 | %if %{with python2} | |
258 | %files -n python-botan | |
259 | %defattr(644,root,root,755) | |
260 | %dir %{py_sitedir}/botan | |
261 | %attr(755,root,root) %{py_sitedir}/botan/_botan.so | |
262 | %{py_sitedir}/botan/__init__.py[co] | |
263 | %endif | |
264 | ||
265 | %if %{with python3} | |
266 | %files -n python3-botan | |
267 | %defattr(644,root,root,755) | |
268 | %dir %{py3_sitedir}/botan | |
269 | %attr(755,root,root) %{py3_sitedir}/botan/_botan.so | |
270 | %{py3_sitedir}/botan/__init__.py | |
271 | %{py3_sitedir}/botan/__pycache__ | |
272 | %endif |