]>
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 |
9fb57b57 | 19 | Version: 2.19.1 |
9e54d994 | 20 | Release: 4 |
7f5657d3 ER |
21 | License: BSD |
22 | Group: Libraries | |
a888e6ef | 23 | Source0: https://botan.randombit.net/releases/Botan-%{version}.tar.xz |
9fb57b57 | 24 | # Source0-md5: 30a71dd700d69561483fb1599a13ea3b |
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 | |
7f5657d3 | 37 | BuildRequires: zlib-devel |
ac90ec63 | 38 | %if %{with python2} |
189a518b | 39 | BuildRequires: python-devel >= 1:2.7 |
ac90ec63 JB |
40 | %endif |
41 | %if %{with python3} | |
189a518b | 42 | BuildRequires: python3-devel >= 1:3.4 |
ac90ec63 | 43 | %endif |
7f5657d3 ER |
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 | |
93e6aed8 | 49 | CRLs, PKCS#10 certificate requests, a filter/pipe message processing |
7f5657d3 ER |
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 | ||
93e6aed8 JB |
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 | ||
7f5657d3 | 62 | %package devel |
ac90ec63 JB |
63 | Summary: Header files for Botan library |
64 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan | |
7f5657d3 ER |
65 | Group: Development/Libraries |
66 | Requires: %{name} = %{version}-%{release} | |
67 | Requires: bzip2-devel | |
68 | Requires: gmp-devel | |
ec7c6d4b | 69 | %{?with_openssl:Requires: openssl-devel} |
7f5657d3 ER |
70 | Requires: zlib-devel |
71 | ||
72 | %description devel | |
93e6aed8 | 73 | This package contains the header files for developing applications |
ac90ec63 | 74 | that use Botan. |
93e6aed8 | 75 | |
a888e6ef | 76 | %description devel -l pl.UTF-8 |
93e6aed8 | 77 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji |
ac90ec63 | 78 | wykorzystujących bibliotekę Botan. |
7f5657d3 ER |
79 | |
80 | %package static | |
ac90ec63 JB |
81 | Summary: Static Botan library |
82 | Summary(pl.UTF-8): Statyczna biblioteka Botan | |
7f5657d3 ER |
83 | Group: Development/Libraries |
84 | Requires: %{name}-devel = %{version}-%{release} | |
85 | ||
86 | %description static | |
ac90ec63 | 87 | Static Botan library. |
7f5657d3 ER |
88 | |
89 | %description static -l pl.UTF-8 | |
ac90ec63 | 90 | Statyczna biblioteka Botan. |
7f5657d3 ER |
91 | |
92 | %package apidocs | |
ac90ec63 JB |
93 | Summary: Botan API documentation |
94 | Summary(pl.UTF-8): Dokumentacja API biblioteki Botan | |
7f5657d3 | 95 | Group: Documentation |
fed27784 | 96 | BuildArch: noarch |
7f5657d3 ER |
97 | |
98 | %description apidocs | |
ac90ec63 | 99 | API and internal documentation for Botan library. |
7f5657d3 ER |
100 | |
101 | %description apidocs -l pl.UTF-8 | |
ac90ec63 JB |
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. | |
7f5657d3 ER |
127 | |
128 | %prep | |
129 | %setup -q -n Botan-%{version} | |
189a518b JB |
130 | |
131 | # kill shebang, nothing to execute directly | |
132 | %{__sed} -i -e '1d' src/python/botan2.py | |
7f5657d3 ER |
133 | |
134 | %build | |
135 | # we have the necessary prerequisites, so enable optional modules | |
ec7c6d4b | 136 | %define enable_modules bzip2,lzma,zlib,%{?with_openssl:openssl},sqlite3,tpm,pkcs11 |
7f5657d3 ER |
137 | |
138 | # fixme: maybe disable unix_procs, very slow. | |
139 | %define disable_modules %{nil} | |
140 | ||
141 | ./configure.py \ | |
142 | --prefix=%{_prefix} \ | |
143 | --libdir=%{_lib} \ | |
144 | --cc=gcc \ | |
145 | --os=linux \ | |
146 | --cpu=%{_arch} \ | |
147 | --enable-modules=%{enable_modules} \ | |
ac90ec63 | 148 | --disable-modules=%{disable_modules} \ |
189a518b JB |
149 | %if %{with python2} |
150 | --with-python-version=%{py_ver} \ | |
ac90ec63 | 151 | %endif |
189a518b | 152 | %{!?with_apidocs:--without-sphinx} |
7f5657d3 ER |
153 | |
154 | # (ab)using CXX as an easy way to inject our CXXFLAGS | |
155 | %{__make} \ | |
189a518b JB |
156 | CXX="%{__cxx} -pthread" \ |
157 | CXXFLAGS="%{rpmcxxflags}" | |
7f5657d3 | 158 | |
ac90ec63 JB |
159 | %if %{with apidocs} |
160 | %{__make} docs | |
161 | %endif | |
162 | ||
7f5657d3 | 163 | %if %{with tests} |
ec7c6d4b | 164 | # certstor_system test is trying tp look up expired certs |
2773c974 JR |
165 | # os_utils fail on builders |
166 | LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils | |
ac90ec63 JB |
167 | %endif |
168 | ||
7f5657d3 ER |
169 | %install |
170 | rm -rf $RPM_BUILD_ROOT | |
ac90ec63 | 171 | |
7f5657d3 ER |
172 | %{__make} install \ |
173 | INSTALL_CMD_EXEC="install -p -m 755" \ | |
174 | INSTALL_CMD_DATA="install -p -m 644" \ | |
189a518b | 175 | DESTDIR=$RPM_BUILD_ROOT |
7f5657d3 | 176 | |
ac90ec63 | 177 | %if %{with python2} |
ac90ec63 JB |
178 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
179 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
180 | %py_postclean | |
181 | %endif | |
182 | ||
183 | %if %{with python3} | |
189a518b JB |
184 | install -d $RPM_BUILD_ROOT%{py3_sitedir} |
185 | cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir} | |
ac90ec63 JB |
186 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} |
187 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
188 | %endif | |
189 | ||
189a518b JB |
190 | # packaged as %doc |
191 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version} | |
192 | ||
ac90ec63 JB |
193 | %if %{with apidocs} |
194 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
195 | cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
196 | %endif | |
f7749ed3 | 197 | |
7f5657d3 ER |
198 | %clean |
199 | rm -rf $RPM_BUILD_ROOT | |
200 | ||
ac90ec63 JB |
201 | %post -p /sbin/ldconfig |
202 | %postun -p /sbin/ldconfig | |
7f5657d3 ER |
203 | |
204 | %files | |
205 | %defattr(644,root,root,755) | |
a888e6ef | 206 | %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,security.rst} |
189a518b JB |
207 | %attr(755,root,root) %{_bindir}/botan |
208 | %attr(755,root,root) %{_libdir}/libbotan-2.so.*.* | |
9fb57b57 | 209 | %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.19 |
189a518b | 210 | %{_mandir}/man1/botan.1* |
7f5657d3 ER |
211 | |
212 | %files devel | |
213 | %defattr(644,root,root,755) | |
189a518b JB |
214 | %attr(755,root,root) %{_libdir}/libbotan-2.so |
215 | %{_includedir}/botan-2 | |
216 | %{_pkgconfigdir}/botan-2.pc | |
7f5657d3 ER |
217 | |
218 | %if %{with static_libs} | |
219 | %files static | |
220 | %defattr(644,root,root,755) | |
189a518b | 221 | %{_libdir}/libbotan-2.a |
7f5657d3 ER |
222 | %endif |
223 | ||
224 | %if %{with apidocs} | |
225 | %files apidocs | |
226 | %defattr(644,root,root,755) | |
189a518b | 227 | # FIXME: update path after fixing sphinx build |
ac90ec63 JB |
228 | %doc _doc/manual/{_static,*.html,*.js} |
229 | %{_examplesdir}/%{name}-%{version} | |
230 | %endif | |
231 | ||
232 | %if %{with python2} | |
233 | %files -n python-botan | |
234 | %defattr(644,root,root,755) | |
189a518b | 235 | %{py_sitedir}/botan2.py[co] |
ac90ec63 JB |
236 | %endif |
237 | ||
238 | %if %{with python3} | |
239 | %files -n python3-botan | |
240 | %defattr(644,root,root,755) | |
189a518b JB |
241 | %{py3_sitedir}/botan2.py |
242 | %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co] | |
7f5657d3 | 243 | %endif |