]> git.pld-linux.org Git - packages/libpreludedb.git/blob - libpreludedb.spec
- updated to 3.1.0
[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  postgresql      # 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:        3.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/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
26 BuildRequires:  bison
27 BuildRequires:  flex
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)
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
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
60 rodzaju/formatu.
61
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}
67 Requires:       libprelude-devel >= %{version}
68
69 %description devel
70 Header files and development documentation for libpreludedb.
71
72 %description devel -l pl.UTF-8
73 Pliki nagłówkowe i dokumentacja programistyczna do libpreludedb.
74
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}
80
81 %description static
82 Static libpreludedb library.
83
84 %description static -l pl.UTF-8
85 Statyczna biblioteka libpreludedb.
86
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
127 %package pgsql
128 Summary:        PostgreSQL backend for libpreludedb
129 Summary(pl.UTF-8):      Interfejs do PostgreSQL dla libpreludedb
130 Group:          Libraries
131 Requires:       %{name} = %{version}-%{release}
132 Provides:       %{name}(DB_driver) = %{version}-%{release}
133
134 %description pgsql
135 PostgreSQL backend for libpreludedb
136
137 %description pgsql -l pl.UTF-8
138 Interfejs do PostgreSQL do libpreludedb
139
140 %package mysql
141 Summary:        MySQL backend for libpreludedb
142 Summary(pl.UTF-8):      Interfejs do MySQL dla libpreludedb
143 Group:          Libraries
144 Requires:       %{name} = %{version}-%{release}
145 Provides:       %{name}(DB_driver) = %{version}-%{release}
146
147 %description mysql
148 MySQL backend for libpreludedb
149
150 %description mysql -l pl.UTF-8
151 Interfejs do MySQL do libpreludedb
152
153 %package sqlite3
154 Summary:        SQLite3 backend for libpreludedb
155 Summary(pl.UTF-8):      Interfejs do SQLite3 dla libpreludedb
156 Group:          Libraries
157 Requires:       %{name} = %{version}-%{release}
158 Provides:       %{name}(DB_driver) = %{version}-%{release}
159
160 %description sqlite3
161 SQLite3 backend for libpreludedb
162
163 %description sqlite3 -l pl.UTF-8
164 Interfejs do SQLite3 do libpreludedb
165
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}
171
172 %description -n python-libpreludedb
173 Python 2.x bindings for libpreludedb.
174
175 %description -n python-libpreludedb -l pl.UTF-8
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.
189
190 %prep
191 %setup -q
192 %patch0 -p1
193 %patch1 -p1
194 %patch2 -p1
195
196 %if %{with python3}
197 %{__rm} bindings/python/{_preludedb.cxx,preludedb.py}
198 %endif
199
200 %build
201 %{__libtoolize}
202 %{__aclocal} -I m4 -I libmissing/m4
203 %{__autoconf}
204 %{__autoheader}
205 %{__automake}
206 %configure \
207         --enable-gtk-doc \
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} \
215         --with-swig
216
217 %{__make}
218
219 %install
220 rm -rf $RPM_BUILD_ROOT
221
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}
228
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
234 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.la \
235         %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.a}
236
237 %if %{with python2}
238 %py_postclean
239 %endif
240
241 %clean
242 rm -rf $RPM_BUILD_ROOT
243
244 %post
245 /sbin/ldconfig
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
257 %postun -p /sbin/ldconfig
258
259 %post   c++ -p /sbin/ldconfig
260 %postun c++ -p /sbin/ldconfig
261
262 %files
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*
276
277 %files devel
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*
287
288 %if %{with static_libs}
289 %files static
290 %defattr(644,root,root,755)
291 %{_libdir}/libpreludedb.a
292 %endif
293
294 %files c++
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so.*.*.*
297 %attr(755,root,root) %ghost %{_libdir}/libpreludedbcpp.so.2
298
299 %files c++-devel
300 %defattr(644,root,root,755)
301 %attr(755,root,root) %{_libdir}/libpreludedbcpp.so
302 %{_libdir}/libpreludedbcpp.la
303 %{_includedir}/libpreludedb/*.hxx
304
305 %if %{with static_libs}
306 %files c++-static
307 %defattr(644,root,root,755)
308 %{_libdir}/libpreludedbcpp.a
309 %endif
310
311 %if %{with postgresql}
312 %files pgsql
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
317 %endif
318
319 %if %{with mysql}
320 %files mysql
321 %defattr(644,root,root,755)
322 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so
323 %{_datadir}/%{name}/classic/mysql*.sql
324 %endif
325
326 %if %{with sqlite3}
327 %files sqlite3
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
332 %endif
333
334 %if %{with python2}
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
340 %endif
341
342 %if %{with python3}
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
349 %endif
This page took 0.072029 seconds and 3 git commands to generate.