]>
Commit | Line | Data |
---|---|---|
4426d2a4 | 1 | # |
c0e7694e | 2 | # Conditional build: |
6583ad89 JB |
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 | |
cecbb030 | 6 | %bcond_without pgsql # PostgreSQL plugin |
6583ad89 JB |
7 | %bcond_without mysql # MySQL plugin |
8 | %bcond_without sqlite3 # SQLite3 plugin | |
c0e7694e | 9 | # |
5211581e | 10 | Summary: The PreludeDB Library |
c4642f9c | 11 | Summary(pl.UTF-8): Biblioteka PreludeDB |
5211581e | 12 | Name: libpreludedb |
38e01c2f | 13 | Version: 5.1.0 |
af932e7c | 14 | Release: 2 |
19dfa763 | 15 | License: GPL v2 or commercial |
5211581e | 16 | Group: Libraries |
6583ad89 | 17 | #Source0Download: https://www.prelude-siem.org/projects/prelude/files |
38e01c2f JR |
18 | Source0: https://www.prelude-siem.org/attachments/download/1171/%{name}-%{version}.tar.gz |
19 | # Source0-md5: 372b2e7b40e1cc451833370e19bb4ec7 | |
6583ad89 JB |
20 | Patch0: %{name}-lt.patch |
21 | Patch1: %{name}-link.patch | |
22 | Patch2: %{name}-python-install.patch | |
38e01c2f | 23 | Patch3: gtk-doc-1.32.patch |
6583ad89 | 24 | URL: https://www.prelude-siem.org/ |
8397b4e9 | 25 | BuildRequires: autoconf >= 2.59 |
6583ad89 | 26 | BuildRequires: automake >= 1:1.9 |
aca5d1e6 JB |
27 | BuildRequires: bison |
28 | BuildRequires: flex | |
19dfa763 | 29 | BuildRequires: gtk-doc >= 1.0 |
f99cb3c4 | 30 | BuildRequires: libprelude-devel >= %{version} |
6583ad89 | 31 | BuildRequires: libprelude-c++-devel >= %{version} |
eeba6e85 | 32 | BuildRequires: libprelude-swig >= %{version} |
6583ad89 JB |
33 | BuildRequires: libstdc++-devel |
34 | BuildRequires: libtool >= 2:1.5 | |
4426d2a4 | 35 | %{?with_mysql:BuildRequires: mysql-devel} |
5211581e | 36 | BuildRequires: pkgconfig |
cecbb030 | 37 | %{?with_pgsql:BuildRequires: postgresql-devel} |
6583ad89 JB |
38 | %{?with_python2:BuildRequires: python-devel >= 1:2.5} |
39 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
19dfa763 JB |
40 | BuildRequires: rpm-pythonprov |
41 | BuildRequires: rpmbuild(macros) >= 1.219 | |
8397b4e9 | 42 | %{?with_sqlite3:BuildRequires: sqlite3-devel >= 3.0.0} |
6583ad89 | 43 | BuildRequires: swig-python |
28c30f4d | 44 | Requires(post): /sbin/ldconfig |
4426d2a4 | 45 | Requires: %{name}(DB_driver) = %{version}-%{release} |
f99cb3c4 | 46 | Requires: libprelude-libs >= %{version} |
6583ad89 | 47 | Obsoletes: perl-libpreludedb |
5211581e AM |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
50 | %description | |
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. | |
56 | ||
2dddb0a4 JR |
57 | %description -l pl.UTF-8 |
58 | Biblioteka PreludeDB dostarcza warstwę abstrakcji ponad rodzajem i | |
f99cb3c4 SP |
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 | |
aca5d1e6 JB |
62 | rodzaju/formatu. |
63 | ||
19dfa763 JB |
64 | %package devel |
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} | |
8397b4e9 | 69 | Requires: libprelude-devel >= %{version} |
4426d2a4 | 70 | |
19dfa763 JB |
71 | %description devel |
72 | Header files and development documentation for libpreludedb. | |
4426d2a4 | 73 | |
19dfa763 JB |
74 | %description devel -l pl.UTF-8 |
75 | Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb. | |
76 | ||
8397b4e9 JB |
77 | %package static |
78 | Summary: Static libpreludedb library | |
79 | Summary(pl.UTF-8): Statyczna biblioteka libpreludedb | |
80 | Group: Development/Libraries | |
81 | Requires: %{name}-devel = %{version}-%{release} | |
19dfa763 | 82 | |
8397b4e9 JB |
83 | %description static |
84 | Static libpreludedb library. | |
19dfa763 | 85 | |
8397b4e9 JB |
86 | %description static -l pl.UTF-8 |
87 | Statyczna biblioteka libpreludedb. | |
4426d2a4 | 88 | |
6583ad89 JB |
89 | %package c++ |
90 | Summary: C++ binding for libpreludedb | |
91 | Summary(pl.UTF-8): Interfejs C++ do libpreludedb | |
92 | Group: Libraries | |
93 | Requires: %{name} = %{version}-%{release} | |
94 | Requires: libprelude-c++ >= %{version} | |
95 | ||
96 | %description c++ | |
97 | C++ binding for libpreludedb. | |
98 | ||
99 | %description c++ -l pl.UTF-8 | |
100 | Interfejs C++ do libpreludedb. | |
101 | ||
102 | %package c++-devel | |
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 | |
110 | ||
111 | %description c++-devel | |
112 | Header files for libpreludedbcpp. | |
113 | ||
114 | %description c++-devel -l pl.UTF-8 | |
115 | Pliki nagłówkowe biblioteki libpreludedbcpp. | |
116 | ||
117 | %package c++-static | |
118 | Summary: Static libpreludedbcpp library | |
119 | Summary(pl.UTF-8): Statyczna biblioteka libpreludedbcpp | |
120 | Group: Development/Libraries | |
121 | Requires: %{name}-c++-devel = %{version}-%{release} | |
122 | ||
123 | %description c++-static | |
124 | Static libpreludedbcpp library. | |
125 | ||
126 | %description c++-static -l pl.UTF-8 | |
127 | Statyczna biblioteka libpreludedbcpp. | |
128 | ||
f213ae47 | 129 | %package pgsql |
4426d2a4 | 130 | Summary: PostgreSQL backend for libpreludedb |
c4642f9c | 131 | Summary(pl.UTF-8): Interfejs do PostgreSQL dla libpreludedb |
4426d2a4 AM |
132 | Group: Libraries |
133 | Requires: %{name} = %{version}-%{release} | |
134 | Provides: %{name}(DB_driver) = %{version}-%{release} | |
135 | ||
f213ae47 | 136 | %description pgsql |
4426d2a4 AM |
137 | PostgreSQL backend for libpreludedb |
138 | ||
2dddb0a4 | 139 | %description pgsql -l pl.UTF-8 |
4426d2a4 AM |
140 | Interfejs do PostgreSQL do libpreludedb |
141 | ||
f213ae47 | 142 | %package mysql |
4426d2a4 | 143 | Summary: MySQL backend for libpreludedb |
c4642f9c | 144 | Summary(pl.UTF-8): Interfejs do MySQL dla libpreludedb |
4426d2a4 AM |
145 | Group: Libraries |
146 | Requires: %{name} = %{version}-%{release} | |
147 | Provides: %{name}(DB_driver) = %{version}-%{release} | |
148 | ||
f213ae47 | 149 | %description mysql |
4426d2a4 AM |
150 | MySQL backend for libpreludedb |
151 | ||
2dddb0a4 | 152 | %description mysql -l pl.UTF-8 |
4426d2a4 AM |
153 | Interfejs do MySQL do libpreludedb |
154 | ||
f213ae47 | 155 | %package sqlite3 |
4426d2a4 | 156 | Summary: SQLite3 backend for libpreludedb |
c4642f9c | 157 | Summary(pl.UTF-8): Interfejs do SQLite3 dla libpreludedb |
4426d2a4 AM |
158 | Group: Libraries |
159 | Requires: %{name} = %{version}-%{release} | |
160 | Provides: %{name}(DB_driver) = %{version}-%{release} | |
161 | ||
f213ae47 | 162 | %description sqlite3 |
4426d2a4 AM |
163 | SQLite3 backend for libpreludedb |
164 | ||
2dddb0a4 | 165 | %description sqlite3 -l pl.UTF-8 |
4426d2a4 AM |
166 | Interfejs do SQLite3 do libpreludedb |
167 | ||
5211581e | 168 | %package -n python-libpreludedb |
6583ad89 JB |
169 | Summary: Python 2.x bindings for libpreludedb |
170 | Summary(pl.UTF-8): Wiązania Pythona 2.x do libpreludedb | |
5211581e | 171 | Group: Development/Languages/Python |
6583ad89 | 172 | Requires: %{name}-c++ = %{version}-%{release} |
5211581e AM |
173 | |
174 | %description -n python-libpreludedb | |
6583ad89 | 175 | Python 2.x bindings for libpreludedb. |
aca5d1e6 | 176 | |
2dddb0a4 | 177 | %description -n python-libpreludedb -l pl.UTF-8 |
6583ad89 JB |
178 | Wiązania Pythona 2.x do libpreludedb. |
179 | ||
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} | |
185 | ||
186 | %description -n python3-libpreludedb | |
187 | Python 3.x bindings for libpreludedb. | |
188 | ||
189 | %description -n python3-libpreludedb -l pl.UTF-8 | |
190 | Wiązania Pythona 3.x do libpreludedb. | |
5211581e AM |
191 | |
192 | %prep | |
40858119 | 193 | %setup -q |
6537a80c | 194 | %patch0 -p1 |
8397b4e9 | 195 | %patch1 -p1 |
6583ad89 | 196 | %patch2 -p1 |
38e01c2f | 197 | %patch3 -p1 |
6583ad89 JB |
198 | |
199 | %if %{with python3} | |
200 | %{__rm} bindings/python/{_preludedb.cxx,preludedb.py} | |
201 | %endif | |
5211581e | 202 | |
aa9e5545 JP |
203 | %{__sed} -i -e '1s,/usr/bin/env python,%{?with_python3:%{__python3}}%{!?with_python3:%{__python}},' \ |
204 | preludedb-admin | |
205 | ||
5211581e | 206 | %build |
f48e2dc0 | 207 | %{__gtkdocize} |
8397b4e9 JB |
208 | %{__libtoolize} |
209 | %{__aclocal} -I m4 -I libmissing/m4 | |
210 | %{__autoconf} | |
211 | %{__autoheader} | |
212 | %{__automake} | |
5211581e | 213 | %configure \ |
19dfa763 | 214 | --enable-gtk-doc \ |
6583ad89 | 215 | %{?with_static_libs:--enable-static} \ |
4426d2a4 | 216 | --with-html-dir=%{_gtkdocdir}/libpreludedb \ |
6583ad89 | 217 | --with-mysql%{!?with_mysql:=no} \ |
cecbb030 | 218 | --with-postgresql%{!?with_pgsql:=no} \ |
6583ad89 JB |
219 | --with-python2%{!?with_python2:=no} \ |
220 | --with-python3%{!?with_python3:=no} \ | |
221 | --with-sqlite%{!?with_sqlite3:=no} \ | |
222 | --with-swig | |
5211581e AM |
223 | |
224 | %{__make} | |
225 | ||
226 | %install | |
227 | rm -rf $RPM_BUILD_ROOT | |
228 | ||
0f57acec | 229 | %{__make} -j1 install \ |
6583ad89 JB |
230 | DESTDIR=$RPM_BUILD_ROOT \ |
231 | pythondir=%{py_sitescriptdir} \ | |
232 | pyexecdir=%{py_sitedir} \ | |
233 | python3dir=%{py3_sitescriptdir} \ | |
234 | py3execdir=%{py3_sitedir} | |
5211581e | 235 | |
cecbb030 | 236 | %if %{without pgsql} && %{without mysql} && %{without sqlite3} |
8397b4e9 JB |
237 | install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/sql |
238 | %endif | |
239 | ||
240 | # no *.la for plugins | |
6583ad89 JB |
241 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.la \ |
242 | %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.a} | |
f213ae47 | 243 | |
6583ad89 | 244 | %if %{with python2} |
19dfa763 | 245 | %py_postclean |
4426d2a4 | 246 | %endif |
5211581e AM |
247 | |
248 | %clean | |
249 | rm -rf $RPM_BUILD_ROOT | |
250 | ||
4426d2a4 | 251 | %post |
28c30f4d | 252 | /sbin/ldconfig |
4426d2a4 AM |
253 | if [ "$1" = 1 ]; then |
254 | %banner -e %{name} <<EOF | |
255 | ||
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} | |
260 | ||
261 | EOF | |
262 | fi | |
263 | ||
28c30f4d | 264 | %postun -p /sbin/ldconfig |
4426d2a4 | 265 | |
6583ad89 JB |
266 | %post c++ -p /sbin/ldconfig |
267 | %postun c++ -p /sbin/ldconfig | |
268 | ||
5211581e AM |
269 | %files |
270 | %defattr(644,root,root,755) | |
19dfa763 | 271 | %doc ChangeLog LICENSE.README NEWS README |
eaa145c6 | 272 | %attr(755,root,root) %{_bindir}/preludedb-admin |
19dfa763 | 273 | %attr(755,root,root) %{_libdir}/libpreludedb.so.*.*.* |
6583ad89 | 274 | %attr(755,root,root) %ghost %{_libdir}/libpreludedb.so.7 |
5211581e AM |
275 | %dir %{_libdir}/%{name} |
276 | %dir %{_libdir}/%{name}/plugins | |
4426d2a4 | 277 | %dir %{_libdir}/%{name}/plugins/formats |
19dfa763 | 278 | %attr(755,root,root) %{_libdir}/%{name}/plugins/formats/classic.so |
4426d2a4 | 279 | %dir %{_libdir}/%{name}/plugins/sql |
4426d2a4 AM |
280 | %dir %{_datadir}/%{name} |
281 | %dir %{_datadir}/%{name}/classic | |
19dfa763 | 282 | %{_mandir}/man1/preludedb-admin.1* |
4426d2a4 | 283 | |
98a7a0b5 JB |
284 | %files devel |
285 | %defattr(644,root,root,755) | |
286 | %attr(755,root,root) %{_bindir}/libpreludedb-config | |
19dfa763 JB |
287 | %attr(755,root,root) %{_libdir}/libpreludedb.so |
288 | %{_libdir}/libpreludedb.la | |
6583ad89 JB |
289 | %dir %{_includedir}/libpreludedb |
290 | %{_includedir}/libpreludedb/*.h | |
19dfa763 | 291 | %{_aclocaldir}/libpreludedb.m4 |
98a7a0b5 | 292 | %{_gtkdocdir}/libpreludedb |
0f57acec | 293 | %{_mandir}/man1/libpreludedb-config.1* |
98a7a0b5 | 294 | |
6583ad89 | 295 | %if %{with static_libs} |
8397b4e9 JB |
296 | %files static |
297 | %defattr(644,root,root,755) | |
298 | %{_libdir}/libpreludedb.a | |
6583ad89 JB |
299 | %endif |
300 | ||
301 | %files c++ | |
302 | %defattr(644,root,root,755) | |
303 | %attr(755,root,root) %{_libdir}/libpreludedbcpp.so.*.*.* | |
304 | %attr(755,root,root) %ghost %{_libdir}/libpreludedbcpp.so.2 | |
305 | ||
306 | %files c++-devel | |
307 | %defattr(644,root,root,755) | |
308 | %attr(755,root,root) %{_libdir}/libpreludedbcpp.so | |
309 | %{_libdir}/libpreludedbcpp.la | |
310 | %{_includedir}/libpreludedb/*.hxx | |
311 | ||
312 | %if %{with static_libs} | |
313 | %files c++-static | |
314 | %defattr(644,root,root,755) | |
315 | %{_libdir}/libpreludedbcpp.a | |
316 | %endif | |
98a7a0b5 | 317 | |
cecbb030 | 318 | %if %{with pgsql} |
f213ae47 | 319 | %files pgsql |
4426d2a4 | 320 | %defattr(644,root,root,755) |
19dfa763 JB |
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 | |
4426d2a4 AM |
324 | %endif |
325 | ||
326 | %if %{with mysql} | |
f213ae47 | 327 | %files mysql |
4426d2a4 | 328 | %defattr(644,root,root,755) |
19dfa763 JB |
329 | %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so |
330 | %{_datadir}/%{name}/classic/mysql*.sql | |
4426d2a4 AM |
331 | %endif |
332 | ||
333 | %if %{with sqlite3} | |
f213ae47 | 334 | %files sqlite3 |
4426d2a4 | 335 | %defattr(644,root,root,755) |
19dfa763 JB |
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 | |
4426d2a4 | 339 | %endif |
5211581e | 340 | |
6583ad89 | 341 | %if %{with python2} |
5211581e AM |
342 | %files -n python-libpreludedb |
343 | %defattr(644,root,root,755) | |
19dfa763 JB |
344 | %attr(755,root,root) %{py_sitedir}/_preludedb.so |
345 | %{py_sitedir}/preludedb.py[co] | |
8397b4e9 | 346 | %{py_sitedir}/preludedb-*-py*.egg-info |
4426d2a4 | 347 | %endif |
6583ad89 JB |
348 | |
349 | %if %{with python3} | |
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 | |
356 | %endif |