]>
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 | |
7f5657d3 | 10 | |
ac90ec63 JB |
11 | %if %{without python} |
12 | %undefine with_python2 | |
13 | %undefine with_python3 | |
14 | %endif | |
7f5657d3 | 15 | Summary: Crypto library written in C++ |
93e6aed8 | 16 | Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++ |
189a518b | 17 | Name: botan2 |
d2c937ca | 18 | Version: 2.7.0 |
ac90ec63 | 19 | Release: 1 |
7f5657d3 ER |
20 | License: BSD |
21 | Group: Libraries | |
ac90ec63 | 22 | Source0: https://botan.randombit.net/releases/Botan-%{version}.tgz |
d2c937ca | 23 | # Source0-md5: c819fce944ee688e01b07bb6332d9586 |
ac90ec63 | 24 | URL: https://botan.randombit.net/ |
7f5657d3 | 25 | BuildRequires: bzip2-devel |
7f5657d3 ER |
26 | BuildRequires: libstdc++-devel |
27 | BuildRequires: openssl-devel | |
189a518b | 28 | BuildRequires: python >= 1:2.7 |
ac90ec63 JB |
29 | BuildRequires: rpm-pythonprov |
30 | BuildRequires: rpmbuild(macros) >= 1.714 | |
31 | %{?with_apidocs:BuildRequires: sphinx-pdg} | |
7f5657d3 | 32 | BuildRequires: zlib-devel |
ac90ec63 | 33 | %if %{with python2} |
189a518b | 34 | BuildRequires: python-devel >= 1:2.7 |
ac90ec63 JB |
35 | %endif |
36 | %if %{with python3} | |
189a518b | 37 | BuildRequires: python3-devel >= 1:3.4 |
ac90ec63 | 38 | %endif |
7f5657d3 ER |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
40 | ||
41 | %description | |
42 | Botan is a BSD-licensed crypto library written in C++. It provides a | |
43 | wide variety of basic cryptographic algorithms, X.509 certificates and | |
93e6aed8 | 44 | CRLs, PKCS#10 certificate requests, a filter/pipe message processing |
7f5657d3 ER |
45 | system, and a wide variety of other features, all written in portable |
46 | C++. The API reference, tutorial, and examples may help impart the | |
47 | flavor of the library. | |
48 | ||
93e6aed8 JB |
49 | %description -l pl.UTF-8 |
50 | Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++. | |
51 | Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty | |
52 | X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania | |
53 | komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko | |
54 | napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API, | |
55 | wprowadzenie oraz przykłady. | |
56 | ||
7f5657d3 | 57 | %package devel |
ac90ec63 JB |
58 | Summary: Header files for Botan library |
59 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan | |
7f5657d3 ER |
60 | Group: Development/Libraries |
61 | Requires: %{name} = %{version}-%{release} | |
62 | Requires: bzip2-devel | |
63 | Requires: gmp-devel | |
64 | Requires: openssl-devel | |
7f5657d3 ER |
65 | Requires: zlib-devel |
66 | ||
67 | %description devel | |
93e6aed8 | 68 | This package contains the header files for developing applications |
ac90ec63 | 69 | that use Botan. |
93e6aed8 JB |
70 | |
71 | %description devel | |
72 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
ac90ec63 | 73 | wykorzystujących bibliotekę Botan. |
7f5657d3 ER |
74 | |
75 | %package static | |
ac90ec63 JB |
76 | Summary: Static Botan library |
77 | Summary(pl.UTF-8): Statyczna biblioteka Botan | |
7f5657d3 ER |
78 | Group: Development/Libraries |
79 | Requires: %{name}-devel = %{version}-%{release} | |
80 | ||
81 | %description static | |
ac90ec63 | 82 | Static Botan library. |
7f5657d3 ER |
83 | |
84 | %description static -l pl.UTF-8 | |
ac90ec63 | 85 | Statyczna biblioteka Botan. |
7f5657d3 ER |
86 | |
87 | %package apidocs | |
ac90ec63 JB |
88 | Summary: Botan API documentation |
89 | Summary(pl.UTF-8): Dokumentacja API biblioteki Botan | |
7f5657d3 | 90 | Group: Documentation |
fed27784 ER |
91 | %if "%{_rpmversion}" >= "5" |
92 | BuildArch: noarch | |
93 | %endif | |
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 | |
189a518b | 133 | %define enable_modules bzip2,lzma,zlib,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} |
189a518b | 161 | LD_LIBRARY_PATH=. ./botan-test |
ac90ec63 JB |
162 | %endif |
163 | ||
7f5657d3 ER |
164 | %install |
165 | rm -rf $RPM_BUILD_ROOT | |
ac90ec63 | 166 | |
7f5657d3 ER |
167 | %{__make} install \ |
168 | INSTALL_CMD_EXEC="install -p -m 755" \ | |
169 | INSTALL_CMD_DATA="install -p -m 644" \ | |
189a518b | 170 | DESTDIR=$RPM_BUILD_ROOT |
7f5657d3 | 171 | |
ac90ec63 | 172 | %if %{with python2} |
ac90ec63 JB |
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} | |
189a518b JB |
179 | install -d $RPM_BUILD_ROOT%{py3_sitedir} |
180 | cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir} | |
ac90ec63 JB |
181 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} |
182 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
183 | %endif | |
184 | ||
189a518b JB |
185 | # packaged as %doc |
186 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version} | |
187 | ||
ac90ec63 JB |
188 | %if %{with apidocs} |
189 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
190 | cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
191 | %endif | |
f7749ed3 | 192 | |
7f5657d3 ER |
193 | %clean |
194 | rm -rf $RPM_BUILD_ROOT | |
195 | ||
ac90ec63 JB |
196 | %post -p /sbin/ldconfig |
197 | %postun -p /sbin/ldconfig | |
7f5657d3 ER |
198 | |
199 | %files | |
200 | %defattr(644,root,root,755) | |
d2c937ca | 201 | %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,reading_list.txt,manual/roadmap.rst,security.rst,todo.rst} |
189a518b JB |
202 | %attr(755,root,root) %{_bindir}/botan |
203 | %attr(755,root,root) %{_libdir}/libbotan-2.so.*.* | |
d2c937ca | 204 | %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.7 |
189a518b | 205 | %{_mandir}/man1/botan.1* |
7f5657d3 ER |
206 | |
207 | %files devel | |
208 | %defattr(644,root,root,755) | |
189a518b JB |
209 | %attr(755,root,root) %{_libdir}/libbotan-2.so |
210 | %{_includedir}/botan-2 | |
211 | %{_pkgconfigdir}/botan-2.pc | |
7f5657d3 ER |
212 | |
213 | %if %{with static_libs} | |
214 | %files static | |
215 | %defattr(644,root,root,755) | |
189a518b | 216 | %{_libdir}/libbotan-2.a |
7f5657d3 ER |
217 | %endif |
218 | ||
219 | %if %{with apidocs} | |
220 | %files apidocs | |
221 | %defattr(644,root,root,755) | |
189a518b | 222 | # FIXME: update path after fixing sphinx build |
ac90ec63 JB |
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) | |
189a518b | 230 | %{py_sitedir}/botan2.py[co] |
ac90ec63 JB |
231 | %endif |
232 | ||
233 | %if %{with python3} | |
234 | %files -n python3-botan | |
235 | %defattr(644,root,root,755) | |
189a518b JB |
236 | %{py3_sitedir}/botan2.py |
237 | %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co] | |
7f5657d3 | 238 | %endif |