]> git.pld-linux.org Git - packages/botan2.git/blob - botan2.spec
BR: python*-modules for %py*_*comp
[packages/botan2.git] / botan2.spec
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
16 Summary:        Crypto library written in C++
17 Summary(pl.UTF-8):      Biblioteka kryptograficzna napisana w C++
18 Name:           botan2
19 Version:        2.19.2
20 Release:        1
21 License:        BSD
22 Group:          Libraries
23 Source0:        https://botan.randombit.net/releases/Botan-%{version}.tar.xz
24 # Source0-md5:  711e7eb98ecc4a7b468dd0a0d9193d63
25 URL:            https://botan.randombit.net/
26 BuildRequires:  bzip2-devel
27 BuildRequires:  docutils
28 BuildRequires:  libstdc++-devel
29 %{?with_openssl:BuildRequires:  openssl-devel}
30 BuildRequires:  python >= 1:2.7
31 BuildRequires:  rpm-build >= 4.6
32 BuildRequires:  rpm-pythonprov
33 BuildRequires:  rpmbuild(macros) >= 1.714
34 %{?with_apidocs:BuildRequires:  sphinx-pdg}
35 BuildRequires:  tar >= 1:1.22
36 BuildRequires:  xz
37 BuildRequires:  zlib-devel
38 %if %{with python2}
39 BuildRequires:  python-devel >= 1:2.7
40 %endif
41 %if %{with python3}
42 BuildRequires:  python3-devel >= 1:3.4
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 %{?with_openssl: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 -l pl.UTF-8
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 BuildArch:      noarch
97
98 %description apidocs
99 API and internal documentation for Botan library.
100
101 %description apidocs -l pl.UTF-8
102 Dokumentacja API biblioteki Botan.
103
104 %package -n python-botan
105 Summary:        Python 2.x binding for Botan library
106 Summary(pl.UTF-8):      Wiązanie Pythona 2.x do biblioteki Botan
107 Group:          Libraries/Python
108 Requires:       %{name} = %{version}-%{release}
109
110 %description -n python-botan
111 Python 2.x binding for Botan library.
112
113 %description -n python-botan -l pl.UTF-8
114 Wiązanie Pythona 2.x do biblioteki Botan.
115
116 %package -n python3-botan
117 Summary:        Python 3.x binding for Botan library
118 Summary(pl.UTF-8):      Wiązanie Pythona 3.x do biblioteki Botan
119 Group:          Libraries/Python
120 Requires:       %{name} = %{version}-%{release}
121
122 %description -n python3-botan
123 Python 3.x binding for Botan library.
124
125 %description -n python3-botan -l pl.UTF-8
126 Wią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
166 LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils
167 %endif
168
169 %install
170 rm -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}
184 install -d $RPM_BUILD_ROOT%{py3_sitedir}
185 cp -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}
194 install -d $RPM_BUILD_ROOT%{_examplesdir}
195 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
196 %endif
197
198 %clean
199 rm -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.069102 seconds and 3 git commands to generate.