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