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