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