]> git.pld-linux.org Git - packages/botan.git/blame - botan.spec
- unconditional noarch subpackages
[packages/botan.git] / botan.spec
CommitLineData
ff65fdf7 1# NOTE: for botan 2.x see botan2.spec
7f5657d3
ER
2#
3# Conditional build:
ac90ec63
JB
4%bcond_without tests # unit tests
5%bcond_without apidocs # Sphinx based HTML documentation
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 15Summary: Crypto library written in C++
93e6aed8 16Summary(pl.UTF-8): Biblioteka kryptograficzna napisana w C++
7f5657d3 17Name: botan
ac90ec63 18Version: 1.10.17
ec76faf7 19Release: 4
7f5657d3
ER
20License: BSD
21Group: Libraries
ac90ec63
JB
22Source0: https://botan.randombit.net/releases/Botan-%{version}.tgz
23# Source0-md5: e5ed5dc70edd238c5a2116670b2cb3f3
24Patch0: %{name}-includes.patch
25Patch1: %{name}-python.patch
26URL: https://botan.randombit.net/
7f5657d3
ER
27BuildRequires: bzip2-devel
28BuildRequires: gmp-devel
29BuildRequires: libstdc++-devel
30BuildRequires: openssl-devel
ac90ec63
JB
31BuildRequires: python >= 1:2.6
32BuildRequires: rpm-pythonprov
33BuildRequires: rpmbuild(macros) >= 1.714
34%{?with_apidocs:BuildRequires: sphinx-pdg}
7f5657d3 35BuildRequires: zlib-devel
ac90ec63
JB
36%if %{with python2}
37BuildRequires: boost-python-devel
38BuildRequires: python-devel >= 1:2.6
39%endif
40%if %{with python3}
41BuildRequires: boost-python3-devel
42BuildRequires: python3-devel >= 1:3.2
43%endif
7f5657d3
ER
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
93e6aed8 49CRLs, PKCS#10 certificate requests, a filter/pipe message processing
7f5657d3
ER
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
93e6aed8
JB
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
7f5657d3 62%package devel
ac90ec63
JB
63Summary: Header files for Botan library
64Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Botan
7f5657d3
ER
65Group: Development/Libraries
66Requires: %{name} = %{version}-%{release}
67Requires: bzip2-devel
68Requires: gmp-devel
69Requires: openssl-devel
7f5657d3
ER
70Requires: zlib-devel
71
72%description devel
93e6aed8 73This package contains the header files for developing applications
ac90ec63 74that use Botan.
93e6aed8
JB
75
76%description devel
77Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
ac90ec63 78wykorzystujących bibliotekę Botan.
7f5657d3
ER
79
80%package static
ac90ec63
JB
81Summary: Static Botan library
82Summary(pl.UTF-8): Statyczna biblioteka Botan
7f5657d3
ER
83Group: Development/Libraries
84Requires: %{name}-devel = %{version}-%{release}
85
86%description static
ac90ec63 87Static Botan library.
7f5657d3
ER
88
89%description static -l pl.UTF-8
ac90ec63 90Statyczna biblioteka Botan.
7f5657d3
ER
91
92%package apidocs
ac90ec63
JB
93Summary: Botan API documentation
94Summary(pl.UTF-8): Dokumentacja API biblioteki Botan
7f5657d3 95Group: Documentation
fed27784 96BuildArch: noarch
7f5657d3
ER
97
98%description apidocs
ac90ec63 99API and internal documentation for Botan library.
7f5657d3
ER
100
101%description apidocs -l pl.UTF-8
ac90ec63
JB
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.
7f5657d3
ER
127
128%prep
129%setup -q -n Botan-%{version}
ac90ec63
JB
130%patch0 -p1
131%patch1 -p1
7f5657d3
ER
132
133%build
134# we have the necessary prerequisites, so enable optional modules
135%define enable_modules gnump,bzip2,zlib,openssl
136
137# fixme: maybe disable unix_procs, very slow.
138%define disable_modules %{nil}
139
140./configure.py \
141 --prefix=%{_prefix} \
142 --libdir=%{_lib} \
143 --cc=gcc \
144 --os=linux \
3bd15bf0 145 --cpu=%{_target_base_arch} \
7f5657d3 146 --enable-modules=%{enable_modules} \
ac90ec63
JB
147 --disable-modules=%{disable_modules} \
148%if %{with python}
149 --with-boost-python \
150 --with-python-version=x.y \
151%endif
152 %{?with_apidocs:--with-sphinx}
7f5657d3
ER
153
154# (ab)using CXX as an easy way to inject our CXXFLAGS
155%{__make} \
156 CXX="%{__cxx} %{rpmcxxflags}"
157
ac90ec63
JB
158%if %{with apidocs}
159%{__make} docs
160%endif
161
7f5657d3 162%if %{with tests}
ac90ec63
JB
163%{__make} check \
164 CXX="%{__cxx} %{rpmcxxflags}"
7f5657d3 165
7f5657d3
ER
166LD_LIBRARY_PATH=. ./check --validate
167%endif
168
ac90ec63
JB
169%if %{with python2}
170install -d build/python%{py_ver}
171%{__make} -f Makefile.python \
172 CXX="%{__cxx}" \
173 CFLAGS="%{rpmcxxflags}" \
174 LDFLAGS="%{rpmldflags}" \
175 PY_VER=%{py_ver} \
176 PYTHON_ROOT=%{py_libdir}/config \
177 PYTHON_INC=-I%{py_incdir}
178%endif
179
180%if %{with python3}
181install -d build/python%{py3_ver}
182%{__make} -f Makefile.python \
183 CXX="%{__cxx}" \
184 CFLAGS="%{rpmcxxflags}" \
185 LDFLAGS="%{rpmldflags}" \
186 BOOST_PYTHON=boost_python3 \
187 PY_VER=%{py3_ver} \
188 PYTHON_ROOT=%{py3_libdir}/config \
189 PYTHON_INC=-I%{py3_incdir}
190%endif
191
7f5657d3
ER
192%install
193rm -rf $RPM_BUILD_ROOT
ac90ec63 194
7f5657d3
ER
195%{__make} install \
196 INSTALL_CMD_EXEC="install -p -m 755" \
197 INSTALL_CMD_DATA="install -p -m 644" \
198 DOCDIR=_doc \
199 DESTDIR=$RPM_BUILD_ROOT%{_prefix}
200
ac90ec63
JB
201%if %{with python2}
202%{__make} -f Makefile.python install \
203 PY_VER=%{py_ver} \
204 PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir}
205
206%py_comp $RPM_BUILD_ROOT%{py_sitedir}
207%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
208%py_postclean
209%endif
210
211%if %{with python3}
212%{__make} -f Makefile.python install \
213 PY_VER=%{py3_ver} \
214 PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir}
215
216%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
217%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
218%endif
219
220%if %{with apidocs}
221install -d $RPM_BUILD_ROOT%{_examplesdir}
222cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
223%endif
f7749ed3 224
7f5657d3
ER
225%clean
226rm -rf $RPM_BUILD_ROOT
227
ac90ec63
JB
228%post -p /sbin/ldconfig
229%postun -p /sbin/ldconfig
7f5657d3
ER
230
231%files
232%defattr(644,root,root,755)
ac90ec63
JB
233%doc readme.txt doc/{algos,credits,faq,index,license,log,support,users}.txt
234%attr(755,root,root) %{_libdir}/libbotan-1.10.so.*.*
235%attr(755,root,root) %ghost %{_libdir}/libbotan-1.10.so.1
7f5657d3
ER
236
237%files devel
238%defattr(644,root,root,755)
ac90ec63
JB
239%attr(755,root,root) %{_bindir}/botan-config-1.10
240%attr(755,root,root) %{_libdir}/libbotan-1.10.so
241%{_includedir}/botan-1.10
242%{_pkgconfigdir}/botan-1.10.pc
7f5657d3
ER
243
244%if %{with static_libs}
245%files static
246%defattr(644,root,root,755)
ac90ec63 247%{_libdir}/libbotan-1.10.a
7f5657d3
ER
248%endif
249
250%if %{with apidocs}
251%files apidocs
252%defattr(644,root,root,755)
ac90ec63
JB
253%doc _doc/manual/{_static,*.html,*.js}
254%{_examplesdir}/%{name}-%{version}
255%endif
256
257%if %{with python2}
258%files -n python-botan
259%defattr(644,root,root,755)
260%dir %{py_sitedir}/botan
261%attr(755,root,root) %{py_sitedir}/botan/_botan.so
262%{py_sitedir}/botan/__init__.py[co]
263%endif
264
265%if %{with python3}
266%files -n python3-botan
267%defattr(644,root,root,755)
268%dir %{py3_sitedir}/botan
269%attr(755,root,root) %{py3_sitedir}/botan/_botan.so
270%{py3_sitedir}/botan/__init__.py
271%{py3_sitedir}/botan/__pycache__
7f5657d3 272%endif
This page took 0.118755 seconds and 4 git commands to generate.