]> git.pld-linux.org Git - packages/botan2.git/blob - botan.spec
- updated to 1.10.17 (latests 1.x version; new soname)
[packages/botan2.git] / botan.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # unit tests
4 %bcond_without  apidocs         # Sphinx based HTML documentation
5 %bcond_without  static_libs     # static library
6 %bcond_without  python          # Python bindings
7 %bcond_without  python2         # CPython 2.x binding
8 %bcond_without  python3         # CPython 3.x binding
9
10 %if %{without python}
11 %undefine       with_python2
12 %undefine       with_python3
13 %endif
14 Summary:        Crypto library written in C++
15 Summary(pl.UTF-8):      Biblioteka kryptograficzna napisana w C++
16 Name:           botan
17 Version:        1.10.17
18 Release:        1
19 License:        BSD
20 Group:          Libraries
21 Source0:        https://botan.randombit.net/releases/Botan-%{version}.tgz
22 # Source0-md5:  e5ed5dc70edd238c5a2116670b2cb3f3
23 Patch0:         %{name}-includes.patch
24 Patch1:         %{name}-python.patch
25 URL:            https://botan.randombit.net/
26 BuildRequires:  bzip2-devel
27 BuildRequires:  gmp-devel
28 BuildRequires:  libstdc++-devel
29 BuildRequires:  openssl-devel
30 BuildRequires:  python >= 1:2.6
31 BuildRequires:  rpm-pythonprov
32 BuildRequires:  rpmbuild(macros) >= 1.714
33 %{?with_apidocs:BuildRequires:  sphinx-pdg}
34 BuildRequires:  zlib-devel
35 %if %{with python2}
36 BuildRequires:  boost-python-devel
37 BuildRequires:  python-devel >= 1:2.6
38 %endif
39 %if %{with python3}
40 BuildRequires:  boost-python3-devel
41 BuildRequires:  python3-devel >= 1:3.2
42 %endif
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 Botan is a BSD-licensed crypto library written in C++. It provides a
47 wide variety of basic cryptographic algorithms, X.509 certificates and
48 CRLs, PKCS#10 certificate requests, a filter/pipe message processing
49 system, and a wide variety of other features, all written in portable
50 C++. The API reference, tutorial, and examples may help impart the
51 flavor of the library.
52
53 %description -l pl.UTF-8
54 Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++.
55 Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty
56 X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania
57 komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko
58 napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
59 wprowadzenie oraz przykłady.
60
61 %package devel
62 Summary:        Header files for Botan library
63 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Botan
64 Group:          Development/Libraries
65 Requires:       %{name} = %{version}-%{release}
66 Requires:       bzip2-devel
67 Requires:       gmp-devel
68 Requires:       openssl-devel
69 Requires:       zlib-devel
70
71 %description devel
72 This package contains the header files for developing applications
73 that use Botan.
74
75 %description devel
76 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
77 wykorzystujących bibliotekę Botan.
78
79 %package static
80 Summary:        Static Botan library
81 Summary(pl.UTF-8):      Statyczna biblioteka Botan
82 Group:          Development/Libraries
83 Requires:       %{name}-devel = %{version}-%{release}
84
85 %description static
86 Static Botan library.
87
88 %description static -l pl.UTF-8
89 Statyczna biblioteka Botan.
90
91 %package apidocs
92 Summary:        Botan API documentation
93 Summary(pl.UTF-8):      Dokumentacja API biblioteki Botan
94 Group:          Documentation
95 %if "%{_rpmversion}" >= "5"
96 BuildArch:      noarch
97 %endif
98
99 %description apidocs
100 API and internal documentation for Botan library.
101
102 %description apidocs -l pl.UTF-8
103 Dokumentacja API biblioteki Botan.
104
105 %package -n python-botan
106 Summary:        Python 2.x binding for Botan library
107 Summary(pl.UTF-8):      Wiązanie Pythona 2.x do biblioteki Botan
108 Group:          Libraries/Python
109 Requires:       %{name} = %{version}-%{release}
110
111 %description -n python-botan
112 Python 2.x binding for Botan library.
113
114 %description -n python-botan -l pl.UTF-8
115 Wiązanie Pythona 2.x do biblioteki Botan.
116
117 %package -n python3-botan
118 Summary:        Python 3.x binding for Botan library
119 Summary(pl.UTF-8):      Wiązanie Pythona 3.x do biblioteki Botan
120 Group:          Libraries/Python
121 Requires:       %{name} = %{version}-%{release}
122
123 %description -n python3-botan
124 Python 3.x binding for Botan library.
125
126 %description -n python3-botan -l pl.UTF-8
127 Wiązanie Pythona 3.x do biblioteki Botan.
128
129 %prep
130 %setup -q -n Botan-%{version}
131 %patch0 -p1
132 %patch1 -p1
133
134 %build
135 # we have the necessary prerequisites, so enable optional modules
136 %define enable_modules gnump,bzip2,zlib,openssl
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 python}
150         --with-boost-python \
151         --with-python-version=x.y \
152 %endif
153         %{?with_apidocs:--with-sphinx}
154
155 # (ab)using CXX as an easy way to inject our CXXFLAGS
156 %{__make} \
157         CXX="%{__cxx} %{rpmcxxflags}"
158
159 %if %{with apidocs}
160 %{__make} docs
161 %endif
162
163 %if %{with tests}
164 %{__make} check \
165         CXX="%{__cxx} %{rpmcxxflags}"
166
167 LD_LIBRARY_PATH=. ./check --validate
168 %endif
169
170 %if %{with python2}
171 install -d build/python%{py_ver}
172 %{__make} -f Makefile.python \
173         CXX="%{__cxx}" \
174         CFLAGS="%{rpmcxxflags}" \
175         LDFLAGS="%{rpmldflags}" \
176         PY_VER=%{py_ver} \
177         PYTHON_ROOT=%{py_libdir}/config \
178         PYTHON_INC=-I%{py_incdir}
179 %endif
180
181 %if %{with python3}
182 install -d build/python%{py3_ver}
183 %{__make} -f Makefile.python \
184         CXX="%{__cxx}" \
185         CFLAGS="%{rpmcxxflags}" \
186         LDFLAGS="%{rpmldflags}" \
187         BOOST_PYTHON=boost_python3 \
188         PY_VER=%{py3_ver} \
189         PYTHON_ROOT=%{py3_libdir}/config \
190         PYTHON_INC=-I%{py3_incdir}
191 %endif
192
193 %install
194 rm -rf $RPM_BUILD_ROOT
195
196 %{__make} install \
197         INSTALL_CMD_EXEC="install -p -m 755" \
198         INSTALL_CMD_DATA="install -p -m 644" \
199         DOCDIR=_doc \
200         DESTDIR=$RPM_BUILD_ROOT%{_prefix}
201
202 %if %{with python2}
203 %{__make} -f Makefile.python install \
204         PY_VER=%{py_ver} \
205         PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py_sitedir}
206
207 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
208 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
209 %py_postclean
210 %endif
211
212 %if %{with python3}
213 %{__make} -f Makefile.python install \
214         PY_VER=%{py3_ver} \
215         PYTHON_SITE_PACKAGE_DIR=$RPM_BUILD_ROOT%{py3_sitedir}
216
217 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
218 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
219 %endif
220
221 %if %{with apidocs}
222 install -d $RPM_BUILD_ROOT%{_examplesdir}
223 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
224 %endif
225
226 %clean
227 rm -rf $RPM_BUILD_ROOT
228
229 %post   -p /sbin/ldconfig
230 %postun -p /sbin/ldconfig
231
232 %files
233 %defattr(644,root,root,755)
234 %doc readme.txt doc/{algos,credits,faq,index,license,log,support,users}.txt
235 %attr(755,root,root) %{_libdir}/libbotan-1.10.so.*.*
236 %attr(755,root,root) %ghost %{_libdir}/libbotan-1.10.so.1
237
238 %files devel
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_bindir}/botan-config-1.10
241 %attr(755,root,root) %{_libdir}/libbotan-1.10.so
242 %{_includedir}/botan-1.10
243 %{_pkgconfigdir}/botan-1.10.pc
244
245 %if %{with static_libs}
246 %files static
247 %defattr(644,root,root,755)
248 %{_libdir}/libbotan-1.10.a
249 %endif
250
251 %if %{with apidocs}
252 %files apidocs
253 %defattr(644,root,root,755)
254 %doc _doc/manual/{_static,*.html,*.js}
255 %{_examplesdir}/%{name}-%{version}
256 %endif
257
258 %if %{with python2}
259 %files -n python-botan
260 %defattr(644,root,root,755)
261 %dir %{py_sitedir}/botan
262 %attr(755,root,root) %{py_sitedir}/botan/_botan.so
263 %{py_sitedir}/botan/__init__.py[co]
264 %endif
265
266 %if %{with python3}
267 %files -n python3-botan
268 %defattr(644,root,root,755)
269 %dir %{py3_sitedir}/botan
270 %attr(755,root,root) %{py3_sitedir}/botan/_botan.so
271 %{py3_sitedir}/botan/__init__.py
272 %{py3_sitedir}/botan/__pycache__
273 %endif
This page took 0.065227 seconds and 4 git commands to generate.