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}
206 %{__aclocal} -I m4 -I libmissing/m4
212 %{?with_static_libs:--enable-static} \
213 --with-html-dir=%{_gtkdocdir}/libpreludedb \
214 --with-mysql%{!?with_mysql:=no} \
215 --with-postgresql%{!?with_pgsql:=no} \
216 --with-python2%{!?with_python2:=no} \
217 --with-python3%{!?with_python3:=no} \
218 --with-sqlite%{!?with_sqlite3:=no} \
224 rm -rf $RPM_BUILD_ROOT
226 %{__make} -j1 install \
227 DESTDIR=$RPM_BUILD_ROOT \
228 pythondir=%{py_sitescriptdir} \
229 pyexecdir=%{py_sitedir} \
230 python3dir=%{py3_sitescriptdir} \
231 py3execdir=%{py3_sitedir}
233 %if %{without pgsql} && %{without mysql} && %{without sqlite3}
234 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/sql
237 # no *.la for plugins
238 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.la \
239 %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.a}
246 rm -rf $RPM_BUILD_ROOT
250 if [ "$1" = 1 ]; then
251 %banner -e %{name} <<EOF
253 Create new database and database user for prelude
254 (or update an existing one if needed) using templates from
255 %{_datadir}/%{name}/classic
256 for reference visit %{url}
261 %postun -p /sbin/ldconfig
263 %post c++ -p /sbin/ldconfig
264 %postun c++ -p /sbin/ldconfig
267 %defattr(644,root,root,755)
268 %doc ChangeLog LICENSE.README NEWS README
269 %attr(755,root,root) %{_bindir}/preludedb-admin
270 %attr(755,root,root) %{_libdir}/libpreludedb.so.*.*.*
271 %attr(755,root,root) %ghost %{_libdir}/libpreludedb.so.7
272 %dir %{_libdir}/%{name}
273 %dir %{_libdir}/%{name}/plugins
274 %dir %{_libdir}/%{name}/plugins/formats
275 %attr(755,root,root) %{_libdir}/%{name}/plugins/formats/classic.so
276 %dir %{_libdir}/%{name}/plugins/sql
277 %dir %{_datadir}/%{name}
278 %dir %{_datadir}/%{name}/classic
279 %{_mandir}/man1/preludedb-admin.1*
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{_bindir}/libpreludedb-config
284 %attr(755,root,root) %{_libdir}/libpreludedb.so
285 %{_libdir}/libpreludedb.la
286 %dir %{_includedir}/libpreludedb
287 %{_includedir}/libpreludedb/*.h
288 %{_aclocaldir}/libpreludedb.m4
289 %{_gtkdocdir}/libpreludedb
290 %{_mandir}/man1/libpreludedb-config.1*
292 %if %{with static_libs}
294 %defattr(644,root,root,755)
295 %{_libdir}/libpreludedb.a
299 %defattr(644,root,root,755)
300 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so.*.*.*
301 %attr(755,root,root) %ghost %{_libdir}/libpreludedbcpp.so.2
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so
306 %{_libdir}/libpreludedbcpp.la
307 %{_includedir}/libpreludedb/*.hxx
309 %if %{with static_libs}
311 %defattr(644,root,root,755)
312 %{_libdir}/libpreludedbcpp.a
317 %defattr(644,root,root,755)
318 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/pgsql.so
319 %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2pgsql.sh
320 %{_datadir}/%{name}/classic/pgsql*.sql
325 %defattr(644,root,root,755)
326 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so
327 %{_datadir}/%{name}/classic/mysql*.sql
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/sqlite3.so
334 %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2sqlite.sh
335 %{_datadir}/%{name}/classic/sqlite*.sql
339 %files -n python-libpreludedb
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{py_sitedir}/_preludedb.so
342 %{py_sitedir}/preludedb.py[co]
343 %{py_sitedir}/preludedb-*-py*.egg-info
347 %files -n python3-libpreludedb
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{py3_sitedir}/_preludedb.cpython-*.so
350 %{py3_sitedir}/preludedb.py
351 %{py3_sitedir}/__pycache__/preludedb.cpython-*.py[co]
352 %{py3_sitedir}/preludedb-*-py*.egg-info