]>
Commit | Line | Data |
---|---|---|
1 | # TODO: fix sphinx docs build (sphinx-build hangs?) | |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_with apidocs # Sphinx based HTML documentation [hangs, FIXME] | |
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 | %bcond_with openssl # OpenSSL provider | |
11 | ||
12 | %if %{without python} | |
13 | %undefine with_python2 | |
14 | %undefine with_python3 | |
15 | %endif | |
16 | Summary: Crypto library written in C++ | |
17 | Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++ | |
18 | Name: botan2 | |
19 | Version: 2.18.1 | |
20 | Release: 1 | |
21 | License: BSD | |
22 | Group: Libraries | |
23 | Source0: https://botan.randombit.net/releases/Botan-%{version}.tar.xz | |
24 | # Source0-md5: 77c558179f276273e0bf39ef941d36c5 | |
25 | URL: https://botan.randombit.net/ | |
26 | BuildRequires: bzip2-devel | |
27 | BuildRequires: libstdc++-devel | |
28 | %{?with_openssl:BuildRequires: openssl-devel} | |
29 | BuildRequires: python >= 1:2.7 | |
30 | BuildRequires: rpm-pythonprov | |
31 | BuildRequires: rpmbuild(macros) >= 1.714 | |
32 | %{?with_apidocs:BuildRequires: sphinx-pdg} | |
33 | BuildRequires: zlib-devel | |
34 | %if %{with python2} | |
35 | BuildRequires: python-devel >= 1:2.7 | |
36 | %endif | |
37 | %if %{with python3} | |
38 | BuildRequires: python3-devel >= 1:3.4 | |
39 | %endif | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | Botan is a BSD-licensed crypto library written in C++. It provides a | |
44 | wide variety of basic cryptographic algorithms, X.509 certificates and | |
45 | CRLs, PKCS#10 certificate requests, a filter/pipe message processing | |
46 | system, and a wide variety of other features, all written in portable | |
47 | C++. The API reference, tutorial, and examples may help impart the | |
48 | flavor of the library. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++. | |
52 | Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty | |
53 | X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania | |
54 | komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko | |
55 | napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API, | |
56 | wprowadzenie oraz przykłady. | |
57 | ||
58 | %package devel | |
59 | Summary: Header files for Botan library | |
60 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan | |
61 | Group: Development/Libraries | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | Requires: bzip2-devel | |
64 | Requires: gmp-devel | |
65 | %{?with_openssl:Requires: openssl-devel} | |
66 | Requires: zlib-devel | |
67 | ||
68 | %description devel | |
69 | This package contains the header files for developing applications | |
70 | that use Botan. | |
71 | ||
72 | %description devel -l pl.UTF-8 | |
73 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
74 | wykorzystujących bibliotekę Botan. | |
75 | ||
76 | %package static | |
77 | Summary: Static Botan library | |
78 | Summary(pl.UTF-8): Statyczna biblioteka Botan | |
79 | Group: Development/Libraries | |
80 | Requires: %{name}-devel = %{version}-%{release} | |
81 | ||
82 | %description static | |
83 | Static Botan library. | |
84 | ||
85 | %description static -l pl.UTF-8 | |
86 | Statyczna biblioteka Botan. | |
87 | ||
88 | %package apidocs | |
89 | Summary: Botan API documentation | |
90 | Summary(pl.UTF-8): Dokumentacja API biblioteki Botan | |
91 | Group: Documentation | |
92 | BuildArch: noarch | |
93 | ||
94 | %description apidocs | |
95 | API and internal documentation for Botan library. | |
96 | ||
97 | %description apidocs -l pl.UTF-8 | |
98 | Dokumentacja API biblioteki Botan. | |
99 | ||
100 | %package -n python-botan | |
101 | Summary: Python 2.x binding for Botan library | |
102 | Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan | |
103 | Group: Libraries/Python | |
104 | Requires: %{name} = %{version}-%{release} | |
105 | ||
106 | %description -n python-botan | |
107 | Python 2.x binding for Botan library. | |
108 | ||
109 | %description -n python-botan -l pl.UTF-8 | |
110 | Wiązanie Pythona 2.x do biblioteki Botan. | |
111 | ||
112 | %package -n python3-botan | |
113 | Summary: Python 3.x binding for Botan library | |
114 | Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan | |
115 | Group: Libraries/Python | |
116 | Requires: %{name} = %{version}-%{release} | |
117 | ||
118 | %description -n python3-botan | |
119 | Python 3.x binding for Botan library. | |
120 | ||
121 | %description -n python3-botan -l pl.UTF-8 | |
122 | Wiązanie Pythona 3.x do biblioteki Botan. | |
123 | ||
124 | %prep | |
125 | %setup -q -n Botan-%{version} | |
126 | ||
127 | # kill shebang, nothing to execute directly | |
128 | %{__sed} -i -e '1d' src/python/botan2.py | |
129 | ||
130 | %build | |
131 | # we have the necessary prerequisites, so enable optional modules | |
132 | %define enable_modules bzip2,lzma,zlib,%{?with_openssl:openssl},sqlite3,tpm,pkcs11 | |
133 | ||
134 | # fixme: maybe disable unix_procs, very slow. | |
135 | %define disable_modules %{nil} | |
136 | ||
137 | ./configure.py \ | |
138 | --prefix=%{_prefix} \ | |
139 | --libdir=%{_lib} \ | |
140 | --cc=gcc \ | |
141 | --os=linux \ | |
142 | --cpu=%{_arch} \ | |
143 | --enable-modules=%{enable_modules} \ | |
144 | --disable-modules=%{disable_modules} \ | |
145 | %if %{with python2} | |
146 | --with-python-version=%{py_ver} \ | |
147 | %endif | |
148 | %{!?with_apidocs:--without-sphinx} | |
149 | ||
150 | # (ab)using CXX as an easy way to inject our CXXFLAGS | |
151 | %{__make} \ | |
152 | CXX="%{__cxx} -pthread" \ | |
153 | CXXFLAGS="%{rpmcxxflags}" | |
154 | ||
155 | %if %{with apidocs} | |
156 | %{__make} docs | |
157 | %endif | |
158 | ||
159 | %if %{with tests} | |
160 | # certstor_system test is trying tp look up expired certs | |
161 | LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system | |
162 | %endif | |
163 | ||
164 | %install | |
165 | rm -rf $RPM_BUILD_ROOT | |
166 | ||
167 | %{__make} install \ | |
168 | INSTALL_CMD_EXEC="install -p -m 755" \ | |
169 | INSTALL_CMD_DATA="install -p -m 644" \ | |
170 | DESTDIR=$RPM_BUILD_ROOT | |
171 | ||
172 | %if %{with python2} | |
173 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
174 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
175 | %py_postclean | |
176 | %endif | |
177 | ||
178 | %if %{with python3} | |
179 | install -d $RPM_BUILD_ROOT%{py3_sitedir} | |
180 | cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir} | |
181 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
182 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
183 | %endif | |
184 | ||
185 | # packaged as %doc | |
186 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version} | |
187 | ||
188 | %if %{with apidocs} | |
189 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
190 | cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
191 | %endif | |
192 | ||
193 | %clean | |
194 | rm -rf $RPM_BUILD_ROOT | |
195 | ||
196 | %post -p /sbin/ldconfig | |
197 | %postun -p /sbin/ldconfig | |
198 | ||
199 | %files | |
200 | %defattr(644,root,root,755) | |
201 | %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,security.rst} | |
202 | %attr(755,root,root) %{_bindir}/botan | |
203 | %attr(755,root,root) %{_libdir}/libbotan-2.so.*.* | |
204 | %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.18 | |
205 | %{_mandir}/man1/botan.1* | |
206 | ||
207 | %files devel | |
208 | %defattr(644,root,root,755) | |
209 | %attr(755,root,root) %{_libdir}/libbotan-2.so | |
210 | %{_includedir}/botan-2 | |
211 | %{_pkgconfigdir}/botan-2.pc | |
212 | ||
213 | %if %{with static_libs} | |
214 | %files static | |
215 | %defattr(644,root,root,755) | |
216 | %{_libdir}/libbotan-2.a | |
217 | %endif | |
218 | ||
219 | %if %{with apidocs} | |
220 | %files apidocs | |
221 | %defattr(644,root,root,755) | |
222 | # FIXME: update path after fixing sphinx build | |
223 | %doc _doc/manual/{_static,*.html,*.js} | |
224 | %{_examplesdir}/%{name}-%{version} | |
225 | %endif | |
226 | ||
227 | %if %{with python2} | |
228 | %files -n python-botan | |
229 | %defattr(644,root,root,755) | |
230 | %{py_sitedir}/botan2.py[co] | |
231 | %endif | |
232 | ||
233 | %if %{with python3} | |
234 | %files -n python3-botan | |
235 | %defattr(644,root,root,755) | |
236 | %{py3_sitedir}/botan2.py | |
237 | %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co] | |
238 | %endif |