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