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