mirror of https://github.com/Icinga/icinga2.git
Move decision about systemd/sysvinit to one location. Add files forgotten during merge.
Refs #4794
This commit is contained in:
parent
3d8bac59fe
commit
83528f660f
51
icinga2.spec
51
icinga2.spec
|
@ -27,7 +27,14 @@
|
||||||
%define apacheconfdir %{_sysconfdir}/httpd/conf.d
|
%define apacheconfdir %{_sysconfdir}/httpd/conf.d
|
||||||
%define apacheuser apache
|
%define apacheuser apache
|
||||||
%define apachegroup apache
|
%define apachegroup apache
|
||||||
|
%if 0%{?el5}%{?el6}
|
||||||
|
%define use_systemd 0
|
||||||
|
%else
|
||||||
|
# fedora and el>=7
|
||||||
|
%define use_systemd 1
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if "%{_vendor}" == "suse"
|
%if "%{_vendor}" == "suse"
|
||||||
# opensuse 13
|
# opensuse 13
|
||||||
%if 0%{?suse_version} >= 1310
|
%if 0%{?suse_version} >= 1310
|
||||||
|
@ -40,6 +47,7 @@
|
||||||
%define apacheconfdir %{_sysconfdir}/apache2/conf.d
|
%define apacheconfdir %{_sysconfdir}/apache2/conf.d
|
||||||
%define apacheuser wwwrun
|
%define apacheuser wwwrun
|
||||||
%define apachegroup www
|
%define apachegroup www
|
||||||
|
%define use_systemd 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%define icinga_user icinga
|
%define icinga_user icinga
|
||||||
|
@ -101,11 +109,6 @@ Requires: boost-thread >= 1.41
|
||||||
Requires: boost-regex >= 1.41
|
Requires: boost-regex >= 1.41
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?fedora}%{?el7}
|
|
||||||
BuildRequires: systemd
|
|
||||||
Requires: systemd
|
|
||||||
%endif
|
|
||||||
#redhat
|
#redhat
|
||||||
|
|
||||||
# suse
|
# suse
|
||||||
|
@ -137,6 +140,11 @@ Requires: libboost_regex%{opensuse_boost_version}
|
||||||
%endif
|
%endif
|
||||||
# suse
|
# suse
|
||||||
|
|
||||||
|
%if 0%{?use_systemd}
|
||||||
|
BuildRequires: systemd
|
||||||
|
Requires: systemd
|
||||||
|
%endif
|
||||||
|
|
||||||
Requires: %{name}-common = %{version}
|
Requires: %{name}-common = %{version}
|
||||||
|
|
||||||
%description bin
|
%description bin
|
||||||
|
@ -245,14 +253,13 @@ CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost141 \
|
||||||
-DBoost_NO_SYSTEM_PATHS=TRUE \
|
-DBoost_NO_SYSTEM_PATHS=TRUE \
|
||||||
-DBUILD_TESTING=FALSE \
|
-DBUILD_TESTING=FALSE \
|
||||||
-DBoost_NO_BOOST_CMAKE=TRUE"
|
-DBoost_NO_BOOST_CMAKE=TRUE"
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?fedora}
|
%if 0%{?use_systemd}
|
||||||
CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
|
CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
||||||
cmake $CMAKE_OPTS .
|
cmake $CMAKE_OPTS .
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
@ -299,10 +306,10 @@ exit 0
|
||||||
%else
|
%else
|
||||||
# rhel
|
# rhel
|
||||||
|
|
||||||
%if 0%{?el5}{?el6}
|
%if 0%{?use_systemd}
|
||||||
/sbin/chkconfig --add %{name}
|
|
||||||
%else
|
|
||||||
%systemd_post %{name}.service
|
%systemd_post %{name}.service
|
||||||
|
%else
|
||||||
|
/sbin/chkconfig --add %{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
if [ ${1:-0} -eq 1 ]
|
if [ ${1:-0} -eq 1 ]
|
||||||
|
@ -333,12 +340,12 @@ exit 0
|
||||||
%else
|
%else
|
||||||
# rhel
|
# rhel
|
||||||
|
|
||||||
%if 0%{?el5}{?el6}
|
%if 0%{?use_systemd}
|
||||||
|
%systemd_postun_with_restart %{name}.service
|
||||||
|
%else
|
||||||
if [ "$1" -ge "1" ]; then
|
if [ "$1" -ge "1" ]; then
|
||||||
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
|
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
|
||||||
fi
|
fi
|
||||||
%else
|
|
||||||
%systemd_postun_with_restart %{name}.service
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
if [ "$1" = "0" ]; then
|
if [ "$1" = "0" ]; then
|
||||||
|
@ -363,13 +370,13 @@ exit 0
|
||||||
%else
|
%else
|
||||||
# rhel
|
# rhel
|
||||||
|
|
||||||
%if 0%{?el5}{?el6}
|
%if 0%{?use_systemd}
|
||||||
|
%systemd_preun %{name}.service
|
||||||
|
%else
|
||||||
if [ "$1" = "0" ]; then
|
if [ "$1" = "0" ]; then
|
||||||
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
||||||
/sbin/chkconfig --del %{name} || :
|
/sbin/chkconfig --del %{name} || :
|
||||||
fi
|
fi
|
||||||
%else
|
|
||||||
%systemd_preun %{name}.service
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -435,10 +442,10 @@ exit 0
|
||||||
%files bin
|
%files bin
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog
|
%doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog
|
||||||
%if 0%{?el5}%{?el6}%{?opensuse_version}
|
%if 0%{?use_systemd}
|
||||||
%attr(755,-,-) %{_sysconfdir}/init.d/%{name}
|
|
||||||
%else
|
|
||||||
%attr(755,-,0) %{_unitdir}/%{name}.service
|
%attr(755,-,0) %{_unitdir}/%{name}.service
|
||||||
|
%else
|
||||||
|
%attr(755,-,-) %{_sysconfdir}/init.d/%{name}
|
||||||
%endif
|
%endif
|
||||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}
|
%attr(0750,%{icinga_user},%{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
|
||||||
|
@ -451,6 +458,7 @@ exit 0
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
|
||||||
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/sysdefines.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/*.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/*.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/localhost/*.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/localhost/*.conf
|
||||||
|
@ -463,6 +471,7 @@ exit 0
|
||||||
%{_bindir}/%{name}-sign-key
|
%{_bindir}/%{name}-sign-key
|
||||||
%{_sbindir}/%{name}-enable-feature
|
%{_sbindir}/%{name}-enable-feature
|
||||||
%{_sbindir}/%{name}-disable-feature
|
%{_sbindir}/%{name}-disable-feature
|
||||||
|
%{_sbindir}/%{name}-prepare-dirs
|
||||||
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
|
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
|
||||||
%exclude %{_libdir}/%{name}/libdb_ido_pgsql*
|
%exclude %{_libdir}/%{name}/libdb_ido_pgsql*
|
||||||
%{_libdir}/%{name}
|
%{_libdir}/%{name}
|
||||||
|
|
Loading…
Reference in New Issue