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 postgresql # 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/722/%{name}-%{version}.tar.gz
19 # Source0-md5: d8a0b70a5be3ac101fba42bb5b18249f
20 Patch0: %{name}-lt.patch
21 Patch1: %{name}-link.patch
22 Patch2: %{name}-python-install.patch
23 URL: https://www.prelude-siem.org/
24 BuildRequires: autoconf >= 2.59
25 BuildRequires: automake >= 1:1.9
28 BuildRequires: gtk-doc >= 1.0
29 BuildRequires: libprelude-devel >= %{version}
30 BuildRequires: libprelude-c++-devel >= %{version}
31 BuildRequires: libstdc++-devel
32 BuildRequires: libtool >= 2:1.5
33 %{?with_mysql:BuildRequires: mysql-devel}
34 BuildRequires: pkgconfig
35 %{?with_postgresql:BuildRequires: postgresql-devel}
36 %{?with_python2:BuildRequires: python-devel >= 1:2.5}
37 %{?with_python3:BuildRequires: python3-devel >= 1:3.2}
38 BuildRequires: rpm-pythonprov
39 BuildRequires: rpmbuild(macros) >= 1.219
40 %{?with_sqlite3:BuildRequires: sqlite3-devel >= 3.0.0}
41 BuildRequires: swig-python
42 Requires(post): /sbin/ldconfig
43 Requires: %{name}(DB_driver) = %{version}-%{release}
44 Requires: libprelude-libs >= %{version}
45 Obsoletes: perl-libpreludedb
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 The PreludeDB Library provides an abstraction layer upon the type and
50 the format of the database used to store IDMEF alerts. It allows
51 developers to use the Prelude IDMEF database easily and efficiently
52 without worrying about SQL, and to access the database independently
53 of the type/format of the database.
55 %description -l pl.UTF-8
56 Biblioteka PreludeDB dostarcza warstwę abstrakcji ponad rodzajem i
57 formatem bazy danych używanej do przechowywania alarmów IDMEF. Pozwala
58 programistom łatwo i wydajnie używać bazy danych IDMEF Prelude nie
59 martwiąc się o SQL i dostawać się do bazy niezależnie od jej
63 Summary: Header files and development documentation for libpreludedb
64 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb
65 Group: Development/Libraries
66 Requires: %{name} = %{version}-%{release}
67 Requires: libprelude-devel >= %{version}
70 Header files and development documentation for libpreludedb.
72 %description devel -l pl.UTF-8
73 Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb.
76 Summary: Static libpreludedb library
77 Summary(pl.UTF-8): Statyczna biblioteka libpreludedb
78 Group: Development/Libraries
79 Requires: %{name}-devel = %{version}-%{release}
82 Static libpreludedb library.
84 %description static -l pl.UTF-8
85 Statyczna biblioteka libpreludedb.
88 Summary: C++ binding for libpreludedb
89 Summary(pl.UTF-8): Interfejs C++ do libpreludedb
91 Requires: %{name} = %{version}-%{release}
92 Requires: libprelude-c++ >= %{version}
95 C++ binding for libpreludedb.
97 %description c++ -l pl.UTF-8
98 Interfejs C++ do libpreludedb.
101 Summary: Header files for libpreludedbcpp
102 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libpreludedbcpp
103 Group: Development/Libraries
104 Requires: %{name}-c++ = %{version}-%{release}
105 Requires: %{name}-devel = %{version}-%{release}
106 Requires: libprelude-c++-devel >= %{version}
107 Requires: libstdc++-devel
109 %description c++-devel
110 Header files for libpreludedbcpp.
112 %description c++-devel -l pl.UTF-8
113 Pliki nagłówkowe biblioteki libpreludedbcpp.
116 Summary: Static libpreludedbcpp library
117 Summary(pl.UTF-8): Statyczna biblioteka libpreludedbcpp
118 Group: Development/Libraries
119 Requires: %{name}-c++-devel = %{version}-%{release}
121 %description c++-static
122 Static libpreludedbcpp library.
124 %description c++-static -l pl.UTF-8
125 Statyczna biblioteka libpreludedbcpp.
128 Summary: PostgreSQL backend for libpreludedb
129 Summary(pl.UTF-8): Interfejs do PostgreSQL dla libpreludedb
131 Requires: %{name} = %{version}-%{release}
132 Provides: %{name}(DB_driver) = %{version}-%{release}
135 PostgreSQL backend for libpreludedb
137 %description pgsql -l pl.UTF-8
138 Interfejs do PostgreSQL do libpreludedb
141 Summary: MySQL backend for libpreludedb
142 Summary(pl.UTF-8): Interfejs do MySQL dla libpreludedb
144 Requires: %{name} = %{version}-%{release}
145 Provides: %{name}(DB_driver) = %{version}-%{release}
148 MySQL backend for libpreludedb
150 %description mysql -l pl.UTF-8
151 Interfejs do MySQL do libpreludedb
154 Summary: SQLite3 backend for libpreludedb
155 Summary(pl.UTF-8): Interfejs do SQLite3 dla libpreludedb
157 Requires: %{name} = %{version}-%{release}
158 Provides: %{name}(DB_driver) = %{version}-%{release}
161 SQLite3 backend for libpreludedb
163 %description sqlite3 -l pl.UTF-8
164 Interfejs do SQLite3 do libpreludedb
166 %package -n python-libpreludedb
167 Summary: Python 2.x bindings for libpreludedb
168 Summary(pl.UTF-8): Wiązania Pythona 2.x do libpreludedb
169 Group: Development/Languages/Python
170 Requires: %{name}-c++ = %{version}-%{release}
172 %description -n python-libpreludedb
173 Python 2.x bindings for libpreludedb.
175 %description -n python-libpreludedb -l pl.UTF-8
176 Wiązania Pythona 2.x do libpreludedb.
178 %package -n python3-libpreludedb
179 Summary: Python 3.x bindings for libpreludedb
180 Summary(pl.UTF-8): Wiązania Pythona 3.x do libpreludedb
181 Group: Development/Languages/Python
182 Requires: %{name}-c++ = %{version}-%{release}
184 %description -n python3-libpreludedb
185 Python 3.x bindings for libpreludedb.
187 %description -n python3-libpreludedb -l pl.UTF-8
188 Wiązania Pythona 3.x do libpreludedb.
197 %{__rm} bindings/python/{_preludedb.cxx,preludedb.py}
202 %{__aclocal} -I m4 -I libmissing/m4
208 %{?with_static_libs:--enable-static} \
209 --with-html-dir=%{_gtkdocdir}/libpreludedb \
210 --with-mysql%{!?with_mysql:=no} \
211 --with-postgresql%{!?with_postgresql:=no} \
212 --with-python2%{!?with_python2:=no} \
213 --with-python3%{!?with_python3:=no} \
214 --with-sqlite%{!?with_sqlite3:=no} \
220 rm -rf $RPM_BUILD_ROOT
222 %{__make} -j1 install \
223 DESTDIR=$RPM_BUILD_ROOT \
224 pythondir=%{py_sitescriptdir} \
225 pyexecdir=%{py_sitedir} \
226 python3dir=%{py3_sitescriptdir} \
227 py3execdir=%{py3_sitedir}
229 %if %{without postgresql} && %{without mysql} && %{without sqlite3}
230 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/sql
233 # no *.la for plugins
234 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.la \
235 %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.a}
242 rm -rf $RPM_BUILD_ROOT
246 if [ "$1" = 1 ]; then
247 %banner -e %{name} <<EOF
249 Create new database and database user for prelude
250 (or update an existing one if needed) using templates from
251 %{_datadir}/%{name}/classic
252 for reference visit %{url}
257 %postun -p /sbin/ldconfig
259 %post c++ -p /sbin/ldconfig
260 %postun c++ -p /sbin/ldconfig
263 %defattr(644,root,root,755)
264 %doc ChangeLog LICENSE.README NEWS README
265 %attr(755,root,root) %{_bindir}/preludedb-admin
266 %attr(755,root,root) %{_libdir}/libpreludedb.so.*.*.*
267 %attr(755,root,root) %ghost %{_libdir}/libpreludedb.so.7
268 %dir %{_libdir}/%{name}
269 %dir %{_libdir}/%{name}/plugins
270 %dir %{_libdir}/%{name}/plugins/formats
271 %attr(755,root,root) %{_libdir}/%{name}/plugins/formats/classic.so
272 %dir %{_libdir}/%{name}/plugins/sql
273 %dir %{_datadir}/%{name}
274 %dir %{_datadir}/%{name}/classic
275 %{_mandir}/man1/preludedb-admin.1*
278 %defattr(644,root,root,755)
279 %attr(755,root,root) %{_bindir}/libpreludedb-config
280 %attr(755,root,root) %{_libdir}/libpreludedb.so
281 %{_libdir}/libpreludedb.la
282 %dir %{_includedir}/libpreludedb
283 %{_includedir}/libpreludedb/*.h
284 %{_aclocaldir}/libpreludedb.m4
285 %{_gtkdocdir}/libpreludedb
286 %{_mandir}/man1/libpreludedb-config.1*
288 %if %{with static_libs}
290 %defattr(644,root,root,755)
291 %{_libdir}/libpreludedb.a
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so.*.*.*
297 %attr(755,root,root) %ghost %{_libdir}/libpreludedbcpp.so.2
300 %defattr(644,root,root,755)
301 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so
302 %{_libdir}/libpreludedbcpp.la
303 %{_includedir}/libpreludedb/*.hxx
305 %if %{with static_libs}
307 %defattr(644,root,root,755)
308 %{_libdir}/libpreludedbcpp.a
311 %if %{with postgresql}
313 %defattr(644,root,root,755)
314 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/pgsql.so
315 %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2pgsql.sh
316 %{_datadir}/%{name}/classic/pgsql*.sql
321 %defattr(644,root,root,755)
322 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so
323 %{_datadir}/%{name}/classic/mysql*.sql
328 %defattr(644,root,root,755)
329 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/sqlite3.so
330 %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2sqlite.sh
331 %{_datadir}/%{name}/classic/sqlite*.sql
335 %files -n python-libpreludedb
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{py_sitedir}/_preludedb.so
338 %{py_sitedir}/preludedb.py[co]
339 %{py_sitedir}/preludedb-*-py*.egg-info
343 %files -n python3-libpreludedb
344 %defattr(644,root,root,755)
345 %attr(755,root,root) %{py3_sitedir}/_preludedb.cpython-*.so
346 %{py3_sitedir}/preludedb.py
347 %{py3_sitedir}/__pycache__/preludedb.cpython-*.py[co]
348 %{py3_sitedir}/preludedb-*-py*.egg-info