prelude-manager/prelude-manager.spec

213 lines
7.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package prelude-manager
#
# 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/
#
%define POLICYCOREUTILSVER 2.0.78-1
%define SELINUXTARGETEDVER 3.7.19-279
Name: prelude-manager
Version: 3.0.0
Release: 0
Summary: Bus communication for all Prelude modules
License: GPL-2.0+
Group: Applications/Internet
Url: https://www.prelude-siem.org
Source0: https://www.prelude-siem.org/pkg/prelude/src/%{name}-%{version}.tar.gz
Source1: prelude-manager.service
Source2: prelude-manager.run
Patch0: prelude-manager-run-dir.patch
BuildRequires: libgnutls-devel
BuildRequires: pkg-config
BuildRequires: libpreludedb-devel
BuildRequires: libxml2-devel
BuildRequires: libprelude-devel
BuildRequires: libwrap0
BuildRequires: systemd
BuildRequires: tcpd-devel
%{?systemd_requires}
%description
Prelude-Manager is a high availability server that
accepts secured connections from distributed sensors
and saves received events to a media specified by the user
(database, log file, mail etc.). The server schedules and
establishes the priorities of treatment according to the
critical character and the source of the alerts.
%package -n prelude-manager-devel
Summary: Libraries, include files for Prelude-Manager
Group: Development/Libraries
Requires: prelude-manager = %{version}-%{release}
Requires: libpreludedb-devel
%description -n prelude-manager-devel
Header files and libraries for prelude-manager development.
%package -n prelude-manager-db-plugin
Summary: Database report plugin for Prelude Manager
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
%description -n prelude-manager-db-plugin
This plugin allows prelude-manager to write to database.
%package -n prelude-manager-xml-plugin
Summary: XML report plugin for Prelude Manager
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
%description -n prelude-manager-xml-plugin
This plugin adds XML logging capabilities to prelude-manager.
%package -n prelude-manager-smtp-plugin
Summary: SMTP alert plugin for Prelude Manager
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
%description -n prelude-manager-smtp-plugin
This plugin adds alerting by email capabilities to prelude-manager
%package selinux
Summary: SELinux policy for prelude-manager
Provides: selinux-policy-base
Group: System Environment/Base
BuildRequires: checkpolicy
BuildRequires: policycoreutils >= %{POLICYCOREUTILSVER}
BuildRequires: bzip2
BuildRequires: selinux-policy-devel
BuildRequires: selinux-policy
Requires(pre): policycoreutils >= %{POLICYCOREUTILSVER}
Requires(pre): coreutils
Requires(pre): selinux-policy-targeted >= %{SELINUXTARGETEDVER}
Requires: selinux-policy-targeted >= %{SELINUXTARGETEDVER}
Requires: prelude-manager = %{version}-%{release}
Requires(post): policycoreutils >= %{POLICYCOREUTILSVER}
Requires(postun): policycoreutils >= %{POLICYCOREUTILSVER}
BuildArch: noarch
%description selinux
Prelude-Manager is a high availability server that
accepts secured connections from distributed sensors
and saves received events to a media specified by the user
(database, log file, mail etc.). The server schedules and
establishes the priorities of treatment according to the
critical character and the source of the alerts.
%prep
%setup -q
%patch0 -p0
%build
%configure --with-libwrap
make %{?_smp_mflags}
cd $RPM_BUILD_DIR/%{name}-%{version}/selinux/
make
%install
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-%{version}
mkdir -p %{buildroot}/%{_localstatedir}/spool/prelude/%{name}/
mkdir -p %{buildroot}/%{_datadir}/selinux/targeted/
make install DESTDIR=%{buildroot} INSTALL="%{__install} -c -p"
install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/selinux/%{name}.pp.bz2 \
%{buildroot}/%{_datadir}/selinux/targeted/
rm -f %{buildroot}/%{_libdir}/%{name}/reports/*.la
rm -f %{buildroot}/%{_libdir}/%{name}/filters/*.la
rm -f %{buildroot}/%{_libdir}/%{name}/decodes/*.la
rm -f %{buildroot}/%{_defaultdocdir}/../%{name}/smtp/template.example
mkdir -p %{buildroot}/%{_sbindir}
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
install -d -m 0755 %{buildroot}/%{_tmpfilesdir}
install -m 0644 %{SOURCE2} %{buildroot}/%{_tmpfilesdir}/%{name}.conf
rm -rf %{buildroot}/%{_localstatedir}/run/%{name}
install -D -m 444 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
%pre
%service_add_pre %{name}.service
%post
/sbin/ldconfig
/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
%service_add_post %{name}.service
%post selinux
if [ $1 -eq 1 ]; then
/usr/sbin/semodule -s targeted -i %{_datadir}/selinux/targeted/%{name}.pp.bz2
/sbin/restorecon -R /dev/shm/ || :
else
/usr/sbin/semodule -n -s targeted -r prelude-manager 2>/dev/null || :
/usr/sbin/semodule -s targeted -i %{_datadir}/selinux/targeted/%{name}.pp.bz2
fi
%preun
%service_del_preun %{name}.service
%postun
/sbin/ldconfig
%service_del_postun %{name}.service
%postun selinux
semodule -n -s targeted -r prelude-manager 2>/dev/null || :
/sbin/restorecon -R /dev/shm/ || :
%files
%defattr(-,root,root,-)
%doc COPYING
%attr(0750,-,-) %dir %{_sysconfdir}/%{name}/
%config(noreplace) %attr(0640,-,-) %{_sysconfdir}/%{name}/prelude-manager.conf
%{_bindir}/%{name}
%dir %{_libdir}/%{name}/
%dir %{_libdir}/%{name}/filters/
%{_libdir}/%{name}/filters/*.so
%dir %{_libdir}/%{name}/reports/
%{_libdir}/%{name}/reports/debug.so
%{_libdir}/%{name}/reports/textmod.so
%dir %{_libdir}/%{name}/decodes/
%{_libdir}/%{name}/decodes/*.so
%attr(0750,-,-) %dir %{_localstatedir}/spool/prelude/%{name}/
%attr(0750,-,-) %dir %{_datadir}/%{name}/
%attr(0644,-,-) %{_mandir}/man1/prelude-manager.1.gz
%{_sbindir}/rcprelude-manager
%dir %{_tmpfilesdir}
%{_tmpfilesdir}/%{name}.conf
%{_unitdir}/%{name}.service
%files -n prelude-manager-db-plugin
%defattr(-,root,root,-)
%{_libdir}/%{name}/reports/db.so
%files -n prelude-manager-xml-plugin
%defattr(-,root,root,-)
%{_libdir}/%{name}/reports/xmlmod.so
%attr(0750,root,root) %dir %{_datadir}/%{name}/xmlmod/
%{_datadir}/%{name}/xmlmod/*
%files -n prelude-manager-smtp-plugin
%defattr(-,root,root,-)
%doc %attr(0644,root,root) plugins/reports/smtp/template.example
%{_libdir}/%{name}/reports/smtp.so
%files -n prelude-manager-devel
%defattr(-,root,root,-)
%dir %{_includedir}/%{name}/
%{_includedir}/%{name}/*
%files selinux
%{_datadir}/selinux/targeted/%{name}.pp.bz2
%changelog