]> git.pld-linux.org Git - packages/botan2.git/blame - botan2.spec
BR: docutils for rst2man
[packages/botan2.git] / botan2.spec
CommitLineData
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 16Summary: Crypto library written in C++
93e6aed8 17Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++
189a518b 18Name: botan2
78c6e18a 19Version: 2.18.1
ec7c6d4b 20Release: 1
7f5657d3
ER
21License: BSD
22Group: Libraries
a888e6ef 23Source0: https://botan.randombit.net/releases/Botan-%{version}.tar.xz
78c6e18a 24# Source0-md5: 77c558179f276273e0bf39ef941d36c5
ac90ec63 25URL: https://botan.randombit.net/
7f5657d3 26BuildRequires: bzip2-devel
d2b1c9c8 27BuildRequires: docutils
7f5657d3 28BuildRequires: libstdc++-devel
ec7c6d4b 29%{?with_openssl:BuildRequires: openssl-devel}
189a518b 30BuildRequires: python >= 1:2.7
ac90ec63
JB
31BuildRequires: rpm-pythonprov
32BuildRequires: rpmbuild(macros) >= 1.714
33%{?with_apidocs:BuildRequires: sphinx-pdg}
7f5657d3 34BuildRequires: zlib-devel
ac90ec63 35%if %{with python2}
189a518b 36BuildRequires: python-devel >= 1:2.7
ac90ec63
JB
37%endif
38%if %{with python3}
189a518b 39BuildRequires: python3-devel >= 1:3.4
ac90ec63 40%endif
7f5657d3
ER
41BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43%description
44Botan is a BSD-licensed crypto library written in C++. It provides a
45wide variety of basic cryptographic algorithms, X.509 certificates and
93e6aed8 46CRLs, PKCS#10 certificate requests, a filter/pipe message processing
7f5657d3
ER
47system, and a wide variety of other features, all written in portable
48C++. The API reference, tutorial, and examples may help impart the
49flavor of the library.
50
93e6aed8
JB
51%description -l pl.UTF-8
52Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++.
53Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty
54X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania
55komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko
56napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
57wprowadzenie oraz przykłady.
58
7f5657d3 59%package devel
ac90ec63
JB
60Summary: Header files for Botan library
61Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan
7f5657d3
ER
62Group: Development/Libraries
63Requires: %{name} = %{version}-%{release}
64Requires: bzip2-devel
65Requires: gmp-devel
ec7c6d4b 66%{?with_openssl:Requires: openssl-devel}
7f5657d3
ER
67Requires: zlib-devel
68
69%description devel
93e6aed8 70This package contains the header files for developing applications
ac90ec63 71that use Botan.
93e6aed8 72
a888e6ef 73%description devel -l pl.UTF-8
93e6aed8 74Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
ac90ec63 75wykorzystujących bibliotekę Botan.
7f5657d3
ER
76
77%package static
ac90ec63
JB
78Summary: Static Botan library
79Summary(pl.UTF-8): Statyczna biblioteka Botan
7f5657d3
ER
80Group: Development/Libraries
81Requires: %{name}-devel = %{version}-%{release}
82
83%description static
ac90ec63 84Static Botan library.
7f5657d3
ER
85
86%description static -l pl.UTF-8
ac90ec63 87Statyczna biblioteka Botan.
7f5657d3
ER
88
89%package apidocs
ac90ec63
JB
90Summary: Botan API documentation
91Summary(pl.UTF-8): Dokumentacja API biblioteki Botan
7f5657d3 92Group: Documentation
fed27784 93BuildArch: noarch
7f5657d3
ER
94
95%description apidocs
ac90ec63 96API and internal documentation for Botan library.
7f5657d3
ER
97
98%description apidocs -l pl.UTF-8
ac90ec63
JB
99Dokumentacja API biblioteki Botan.
100
101%package -n python-botan
102Summary: Python 2.x binding for Botan library
103Summary(pl.UTF-8): Wiązanie Pythona 2.x do biblioteki Botan
104Group: Libraries/Python
105Requires: %{name} = %{version}-%{release}
106
107%description -n python-botan
108Python 2.x binding for Botan library.
109
110%description -n python-botan -l pl.UTF-8
111Wiązanie Pythona 2.x do biblioteki Botan.
112
113%package -n python3-botan
114Summary: Python 3.x binding for Botan library
115Summary(pl.UTF-8): Wiązanie Pythona 3.x do biblioteki Botan
116Group: Libraries/Python
117Requires: %{name} = %{version}-%{release}
118
119%description -n python3-botan
120Python 3.x binding for Botan library.
121
122%description -n python3-botan -l pl.UTF-8
123Wią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
163LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils
ac90ec63
JB
164%endif
165
7f5657d3
ER
166%install
167rm -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
181install -d $RPM_BUILD_ROOT%{py3_sitedir}
182cp -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}
191install -d $RPM_BUILD_ROOT%{_examplesdir}
192cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
193%endif
f7749ed3 194
7f5657d3
ER
195%clean
196rm -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
This page took 0.096368 seconds and 4 git commands to generate.