3 %bcond_without python2 # Python 2.x bindings (needed by prewikka)
4 %bcond_without python3 # Python 3.x bindings
5 %bcond_without static_libs # static library
6 %bcond_without pgsql # PostgreSQL plugin
7 %bcond_without mysql # MySQL plugin
8 %bcond_without sqlite3 # SQLite3 plugin
10 Summary: The PreludeDB Library
11 Summary(pl.UTF-8): Biblioteka PreludeDB
15 License: GPL v2 or commercial
17 #Source0Download: https://www.prelude-siem.org/projects/prelude/files
18 Source0: https://www.prelude-siem.org/attachments/download/1171/%{name}-%{version}.tar.gz
19 # Source0-md5: 372b2e7b40e1cc451833370e19bb4ec7
20 Patch0: %{name}-lt.patch
21 Patch1: %{name}-link.patch
22 Patch2: %{name}-python-install.patch
23 Patch3: gtk-doc-1.32.patch
24 URL: https://www.prelude-siem.org/
25 BuildRequires: autoconf >= 2.59
26 BuildRequires: automake >= 1:1.9
29 BuildRequires: gtk-doc >= 1.0
30 BuildRequires: libprelude-devel >= %{version}
31 BuildRequires: libprelude-c++-devel >= %{version}
32 BuildRequires: libprelude-swig >= %{version}
33 BuildRequires: libstdc++-devel
34 BuildRequires: libtool >= 2:1.5
35 %{?with_mysql:BuildRequires: mysql-devel}
36 BuildRequires: pkgconfig
37 %{?with_pgsql:BuildRequires: postgresql-devel}
38 %{?with_python2:BuildRequires: python-devel >= 1:2.5}
39 %{?with_python3:BuildRequires: python3-devel >= 1:3.2}
40 BuildRequires: rpm-pythonprov
41 BuildRequires: rpmbuild(macros) >= 1.219
42 %{?with_sqlite3:BuildRequires: sqlite3-devel >= 3.0.0}
43 BuildRequires: swig-python
44 Requires(post): /sbin/ldconfig
45 Requires: %{name}(DB_driver) = %{version}-%{release}
46 Requires: libprelude-libs >= %{version}
47 Obsoletes: perl-libpreludedb
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 The PreludeDB Library provides an abstraction layer upon the type and
52 the format of the database used to store IDMEF alerts. It allows
53 developers to use the Prelude IDMEF database easily and efficiently
54 without worrying about SQL, and to access the database independently
55 of the type/format of the database.
57 %description -l pl.UTF-8
58 Biblioteka PreludeDB dostarcza warstwę abstrakcji ponad rodzajem i
59 formatem bazy danych używanej do przechowywania alarmów IDMEF. Pozwala
60 programistom łatwo i wydajnie używać bazy danych IDMEF Prelude nie
61 martwiąc się o SQL i dostawać się do bazy niezależnie od jej
65 Summary: Header files and development documentation for libpreludedb
66 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb
67 Group: Development/Libraries
68 Requires: %{name} = %{version}-%{release}
69 Requires: libprelude-devel >= %{version}
72 Header files and development documentation for libpreludedb.
74 %description devel -l pl.UTF-8
75 Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb.
78 Summary: Static libpreludedb library
79 Summary(pl.UTF-8): Statyczna biblioteka libpreludedb
80 Group: Development/Libraries
81 Requires: %{name}-devel = %{version}-%{release}
84 Static libpreludedb library.
86 %description static -l pl.UTF-8
87 Statyczna biblioteka libpreludedb.
90 Summary: C++ binding for libpreludedb
91 Summary(pl.UTF-8): Interfejs C++ do libpreludedb
93 Requires: %{name} = %{version}-%{release}
94 Requires: libprelude-c++ >= %{version}
97 C++ binding for libpreludedb.
99 %description c++ -l pl.UTF-8
100 Interfejs C++ do libpreludedb.
103 Summary: Header files for libpreludedbcpp
104 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libpreludedbcpp
105 Group: Development/Libraries
106 Requires: %{name}-c++ = %{version}-%{release}
107 Requires: %{name}-devel = %{version}-%{release}
108 Requires: libprelude-c++-devel >= %{version}
109 Requires: libstdc++-devel
111 %description c++-devel
112 Header files for libpreludedbcpp.
114 %description c++-devel -l pl.UTF-8
115 Pliki nagłówkowe biblioteki libpreludedbcpp.
118 Summary: Static libpreludedbcpp library
119 Summary(pl.UTF-8): Statyczna biblioteka libpreludedbcpp
120 Group: Development/Libraries
121 Requires: %{name}-c++-devel = %{version}-%{release}
123 %description c++-static
124 Static libpreludedbcpp library.
126 %description c++-static -l pl.UTF-8
127 Statyczna biblioteka libpreludedbcpp.
130 Summary: PostgreSQL backend for libpreludedb
131 Summary(pl.UTF-8): Interfejs do PostgreSQL dla libpreludedb
133 Requires: %{name} = %{version}-%{release}
134 Provides: %{name}(DB_driver) = %{version}-%{release}
137 PostgreSQL backend for libpreludedb
139 %description pgsql -l pl.UTF-8
140 Interfejs do PostgreSQL do libpreludedb
143 Summary: MySQL backend for libpreludedb
144 Summary(pl.UTF-8): Interfejs do MySQL dla libpreludedb
146 Requires: %{name} = %{version}-%{release}
147 Provides: %{name}(DB_driver) = %{version}-%{release}
150 MySQL backend for libpreludedb
152 %description mysql -l pl.UTF-8
153 Interfejs do MySQL do libpreludedb
156 Summary: SQLite3 backend for libpreludedb
157 Summary(pl.UTF-8): Interfejs do SQLite3 dla libpreludedb
159 Requires: %{name} = %{version}-%{release}
160 Provides: %{name}(DB_driver) = %{version}-%{release}
163 SQLite3 backend for libpreludedb
165 %description sqlite3 -l pl.UTF-8
166 Interfejs do SQLite3 do libpreludedb
168 %package -n python-libpreludedb
169 Summary: Python 2.x bindings for libpreludedb
170 Summary(pl.UTF-8): Wiązania Pythona 2.x do libpreludedb
171 Group: Development/Languages/Python
172 Requires: %{name}-c++ = %{version}-%{release}
174 %description -n python-libpreludedb
175 Python 2.x bindings for libpreludedb.
177 %description -n python-libpreludedb -l pl.UTF-8
178 Wiązania Pythona 2.x do libpreludedb.
180 %package -n python3-libpreludedb
181 Summary: Python 3.x bindings for libpreludedb
182 Summary(pl.UTF-8): Wiązania Pythona 3.x do libpreludedb
183 Group: Development/Languages/Python
184 Requires: %{name}-c++ = %{version}-%{release}
186 %description -n python3-libpreludedb
187 Python 3.x bindings for libpreludedb.
189 %description -n python3-libpreludedb -l pl.UTF-8
190 Wiązania Pythona 3.x do libpreludedb.
200 %{__rm} bindings/python/{_preludedb.cxx,preludedb.py}
203 %{__sed} -i -e '1s,/usr/bin/env python,%{?with_python3:%{__python3}}%{!?with_python3:%{__python}},' \
209 %{__aclocal} -I m4 -I libmissing/m4
215 %{?with_static_libs:--enable-static} \
216 --with-html-dir=%{_gtkdocdir}/libpreludedb \
217 --with-mysql%{!?with_mysql:=no} \
218 --with-postgresql%{!?with_pgsql:=no} \
219 --with-python2%{!?with_python2:=no} \
220 --with-python3%{!?with_python3:=no} \
221 --with-sqlite%{!?with_sqlite3:=no} \
227 rm -rf $RPM_BUILD_ROOT
229 %{__make} -j1 install \
230 DESTDIR=$RPM_BUILD_ROOT \
231 pythondir=%{py_sitescriptdir} \
232 pyexecdir=%{py_sitedir} \
233 python3dir=%{py3_sitescriptdir} \
234 py3execdir=%{py3_sitedir}
236 %if %{without pgsql} && %{without mysql} && %{without sqlite3}
237 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/sql
240 # no *.la for plugins
241 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.la \
242 %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.a}
249 rm -rf $RPM_BUILD_ROOT
253 if [ "$1" = 1 ]; then
254 %banner -e %{name} <<EOF
256 Create new database and database user for prelude
257 (or update an existing one if needed) using templates from
258 %{_datadir}/%{name}/classic
259 for reference visit %{url}
264 %postun -p /sbin/ldconfig
266 %post c++ -p /sbin/ldconfig
267 %postun c++ -p /sbin/ldconfig
270 %defattr(644,root,root,755)
271 %doc ChangeLog LICENSE.README NEWS README
272 %attr(755,root,root) %{_bindir}/preludedb-admin
273 %attr(755,root,root) %{_libdir}/libpreludedb.so.*.*.*
274 %attr(755,root,root) %ghost %{_libdir}/libpreludedb.so.7
275 %dir %{_libdir}/%{name}
276 %dir %{_libdir}/%{name}/plugins
277 %dir %{_libdir}/%{name}/plugins/formats
278 %attr(755,root,root) %{_libdir}/%{name}/plugins/formats/classic.so
279 %dir %{_libdir}/%{name}/plugins/sql
280 %dir %{_datadir}/%{name}
281 %dir %{_datadir}/%{name}/classic
282 %{_mandir}/man1/preludedb-admin.1*
285 %defattr(644,root,root,755)
286 %attr(755,root,root) %{_bindir}/libpreludedb-config
287 %attr(755,root,root) %{_libdir}/libpreludedb.so
288 %{_libdir}/libpreludedb.la
289 %dir %{_includedir}/libpreludedb
290 %{_includedir}/libpreludedb/*.h
291 %{_aclocaldir}/libpreludedb.m4
292 %{_gtkdocdir}/libpreludedb
293 %{_mandir}/man1/libpreludedb-config.1*
295 %if %{with static_libs}
297 %defattr(644,root,root,755)
298 %{_libdir}/libpreludedb.a
302 %defattr(644,root,root,755)
303 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so.*.*.*
304 %attr(755,root,root) %ghost %{_libdir}/libpreludedbcpp.so.2
307 %defattr(644,root,root,755)
308 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so
309 %{_libdir}/libpreludedbcpp.la
310 %{_includedir}/libpreludedb/*.hxx
312 %if %{with static_libs}
314 %defattr(644,root,root,755)
315 %{_libdir}/libpreludedbcpp.a
320 %defattr(644,root,root,755)
321 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/pgsql.so
322 %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2pgsql.sh
323 %{_datadir}/%{name}/classic/pgsql*.sql
328 %defattr(644,root,root,755)
329 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so
330 %{_datadir}/%{name}/classic/mysql*.sql
335 %defattr(644,root,root,755)
336 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/sqlite3.so
337 %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2sqlite.sh
338 %{_datadir}/%{name}/classic/sqlite*.sql
342 %files -n python-libpreludedb
343 %defattr(644,root,root,755)
344 %attr(755,root,root) %{py_sitedir}/_preludedb.so
345 %{py_sitedir}/preludedb.py[co]
346 %{py_sitedir}/preludedb-*-py*.egg-info
350 %files -n python3-libpreludedb
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{py3_sitedir}/_preludedb.cpython-*.so
353 %{py3_sitedir}/preludedb.py
354 %{py3_sitedir}/__pycache__/preludedb.cpython-*.py[co]
355 %{py3_sitedir}/preludedb-*-py*.egg-info