File prelude-correlator.spec of Package prelude-correlator

#
# spec file for package prelude-correlator
#
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:             prelude-correlator
Version:          3.0.1
Release:          0
Summary:          Real time correlator of events received by Prelude Manager
License:          GPL-2.0+
Group:            Applications/Internet
Url:              https://www.prelude-siem.org
Source0:          https://www.prelude-siem.org/pkg/src/3.0.0/%{name}-%{version}.tar.gz
Source1:          %{name}.service
Source2:          %{name}.run
Patch0:           prelude-correlator-ez_setup.patch
Patch1:           prelude-correlator-main_py.patch
BuildRequires:    python-devel
BuildRequires:    python-setuptools
BuildRequires:    libprelude-devel
BuildRequires:    systemd
Requires:         python-setuptools
Requires:         python-netaddr
Requires:         python-libprelude
%{?systemd_requires}
BuildArch:        noarch

%description
Prelude-Correlator allows conducting multi-stream correlations
thanks to a powerful programming language for writing correlation
rules. With any type of alert able to be correlated, event
analysis becomes simpler, quicker and more incisive. This
correlation alert then appears within the Prewikka interface
and indicates the potential target information via the set of
correlation rules.

%prep
%setup -q

%patch0 -p0
%patch1 -p0

%build
python setup.py build

%install
python setup.py install --root=%{buildroot}
mkdir -p %{buildroot}/%{_sbindir}
install -d -m 0755 %{buildroot}/%{_tmpfilesdir}
install -m 0644 %{SOURCE2} %{buildroot}/%{_tmpfilesdir}/%{name}.conf
mkdir -p %{buildroot}/%{_localstatedir}/spool/prelude/%{name}/
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
rm -rf %{buildroot}/%{_localstatedir}/run/%{name}
install -D -m 444 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service

%pre
%service_add_pre %{name}.service

%post
/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
%service_add_post %{name}.service

%preun
%service_del_preun %{name}.service

%postun
%service_del_postun %{name}.service

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING NEWS HACKING.README
%dir %attr(0750,-,-) %{_sysconfdir}/%{name}/
%config(noreplace) %attr(0640,-,-) %{_sysconfdir}/%{name}/%{name}.conf
%dir %attr(0750,-,-) %{_sysconfdir}/%{name}/rules
%dir %attr(0750,-,-) %{_sysconfdir}/%{name}/rules/python
%config(noreplace) %attr(0640,-,-) %{_sysconfdir}/%{name}/rules/python/*.py
%dir %attr(0750,-,-) %{_sysconfdir}/%{name}/conf.d
%config %attr(0640,-,-) %{_sysconfdir}/%{name}/conf.d/README
%{_bindir}/%{name}
%dir %{_var}/lib/%{name}
%{_var}/lib/%{name}/*
%{python_sitelib}/preludecorrelator/
%{python_sitelib}/prelude_correlator*.egg-info
%{_sbindir}/rc%{name}
%dir %{_tmpfilesdir}
%{_tmpfilesdir}/%{name}.conf
%dir %attr(0711,-,-) %{_localstatedir}/spool/prelude
%dir %{_localstatedir}/spool/prelude/%{name}
%{_unitdir}/%{name}.service

%changelog
openSUSE Build Service is sponsored by