mirror of
https://git.icinga.com/packaging/rpm-icinga2.git
synced 2025-09-22 17:47:50 +02:00
Prepare split of daemon from bin package
This commit is contained in:
parent
88e09314ec
commit
01babd9e25
133
icinga2.spec
133
icinga2.spec
@ -88,6 +88,9 @@ Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
|
|||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Requires: %{name}-bin = %{version}-%{release}
|
Requires: %{name}-bin = %{version}-%{release}
|
||||||
|
Requires: %{name}-common = %{version}-%{release}
|
||||||
|
|
||||||
|
Conflicts: %{name}-common < %{version}-%{release}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Meta package for Icinga 2 Core, DB IDO and Web.
|
Meta package for Icinga 2 Core, DB IDO and Web.
|
||||||
@ -216,7 +219,7 @@ BuildRequires: mysql-devel
|
|||||||
BuildRequires: mysql-devel
|
BuildRequires: mysql-devel
|
||||||
%endif #suse
|
%endif #suse
|
||||||
|
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name}-bin = %{version}-%{release}
|
||||||
|
|
||||||
%description ido-mysql
|
%description ido-mysql
|
||||||
Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
|
Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
|
||||||
@ -231,7 +234,7 @@ BuildRequires: postgresql-devel >= 8.4
|
|||||||
%else
|
%else
|
||||||
BuildRequires: postgresql-devel
|
BuildRequires: postgresql-devel
|
||||||
%endif
|
%endif
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name}-bin = %{version}-%{release}
|
||||||
|
|
||||||
%description ido-pgsql
|
%description ido-pgsql
|
||||||
Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
|
Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
|
||||||
@ -247,7 +250,7 @@ Group: System/Base
|
|||||||
BuildRequires: checkpolicy
|
BuildRequires: checkpolicy
|
||||||
BuildRequires: hardlink
|
BuildRequires: hardlink
|
||||||
BuildRequires: selinux-policy-devel
|
BuildRequires: selinux-policy-devel
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name}-bin = %{version}-%{release}
|
||||||
Requires(post): policycoreutils-python
|
Requires(post): policycoreutils-python
|
||||||
Requires(postun): policycoreutils-python
|
Requires(postun): policycoreutils-python
|
||||||
|
|
||||||
@ -412,27 +415,16 @@ install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}
|
|||||||
|
|
||||||
install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc
|
install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc
|
||||||
|
|
||||||
%pre common
|
%pre
|
||||||
getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
|
|
||||||
getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
|
|
||||||
getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /sbin/nologin -r -d %{_localstatedir}/spool/%{name} -G %{icingacmd_group} -g %{icinga_group} %{icinga_user}
|
|
||||||
|
|
||||||
%if "%{_vendor}" == "suse"
|
%if "%{_vendor}" == "suse"
|
||||||
%if 0%{?use_systemd}
|
%if 0%{?use_systemd}
|
||||||
%service_add_pre %{name}.service
|
%service_add_pre %{name}.service
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%verifyscript common
|
|
||||||
%verify_permissions -e %{_rundir}/%{name}/cmd
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%post common
|
%post
|
||||||
# suse
|
# suse
|
||||||
%if "%{_vendor}" == "suse"
|
%if "%{_vendor}" == "suse"
|
||||||
%if 0%{?suse_version} >= 1310
|
|
||||||
%set_permissions %{_rundir}/%{name}/cmd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if 0%{?use_systemd}
|
%if 0%{?use_systemd}
|
||||||
%fillup_only %{name}
|
%fillup_only %{name}
|
||||||
%service_add_post %{name}.service
|
%service_add_post %{name}.service
|
||||||
@ -472,7 +464,36 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
# suse/rhel
|
# suse/rhel
|
||||||
|
|
||||||
%postun common
|
%preun
|
||||||
|
# suse
|
||||||
|
%if "%{_vendor}" == "suse"
|
||||||
|
|
||||||
|
%if 0%{?use_systemd}
|
||||||
|
%service_del_preun %{name}.service
|
||||||
|
%else
|
||||||
|
%stop_on_removal %{name}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%else
|
||||||
|
# rhel
|
||||||
|
|
||||||
|
%if 0%{?use_systemd}
|
||||||
|
%systemd_preun %{name}.service
|
||||||
|
%else
|
||||||
|
if [ "$1" = "0" ]; then
|
||||||
|
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
||||||
|
/sbin/chkconfig --del %{name} || :
|
||||||
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%endif
|
||||||
|
# suse / rhel
|
||||||
|
|
||||||
|
%postun
|
||||||
# suse
|
# suse
|
||||||
%if "%{_vendor}" == "suse"
|
%if "%{_vendor}" == "suse"
|
||||||
%if 0%{?use_systemd}
|
%if 0%{?use_systemd}
|
||||||
@ -503,37 +524,25 @@ fi
|
|||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%preun common
|
%pre common
|
||||||
# suse
|
getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
|
||||||
|
getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
|
||||||
|
getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /sbin/nologin -r -d %{_localstatedir}/spool/%{name} -G %{icingacmd_group} -g %{icinga_group} %{icinga_user}
|
||||||
|
|
||||||
%if "%{_vendor}" == "suse"
|
%if "%{_vendor}" == "suse"
|
||||||
|
%verifyscript common
|
||||||
%if 0%{?use_systemd}
|
%verify_permissions -e %{_rundir}/%{name}/cmd
|
||||||
%service_del_preun %{name}.service
|
|
||||||
%else
|
|
||||||
%stop_on_removal %{name}
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
exit 0
|
%post common
|
||||||
|
%if "%{_vendor}" == "suse"
|
||||||
%else
|
%if 0%{?suse_version} >= 1310
|
||||||
# rhel
|
%set_permissions %{_rundir}/%{name}/cmd
|
||||||
|
|
||||||
%if 0%{?use_systemd}
|
|
||||||
%systemd_preun %{name}.service
|
|
||||||
%else
|
|
||||||
if [ "$1" = "0" ]; then
|
|
||||||
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
|
||||||
/sbin/chkconfig --del %{name} || :
|
|
||||||
fi
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
# suse / rhel
|
|
||||||
|
|
||||||
%post ido-mysql
|
%post ido-mysql
|
||||||
if [ ${1:-0} -eq 1 ]
|
if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf ]
|
||||||
then
|
then
|
||||||
# initial installation, enable ido-mysql feature
|
# initial installation, enable ido-mysql feature
|
||||||
ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
|
ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
|
||||||
@ -550,7 +559,7 @@ fi
|
|||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%post ido-pgsql
|
%post ido-pgsql
|
||||||
if [ ${1:-0} -eq 1 ]
|
if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf ]
|
||||||
then
|
then
|
||||||
# initial installation, enable ido-pgsql feature
|
# initial installation, enable ido-pgsql feature
|
||||||
ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
|
ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
|
||||||
@ -594,22 +603,8 @@ fi
|
|||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc COPYING
|
%doc COPYING
|
||||||
|
|
||||||
%files bin
|
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md
|
|
||||||
%{_sbindir}/%{name}
|
|
||||||
%dir %{_libdir}/%{name}/sbin
|
|
||||||
%{_libdir}/%{name}/sbin/%{name}
|
|
||||||
%{plugindir}/check_nscp_api
|
|
||||||
%{_datadir}/%{name}
|
|
||||||
%exclude %{_datadir}/%{name}/include
|
|
||||||
%{_mandir}/man8/%{name}.8.gz
|
|
||||||
|
|
||||||
%files common
|
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md tools/syntax
|
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
||||||
%{_sysconfdir}/bash_completion.d/%{name}
|
|
||||||
%if 0%{?use_systemd}
|
%if 0%{?use_systemd}
|
||||||
%attr(644,root,root) %{_unitdir}/%{name}.service
|
%attr(644,root,root) %{_unitdir}/%{name}.service
|
||||||
%if 0%{?configure_systemd_limits}
|
%if 0%{?configure_systemd_limits}
|
||||||
@ -629,6 +624,11 @@ fi
|
|||||||
%else
|
%else
|
||||||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%dir %{_libexecdir}/%{name}
|
||||||
|
%{_libexecdir}/%{name}/prepare-dirs
|
||||||
|
%{_libexecdir}/%{name}/safe-reload
|
||||||
|
|
||||||
%attr(0750,root,%{icinga_group}) %dir %{_sysconfdir}/%{name}
|
%attr(0750,root,%{icinga_group}) %dir %{_sysconfdir}/%{name}
|
||||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
|
||||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
|
||||||
@ -643,9 +643,22 @@ fi
|
|||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
|
||||||
%config(noreplace) %{_sysconfdir}/%{name}/scripts/*
|
%config(noreplace) %{_sysconfdir}/%{name}/scripts/*
|
||||||
%dir %{_libexecdir}/%{name}
|
|
||||||
%{_libexecdir}/%{name}/prepare-dirs
|
%files bin
|
||||||
%{_libexecdir}/%{name}/safe-reload
|
%defattr(-,root,root,-)
|
||||||
|
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md
|
||||||
|
%{_sbindir}/%{name}
|
||||||
|
%dir %{_libdir}/%{name}/sbin
|
||||||
|
%{_libdir}/%{name}/sbin/%{name}
|
||||||
|
%{plugindir}/check_nscp_api
|
||||||
|
%{_datadir}/%{name}
|
||||||
|
%exclude %{_datadir}/%{name}/include
|
||||||
|
%{_mandir}/man8/%{name}.8.gz
|
||||||
|
|
||||||
|
%files common
|
||||||
|
%defattr(-,root,root,-)
|
||||||
|
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md tools/syntax
|
||||||
|
%{_sysconfdir}/bash_completion.d/%{name}
|
||||||
%attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
|
%attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
|
||||||
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
|
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
|
||||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash
|
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user