]> git.pld-linux.org Git - packages/libpreludedb.git/blob - libpreludedb.spec
ea7a0651dc98acad301c7394dde61a69d94689e0
[packages/libpreludedb.git] / libpreludedb.spec
1 #
2 # Conditional build:
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
9 #
10 Summary:        The PreludeDB Library
11 Summary(pl.UTF-8):      Biblioteka PreludeDB
12 Name:           libpreludedb
13 Version:        5.1.0
14 Release:        1
15 License:        GPL v2 or commercial
16 Group:          Libraries
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
27 BuildRequires:  bison
28 BuildRequires:  flex
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)
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
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
62 rodzaju/formatu.
63
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}
69 Requires:       libprelude-devel >= %{version}
70
71 %description devel
72 Header files and development documentation for libpreludedb.
73
74 %description devel -l pl.UTF-8
75 Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb.
76
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}
82
83 %description static
84 Static libpreludedb library.
85
86 %description static -l pl.UTF-8
87 Statyczna biblioteka libpreludedb.
88
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
129 %package pgsql
130 Summary:        PostgreSQL backend for libpreludedb
131 Summary(pl.UTF-8):      Interfejs do PostgreSQL dla libpreludedb
132 Group:          Libraries
133 Requires:       %{name} = %{version}-%{release}
134 Provides:       %{name}(DB_driver) = %{version}-%{release}
135
136 %description pgsql
137 PostgreSQL backend for libpreludedb
138
139 %description pgsql -l pl.UTF-8
140 Interfejs do PostgreSQL do libpreludedb
141
142 %package mysql
143 Summary:        MySQL backend for libpreludedb
144 Summary(pl.UTF-8):      Interfejs do MySQL dla libpreludedb
145 Group:          Libraries
146 Requires:       %{name} = %{version}-%{release}
147 Provides:       %{name}(DB_driver) = %{version}-%{release}
148
149 %description mysql
150 MySQL backend for libpreludedb
151
152 %description mysql -l pl.UTF-8
153 Interfejs do MySQL do libpreludedb
154
155 %package sqlite3
156 Summary:        SQLite3 backend for libpreludedb
157 Summary(pl.UTF-8):      Interfejs do SQLite3 dla libpreludedb
158 Group:          Libraries
159 Requires:       %{name} = %{version}-%{release}
160 Provides:       %{name}(DB_driver) = %{version}-%{release}
161
162 %description sqlite3
163 SQLite3 backend for libpreludedb
164
165 %description sqlite3 -l pl.UTF-8
166 Interfejs do SQLite3 do libpreludedb
167
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}
173
174 %description -n python-libpreludedb
175 Python 2.x bindings for libpreludedb.
176
177 %description -n python-libpreludedb -l pl.UTF-8
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.
191
192 %prep
193 %setup -q
194 %patch0 -p1
195 %patch1 -p1
196 %patch2 -p1
197 %patch3 -p1
198
199 %if %{with python3}
200 %{__rm} bindings/python/{_preludedb.cxx,preludedb.py}
201 %endif
202
203 %build
204 %{__gtkdocize}
205 %{__libtoolize}
206 %{__aclocal} -I m4 -I libmissing/m4
207 %{__autoconf}
208 %{__autoheader}
209 %{__automake}
210 %configure \
211         --enable-gtk-doc \
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} \
219         --with-swig
220
221 %{__make}
222
223 %install
224 rm -rf $RPM_BUILD_ROOT
225
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}
232
233 %if %{without pgsql} && %{without mysql} && %{without sqlite3}
234 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/sql
235 %endif
236
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}
240
241 %if %{with python2}
242 %py_postclean
243 %endif
244
245 %clean
246 rm -rf $RPM_BUILD_ROOT
247
248 %post
249 /sbin/ldconfig
250 if [ "$1" = 1 ]; then
251 %banner -e %{name} <<EOF
252
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}
257
258 EOF
259 fi
260
261 %postun -p /sbin/ldconfig
262
263 %post   c++ -p /sbin/ldconfig
264 %postun c++ -p /sbin/ldconfig
265
266 %files
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*
280
281 %files devel
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*
291
292 %if %{with static_libs}
293 %files static
294 %defattr(644,root,root,755)
295 %{_libdir}/libpreludedb.a
296 %endif
297
298 %files c++
299 %defattr(644,root,root,755)
300 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so.*.*.*
301 %attr(755,root,root) %ghost %{_libdir}/libpreludedbcpp.so.2
302
303 %files c++-devel
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so
306 %{_libdir}/libpreludedbcpp.la
307 %{_includedir}/libpreludedb/*.hxx
308
309 %if %{with static_libs}
310 %files c++-static
311 %defattr(644,root,root,755)
312 %{_libdir}/libpreludedbcpp.a
313 %endif
314
315 %if %{with pgsql}
316 %files pgsql
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
321 %endif
322
323 %if %{with mysql}
324 %files mysql
325 %defattr(644,root,root,755)
326 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so
327 %{_datadir}/%{name}/classic/mysql*.sql
328 %endif
329
330 %if %{with sqlite3}
331 %files sqlite3
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
336 %endif
337
338 %if %{with python2}
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
344 %endif
345
346 %if %{with python3}
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
353 %endif
This page took 0.093683 seconds and 2 git commands to generate.