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