]> git.pld-linux.org Git - packages/libpreludedb.git/blob - libpreludedb.spec
fix shebang
[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:        2
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 %{__sed} -i -e '1s,/usr/bin/env python,%{?with_python3:%{__python3}}%{!?with_python3:%{__python}},' \
204         preludedb-admin
205
206 %build
207 %{__gtkdocize}
208 %{__libtoolize}
209 %{__aclocal} -I m4 -I libmissing/m4
210 %{__autoconf}
211 %{__autoheader}
212 %{__automake}
213 %configure \
214         --enable-gtk-doc \
215         %{?with_static_libs:--enable-static} \
216         --with-html-dir=%{_gtkdocdir}/libpreludedb \
217         --with-mysql%{!?with_mysql:=no} \
218         --with-postgresql%{!?with_pgsql:=no} \
219         --with-python2%{!?with_python2:=no} \
220         --with-python3%{!?with_python3:=no} \
221         --with-sqlite%{!?with_sqlite3:=no} \
222         --with-swig
223
224 %{__make}
225
226 %install
227 rm -rf $RPM_BUILD_ROOT
228
229 %{__make} -j1 install \
230         DESTDIR=$RPM_BUILD_ROOT \
231         pythondir=%{py_sitescriptdir} \
232         pyexecdir=%{py_sitedir} \
233         python3dir=%{py3_sitescriptdir} \
234         py3execdir=%{py3_sitedir}
235
236 %if %{without pgsql} && %{without mysql} && %{without sqlite3}
237 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/sql
238 %endif
239
240 # no *.la for plugins
241 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.la \
242         %{?with_static_libs:$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*/*.a}
243
244 %if %{with python2}
245 %py_postclean
246 %endif
247
248 %clean
249 rm -rf $RPM_BUILD_ROOT
250
251 %post
252 /sbin/ldconfig
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
264 %postun -p /sbin/ldconfig
265
266 %post   c++ -p /sbin/ldconfig
267 %postun c++ -p /sbin/ldconfig
268
269 %files
270 %defattr(644,root,root,755)
271 %doc ChangeLog LICENSE.README NEWS README
272 %attr(755,root,root) %{_bindir}/preludedb-admin
273 %attr(755,root,root) %{_libdir}/libpreludedb.so.*.*.*
274 %attr(755,root,root) %ghost %{_libdir}/libpreludedb.so.7
275 %dir %{_libdir}/%{name}
276 %dir %{_libdir}/%{name}/plugins
277 %dir %{_libdir}/%{name}/plugins/formats
278 %attr(755,root,root) %{_libdir}/%{name}/plugins/formats/classic.so
279 %dir %{_libdir}/%{name}/plugins/sql
280 %dir %{_datadir}/%{name}
281 %dir %{_datadir}/%{name}/classic
282 %{_mandir}/man1/preludedb-admin.1*
283
284 %files devel
285 %defattr(644,root,root,755)
286 %attr(755,root,root) %{_bindir}/libpreludedb-config
287 %attr(755,root,root) %{_libdir}/libpreludedb.so
288 %{_libdir}/libpreludedb.la
289 %dir %{_includedir}/libpreludedb
290 %{_includedir}/libpreludedb/*.h
291 %{_aclocaldir}/libpreludedb.m4
292 %{_gtkdocdir}/libpreludedb
293 %{_mandir}/man1/libpreludedb-config.1*
294
295 %if %{with static_libs}
296 %files static
297 %defattr(644,root,root,755)
298 %{_libdir}/libpreludedb.a
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
317
318 %if %{with pgsql}
319 %files pgsql
320 %defattr(644,root,root,755)
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
324 %endif
325
326 %if %{with mysql}
327 %files mysql
328 %defattr(644,root,root,755)
329 %attr(755,root,root) %{_libdir}/%{name}/plugins/sql/mysql.so
330 %{_datadir}/%{name}/classic/mysql*.sql
331 %endif
332
333 %if %{with sqlite3}
334 %files sqlite3
335 %defattr(644,root,root,755)
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
339 %endif
340
341 %if %{with python2}
342 %files -n python-libpreludedb
343 %defattr(644,root,root,755)
344 %attr(755,root,root) %{py_sitedir}/_preludedb.so
345 %{py_sitedir}/preludedb.py[co]
346 %{py_sitedir}/preludedb-*-py*.egg-info
347 %endif
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
This page took 0.484493 seconds and 3 git commands to generate.