]> git.pld-linux.org Git - packages/botan2.git/blob - botan2.spec
BR: docutils for rst2man
[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.18.1
20 Release:        1
21 License:        BSD
22 Group:          Libraries
23 Source0:        https://botan.randombit.net/releases/Botan-%{version}.tar.xz
24 # Source0-md5:  77c558179f276273e0bf39ef941d36c5
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-pythonprov
32 BuildRequires:  rpmbuild(macros) >= 1.714
33 %{?with_apidocs:BuildRequires:  sphinx-pdg}
34 BuildRequires:  zlib-devel
35 %if %{with python2}
36 BuildRequires:  python-devel >= 1:2.7
37 %endif
38 %if %{with python3}
39 BuildRequires:  python3-devel >= 1:3.4
40 %endif
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 Botan is a BSD-licensed crypto library written in C++. It provides a
45 wide variety of basic cryptographic algorithms, X.509 certificates and
46 CRLs, PKCS#10 certificate requests, a filter/pipe message processing
47 system, and a wide variety of other features, all written in portable
48 C++. The API reference, tutorial, and examples may help impart the
49 flavor of the library.
50
51 %description -l pl.UTF-8
52 Botan to biblioteka kryptograficzna na licencji BSD, napisana w C++.
53 Zapewnia szeroki zakres algorytmów kryptograficznych, certyfikaty
54 X.509 oraz CRL, żądania certyfikatów PKCS#10, system przetwarzania
55 komunikatów z filtrowaniem/potokami i wiele innych funkcji, wszystko
56 napisane w przenośnym C++. Dodatkowe udogodnienia to dokumentacja API,
57 wprowadzenie oraz przykłady.
58
59 %package devel
60 Summary:        Header files for Botan library
61 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Botan
62 Group:          Development/Libraries
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       bzip2-devel
65 Requires:       gmp-devel
66 %{?with_openssl:Requires:       openssl-devel}
67 Requires:       zlib-devel
68
69 %description devel
70 This package contains the header files for developing applications
71 that use Botan.
72
73 %description devel -l pl.UTF-8
74 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
75 wykorzystujących bibliotekę Botan.
76
77 %package static
78 Summary:        Static Botan library
79 Summary(pl.UTF-8):      Statyczna biblioteka Botan
80 Group:          Development/Libraries
81 Requires:       %{name}-devel = %{version}-%{release}
82
83 %description static
84 Static Botan library.
85
86 %description static -l pl.UTF-8
87 Statyczna biblioteka Botan.
88
89 %package apidocs
90 Summary:        Botan API documentation
91 Summary(pl.UTF-8):      Dokumentacja API biblioteki Botan
92 Group:          Documentation
93 BuildArch:      noarch
94
95 %description apidocs
96 API and internal documentation for Botan library.
97
98 %description apidocs -l pl.UTF-8
99 Dokumentacja API biblioteki Botan.
100
101 %package -n python-botan
102 Summary:        Python 2.x binding for Botan library
103 Summary(pl.UTF-8):      Wiązanie Pythona 2.x do biblioteki Botan
104 Group:          Libraries/Python
105 Requires:       %{name} = %{version}-%{release}
106
107 %description -n python-botan
108 Python 2.x binding for Botan library.
109
110 %description -n python-botan -l pl.UTF-8
111 Wiązanie Pythona 2.x do biblioteki Botan.
112
113 %package -n python3-botan
114 Summary:        Python 3.x binding for Botan library
115 Summary(pl.UTF-8):      Wiązanie Pythona 3.x do biblioteki Botan
116 Group:          Libraries/Python
117 Requires:       %{name} = %{version}-%{release}
118
119 %description -n python3-botan
120 Python 3.x binding for Botan library.
121
122 %description -n python3-botan -l pl.UTF-8
123 Wiązanie Pythona 3.x do biblioteki Botan.
124
125 %prep
126 %setup -q -n Botan-%{version}
127
128 # kill shebang, nothing to execute directly
129 %{__sed} -i -e '1d' src/python/botan2.py
130
131 %build
132 # we have the necessary prerequisites, so enable optional modules
133 %define enable_modules bzip2,lzma,zlib,%{?with_openssl:openssl},sqlite3,tpm,pkcs11
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} \
145         --disable-modules=%{disable_modules} \
146 %if %{with python2}
147         --with-python-version=%{py_ver} \
148 %endif
149         %{!?with_apidocs:--without-sphinx}
150
151 # (ab)using CXX as an easy way to inject our CXXFLAGS
152 %{__make} \
153         CXX="%{__cxx} -pthread" \
154         CXXFLAGS="%{rpmcxxflags}"
155
156 %if %{with apidocs}
157 %{__make} docs
158 %endif
159
160 %if %{with tests}
161 # certstor_system test is trying tp look up expired certs
162 # os_utils fail on builders
163 LD_LIBRARY_PATH=. ./botan-test --skip-tests=certstor_system,os_utils
164 %endif
165
166 %install
167 rm -rf $RPM_BUILD_ROOT
168
169 %{__make} install \
170         INSTALL_CMD_EXEC="install -p -m 755" \
171         INSTALL_CMD_DATA="install -p -m 644" \
172         DESTDIR=$RPM_BUILD_ROOT
173
174 %if %{with python2}
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}
181 install -d $RPM_BUILD_ROOT%{py3_sitedir}
182 cp -p src/python/botan2.py $RPM_BUILD_ROOT%{py3_sitedir}
183 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
184 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
185 %endif
186
187 # packaged as %doc
188 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/botan-%{version}
189
190 %if %{with apidocs}
191 install -d $RPM_BUILD_ROOT%{_examplesdir}
192 cp -pr doc/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
193 %endif
194
195 %clean
196 rm -rf $RPM_BUILD_ROOT
197
198 %post   -p /sbin/ldconfig
199 %postun -p /sbin/ldconfig
200
201 %files
202 %defattr(644,root,root,755)
203 %doc license.txt news.rst readme.rst doc/{authors.txt,credits.rst,security.rst}
204 %attr(755,root,root) %{_bindir}/botan
205 %attr(755,root,root) %{_libdir}/libbotan-2.so.*.*
206 %attr(755,root,root) %ghost %{_libdir}/libbotan-2.so.18
207 %{_mandir}/man1/botan.1*
208
209 %files devel
210 %defattr(644,root,root,755)
211 %attr(755,root,root) %{_libdir}/libbotan-2.so
212 %{_includedir}/botan-2
213 %{_pkgconfigdir}/botan-2.pc
214
215 %if %{with static_libs}
216 %files static
217 %defattr(644,root,root,755)
218 %{_libdir}/libbotan-2.a
219 %endif
220
221 %if %{with apidocs}
222 %files apidocs
223 %defattr(644,root,root,755)
224 # FIXME: update path after fixing sphinx build
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)
232 %{py_sitedir}/botan2.py[co]
233 %endif
234
235 %if %{with python3}
236 %files -n python3-botan
237 %defattr(644,root,root,755)
238 %{py3_sitedir}/botan2.py
239 %{py3_sitedir}/__pycache__/botan2.cpython-*.py[co]
240 %endif
This page took 0.10946 seconds and 4 git commands to generate.