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