]>
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 |
67f9c2c8 | 13 | Version: 4.1.0 |
dcf802f7 | 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 |
67f9c2c8 JR |
18 | Source0: https://www.prelude-siem.org/attachments/download/832/%{name}-%{version}.tar.gz |
19 | # Source0-md5: d17807635724abb1d98ef592ef5fc3cf | |
6583ad89 JB |
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 | 30 | BuildRequires: libprelude-c++-devel >= %{version} |
eeba6e85 | 31 | BuildRequires: libprelude-swig >= %{version} |
6583ad89 JB |
32 | BuildRequires: libstdc++-devel |
33 | BuildRequires: libtool >= 2:1.5 | |
4426d2a4 | 34 | %{?with_mysql:BuildRequires: mysql-devel} |
5211581e | 35 | BuildRequires: pkgconfig |
19dfa763 | 36 | %{?with_postgresql:BuildRequires: postgresql-devel} |
6583ad89 JB |
37 | %{?with_python2:BuildRequires: python-devel >= 1:2.5} |
38 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
19dfa763 JB |
39 | BuildRequires: rpm-pythonprov |
40 | BuildRequires: rpmbuild(macros) >= 1.219 | |
8397b4e9 | 41 | %{?with_sqlite3:BuildRequires: sqlite3-devel >= 3.0.0} |
6583ad89 | 42 | BuildRequires: swig-python |
28c30f4d | 43 | Requires(post): /sbin/ldconfig |
4426d2a4 | 44 | Requires: %{name}(DB_driver) = %{version}-%{release} |
f99cb3c4 | 45 | Requires: libprelude-libs >= %{version} |
6583ad89 | 46 | Obsoletes: perl-libpreludedb |
5211581e AM |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
49 | %description | |
50 | The PreludeDB Library provides an abstraction layer upon the type and | |
51 | the format of the database used to store IDMEF alerts. It allows | |
52 | developers to use the Prelude IDMEF database easily and efficiently | |
53 | without worrying about SQL, and to access the database independently | |
54 | of the type/format of the database. | |
55 | ||
2dddb0a4 JR |
56 | %description -l pl.UTF-8 |
57 | Biblioteka PreludeDB dostarcza warstwę abstrakcji ponad rodzajem i | |
f99cb3c4 SP |
58 | formatem bazy danych używanej do przechowywania alarmów IDMEF. Pozwala |
59 | programistom łatwo i wydajnie używać bazy danych IDMEF Prelude nie | |
60 | martwiąc się o SQL i dostawać się do bazy niezależnie od jej | |
aca5d1e6 JB |
61 | rodzaju/formatu. |
62 | ||
19dfa763 JB |
63 | %package devel |
64 | Summary: Header files and development documentation for libpreludedb | |
65 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb | |
66 | Group: Development/Libraries | |
67 | Requires: %{name} = %{version}-%{release} | |
8397b4e9 | 68 | Requires: libprelude-devel >= %{version} |
4426d2a4 | 69 | |
19dfa763 JB |
70 | %description devel |
71 | Header files and development documentation for libpreludedb. | |
4426d2a4 | 72 | |
19dfa763 JB |
73 | %description devel -l pl.UTF-8 |
74 | Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb. | |
75 | ||
8397b4e9 JB |
76 | %package static |
77 | Summary: Static libpreludedb library | |
78 | Summary(pl.UTF-8): Statyczna biblioteka libpreludedb | |
79 | Group: Development/Libraries | |
80 | Requires: %{name}-devel = %{version}-%{release} | |
19dfa763 | 81 | |
8397b4e9 JB |
82 | %description static |
83 | Static libpreludedb library. | |
19dfa763 | 84 | |
8397b4e9 JB |
85 | %description static -l pl.UTF-8 |
86 | Statyczna biblioteka libpreludedb. | |
4426d2a4 | 87 | |
6583ad89 JB |
88 | %package c++ |
89 | Summary: C++ binding for libpreludedb | |
90 | Summary(pl.UTF-8): Interfejs C++ do libpreludedb | |
91 | Group: Libraries | |
92 | Requires: %{name} = %{version}-%{release} | |
93 | Requires: libprelude-c++ >= %{version} | |
94 | ||
95 | %description c++ | |
96 | C++ binding for libpreludedb. | |
97 | ||
98 | %description c++ -l pl.UTF-8 | |
99 | Interfejs C++ do libpreludedb. | |
100 | ||
101 | %package c++-devel | |
102 | Summary: Header files for libpreludedbcpp | |
103 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libpreludedbcpp | |
104 | Group: Development/Libraries | |
105 | Requires: %{name}-c++ = %{version}-%{release} | |
106 | Requires: %{name}-devel = %{version}-%{release} | |
107 | Requires: libprelude-c++-devel >= %{version} | |
108 | Requires: libstdc++-devel | |
109 | ||
110 | %description c++-devel | |
111 | Header files for libpreludedbcpp. | |
112 | ||
113 | %description c++-devel -l pl.UTF-8 | |
114 | Pliki nagłówkowe biblioteki libpreludedbcpp. | |
115 | ||
116 | %package c++-static | |
117 | Summary: Static libpreludedbcpp library | |
118 | Summary(pl.UTF-8): Statyczna biblioteka libpreludedbcpp | |
119 | Group: Development/Libraries | |
120 | Requires: %{name}-c++-devel = %{version}-%{release} | |
121 | ||
122 | %description c++-static | |
123 | Static libpreludedbcpp library. | |
124 | ||
125 | %description c++-static -l pl.UTF-8 | |
126 | Statyczna biblioteka libpreludedbcpp. | |
127 | ||
f213ae47 | 128 | %package pgsql |
4426d2a4 | 129 | Summary: PostgreSQL backend for libpreludedb |
c4642f9c | 130 | Summary(pl.UTF-8): Interfejs do PostgreSQL dla libpreludedb |
4426d2a4 AM |
131 | Group: Libraries |
132 | Requires: %{name} = %{version}-%{release} | |
133 | Provides: %{name}(DB_driver) = %{version}-%{release} | |
134 | ||
f213ae47 | 135 | %description pgsql |
4426d2a4 AM |
136 | PostgreSQL backend for libpreludedb |
137 | ||
2dddb0a4 | 138 | %description pgsql -l pl.UTF-8 |
4426d2a4 AM |
139 | Interfejs do PostgreSQL do libpreludedb |
140 | ||
f213ae47 | 141 | %package mysql |
4426d2a4 | 142 | Summary: MySQL backend for libpreludedb |
c4642f9c | 143 | Summary(pl.UTF-8): Interfejs do MySQL dla libpreludedb |
4426d2a4 AM |
144 | Group: Libraries |
145 | Requires: %{name} = %{version}-%{release} | |
146 | Provides: %{name}(DB_driver) = %{version}-%{release} | |
147 | ||
f213ae47 | 148 | %description mysql |
4426d2a4 AM |
149 | MySQL backend for libpreludedb |
150 | ||
2dddb0a4 | 151 | %description mysql -l pl.UTF-8 |
4426d2a4 AM |
152 | Interfejs do MySQL do libpreludedb |
153 | ||
f213ae47 | 154 | %package sqlite3 |
4426d2a4 | 155 | Summary: SQLite3 backend for libpreludedb |
c4642f9c | 156 | Summary(pl.UTF-8): Interfejs do SQLite3 dla libpreludedb |
4426d2a4 AM |
157 | Group: Libraries |
158 | Requires: %{name} = %{version}-%{release} | |
159 | Provides: %{name}(DB_driver) = %{version}-%{release} | |
160 | ||
f213ae47 | 161 | %description sqlite3 |
4426d2a4 AM |
162 | SQLite3 backend for libpreludedb |
163 | ||
2dddb0a4 | 164 | %description sqlite3 -l pl.UTF-8 |
4426d2a4 AM |
165 | Interfejs do SQLite3 do libpreludedb |
166 | ||
5211581e | 167 | %package -n python-libpreludedb |
6583ad89 JB |
168 | Summary: Python 2.x bindings for libpreludedb |
169 | Summary(pl.UTF-8): Wiązania Pythona 2.x do libpreludedb | |
5211581e | 170 | Group: Development/Languages/Python |
6583ad89 | 171 | Requires: %{name}-c++ = %{version}-%{release} |
5211581e AM |
172 | |
173 | %description -n python-libpreludedb | |
6583ad89 | 174 | Python 2.x bindings for libpreludedb. |
aca5d1e6 | 175 | |
2dddb0a4 | 176 | %description -n python-libpreludedb -l pl.UTF-8 |
6583ad89 JB |
177 | Wiązania Pythona 2.x do libpreludedb. |
178 | ||
179 | %package -n python3-libpreludedb | |
180 | Summary: Python 3.x bindings for libpreludedb | |
181 | Summary(pl.UTF-8): Wiązania Pythona 3.x do libpreludedb | |
182 | Group: Development/Languages/Python | |
183 | Requires: %{name}-c++ = %{version}-%{release} | |
184 | ||
185 | %description -n python3-libpreludedb | |
186 | Python 3.x bindings for libpreludedb. | |
187 | ||
188 | %description -n python3-libpreludedb -l pl.UTF-8 | |
189 | Wiązania Pythona 3.x do libpreludedb. | |
5211581e AM |
190 | |
191 | %prep | |
40858119 | 192 | %setup -q |
6537a80c | 193 | %patch0 -p1 |
8397b4e9 | 194 | %patch1 -p1 |
6583ad89 JB |
195 | %patch2 -p1 |
196 | ||
197 | %if %{with python3} | |
198 | %{__rm} bindings/python/{_preludedb.cxx,preludedb.py} | |
199 | %endif | |
5211581e AM |
200 | |
201 | %build | |
f48e2dc0 | 202 | %{__gtkdocize} |
8397b4e9 JB |
203 | %{__libtoolize} |
204 | %{__aclocal} -I m4 -I libmissing/m4 | |
205 | %{__autoconf} | |
206 | %{__autoheader} | |
207 | %{__automake} | |
5211581e | 208 | %configure \ |
19dfa763 | 209 | --enable-gtk-doc \ |
6583ad89 | 210 | %{?with_static_libs:--enable-static} \ |
4426d2a4 | 211 | --with-html-dir=%{_gtkdocdir}/libpreludedb \ |
6583ad89 JB |
212 | --with-mysql%{!?with_mysql:=no} \ |
213 | --with-postgresql%{!?with_postgresql:=no} \ | |
214 | --with-python2%{!?with_python2:=no} \ | |
215 | --with-python3%{!?with_python3:=no} \ | |
216 | --with-sqlite%{!?with_sqlite3:=no} \ | |
217 | --with-swig | |
5211581e AM |
218 | |
219 | %{__make} | |
220 | ||
221 | %install | |
222 | rm -rf $RPM_BUILD_ROOT | |
223 | ||
0f57acec | 224 | %{__make} -j1 install \ |
6583ad89 JB |
225 | DESTDIR=$RPM_BUILD_ROOT \ |
226 | pythondir=%{py_sitescriptdir} \ | |
227 | pyexecdir=%{py_sitedir} \ | |
228 | python3dir=%{py3_sitescriptdir} \ | |
229 | py3execdir=%{py3_sitedir} | |
5211581e | 230 | |
8397b4e9 JB |
231 | %if %{without postgresql} && %{without mysql} && %{without sqlite3} |
232 | install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/sql | |
233 | %endif | |
234 | ||
235 | # no *.la for plugins | |
6583ad89 JB |
236 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.la \ |
237 | %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.a} | |
f213ae47 | 238 | |
6583ad89 | 239 | %if %{with python2} |
19dfa763 | 240 | %py_postclean |
4426d2a4 | 241 | %endif |
5211581e AM |
242 | |
243 | %clean | |
244 | rm -rf $RPM_BUILD_ROOT | |
245 | ||
4426d2a4 | 246 | %post |
28c30f4d | 247 | /sbin/ldconfig |
4426d2a4 AM |
248 | if [ "$1" = 1 ]; then |
249 | %banner -e %{name} <<EOF | |
250 | ||
251 | Create new database and database user for prelude | |
252 | (or update an existing one if needed) using templates from | |
253 | %{_datadir}/%{name}/classic | |
254 | for reference visit %{url} | |
255 | ||
256 | EOF | |
257 | fi | |
258 | ||
28c30f4d | 259 | %postun -p /sbin/ldconfig |
4426d2a4 | 260 | |
6583ad89 JB |
261 | %post c++ -p /sbin/ldconfig |
262 | %postun c++ -p /sbin/ldconfig | |
263 | ||
5211581e AM |
264 | %files |
265 | %defattr(644,root,root,755) | |
19dfa763 | 266 | %doc ChangeLog LICENSE.README NEWS README |
eaa145c6 | 267 | %attr(755,root,root) %{_bindir}/preludedb-admin |
19dfa763 | 268 | %attr(755,root,root) %{_libdir}/libpreludedb.so.*.*.* |
6583ad89 | 269 | %attr(755,root,root) %ghost %{_libdir}/libpreludedb.so.7 |
5211581e AM |
270 | %dir %{_libdir}/%{name} |
271 | %dir %{_libdir}/%{name}/plugins | |
4426d2a4 | 272 | %dir %{_libdir}/%{name}/plugins/formats |
19dfa763 | 273 | %attr(755,root,root) %{_libdir}/%{name}/plugins/formats/classic.so |
4426d2a4 | 274 | %dir %{_libdir}/%{name}/plugins/sql |
4426d2a4 AM |
275 | %dir %{_datadir}/%{name} |
276 | %dir %{_datadir}/%{name}/classic | |
19dfa763 | 277 | %{_mandir}/man1/preludedb-admin.1* |
4426d2a4 | 278 | |
98a7a0b5 JB |
279 | %files devel |
280 | %defattr(644,root,root,755) | |
281 | %attr(755,root,root) %{_bindir}/libpreludedb-config | |
19dfa763 JB |
282 | %attr(755,root,root) %{_libdir}/libpreludedb.so |
283 | %{_libdir}/libpreludedb.la | |
6583ad89 JB |
284 | %dir %{_includedir}/libpreludedb |
285 | %{_includedir}/libpreludedb/*.h | |
19dfa763 | 286 | %{_aclocaldir}/libpreludedb.m4 |
98a7a0b5 | 287 | %{_gtkdocdir}/libpreludedb |
0f57acec | 288 | %{_mandir}/man1/libpreludedb-config.1* |
98a7a0b5 | 289 | |
6583ad89 | 290 | %if %{with static_libs} |
8397b4e9 JB |
291 | %files static |
292 | %defattr(644,root,root,755) | |
293 | %{_libdir}/libpreludedb.a | |
6583ad89 JB |
294 | %endif |
295 | ||
296 | %files c++ | |
297 | %defattr(644,root,root,755) | |
298 | %attr(755,root,root) %{_libdir}/libpreludedbcpp.so.*.*.* | |
299 | %attr(755,root,root) %ghost %{_libdir}/libpreludedbcpp.so.2 | |
300 | ||
301 | %files c++-devel | |
302 | %defattr(644,root,root,755) | |
303 | %attr(755,root,root) %{_libdir}/libpreludedbcpp.so | |
304 | %{_libdir}/libpreludedbcpp.la | |
305 | %{_includedir}/libpreludedb/*.hxx | |
306 | ||
307 | %if %{with static_libs} | |
308 | %files c++-static | |
309 | %defattr(644,root,root,755) | |
310 | %{_libdir}/libpreludedbcpp.a | |
311 | %endif | |
98a7a0b5 | 312 | |
4426d2a4 | 313 | %if %{with postgresql} |
f213ae47 | 314 | %files pgsql |
4426d2a4 | 315 | %defattr(644,root,root,755) |
19dfa763 JB |
316 | %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/pgsql.so |
317 | %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2pgsql.sh | |
318 | %{_datadir}/%{name}/classic/pgsql*.sql | |
4426d2a4 AM |
319 | %endif |
320 | ||
321 | %if %{with mysql} | |
f213ae47 | 322 | %files mysql |
4426d2a4 | 323 | %defattr(644,root,root,755) |
19dfa763 JB |
324 | %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so |
325 | %{_datadir}/%{name}/classic/mysql*.sql | |
4426d2a4 AM |
326 | %endif |
327 | ||
328 | %if %{with sqlite3} | |
f213ae47 | 329 | %files sqlite3 |
4426d2a4 | 330 | %defattr(644,root,root,755) |
19dfa763 JB |
331 | %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/sqlite3.so |
332 | %attr(755,root,root) %{_datadir}/%{name}/classic/mysql2sqlite.sh | |
333 | %{_datadir}/%{name}/classic/sqlite*.sql | |
4426d2a4 | 334 | %endif |
5211581e | 335 | |
6583ad89 | 336 | %if %{with python2} |
5211581e AM |
337 | %files -n python-libpreludedb |
338 | %defattr(644,root,root,755) | |
19dfa763 JB |
339 | %attr(755,root,root) %{py_sitedir}/_preludedb.so |
340 | %{py_sitedir}/preludedb.py[co] | |
8397b4e9 | 341 | %{py_sitedir}/preludedb-*-py*.egg-info |
4426d2a4 | 342 | %endif |
6583ad89 JB |
343 | |
344 | %if %{with python3} | |
345 | %files -n python3-libpreludedb | |
346 | %defattr(644,root,root,755) | |
347 | %attr(755,root,root) %{py3_sitedir}/_preludedb.cpython-*.so | |
348 | %{py3_sitedir}/preludedb.py | |
349 | %{py3_sitedir}/__pycache__/preludedb.cpython-*.py[co] | |
350 | %{py3_sitedir}/preludedb-*-py*.egg-info | |
351 | %endif |