|
@@ -1,5 +1,4 @@
|
|
-%define ver 4.0.15
|
|
|
|
-%define rel 1
|
|
|
|
|
|
+%bcond_with systemd
|
|
|
|
|
|
%define only_agent 0
|
|
%define only_agent 0
|
|
|
|
|
|
@@ -17,21 +16,35 @@
|
|
|
|
|
|
Summary: The Enterprise-class Monitoring Solution for Everyone
|
|
Summary: The Enterprise-class Monitoring Solution for Everyone
|
|
Name: zabbix
|
|
Name: zabbix
|
|
-Version: %{ver}
|
|
|
|
-Release: %{rel}%{?_dist_release}
|
|
|
|
-License: GPLv2
|
|
|
|
|
|
+Version: 4.0.19
|
|
|
|
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
Group: Applications/Services
|
|
Group: Applications/Services
|
|
|
|
+Vendor: Project Vine
|
|
|
|
+Distribution: Vine Linux
|
|
|
|
+Packager: iwaim
|
|
|
|
+
|
|
|
|
+License: GPLv2
|
|
URL: https://www.zabbix.com/
|
|
URL: https://www.zabbix.com/
|
|
-Source0: https://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/%{version}/%{name}-%{version}.tar.gz
|
|
|
|
|
|
+Source0: https://cdn.zabbix.com/stable/%{version}/%{name}-%{version}.tar.gz
|
|
Source1: zabbix_server.init
|
|
Source1: zabbix_server.init
|
|
Source2: zabbix_proxy.init
|
|
Source2: zabbix_proxy.init
|
|
Source3: zabbix_agentd.init
|
|
Source3: zabbix_agentd.init
|
|
Source4: zabbix_server.logrotate
|
|
Source4: zabbix_server.logrotate
|
|
Source5: zabbix_proxy.logrotate
|
|
Source5: zabbix_proxy.logrotate
|
|
Source6: zabbix_agentd.logrotate
|
|
Source6: zabbix_agentd.logrotate
|
|
|
|
+
|
|
|
|
+Source9: %{name}-tmpfiles-zabbix.conf
|
|
|
|
+# systemd units -- Alternatives switches between them (they state their dependencies)
|
|
|
|
+# https://support.zabbix.com/browse/ZBXNEXT-1593
|
|
|
|
+Source10: %{name}-agent.service
|
|
|
|
+Source11: %{name}-proxy-mysql.service
|
|
|
|
+Source12: %{name}-proxy-pgsql.service
|
|
|
|
+Source14: %{name}-server-mysql.service
|
|
|
|
+Source15: %{name}-server-pgsql.service
|
|
|
|
+Source17: %{name}-tmpfiles-zabbixsrv.conf
|
|
|
|
+
|
|
Patch1: 0001-change-the-font-for-Vine-Linux.patch
|
|
Patch1: 0001-change-the-font-for-Vine-Linux.patch
|
|
Patch2: 0002-modified-config-files-for-Vine-Linux.patch
|
|
Patch2: 0002-modified-config-files-for-Vine-Linux.patch
|
|
-Patch3: zabbix-4.0.15-php74.patch
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
|
%if %{with server}%{with proxy}
|
|
%if %{with server}%{with proxy}
|
|
BuildRequires: libpq-devel
|
|
BuildRequires: libpq-devel
|
|
@@ -46,10 +59,9 @@ BuildRequires: unixODBC-devel
|
|
BuildRequires: libssh2-devel
|
|
BuildRequires: libssh2-devel
|
|
Requires(pre): glibc-common
|
|
Requires(pre): glibc-common
|
|
Requires(pre): shadow-utils
|
|
Requires(pre): shadow-utils
|
|
-
|
|
|
|
-Vendor: Project Vine
|
|
|
|
-Distribution: Vine Linux
|
|
|
|
-Packager: iwaim
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+BuildRequires: systemd
|
|
|
|
+%endif
|
|
|
|
|
|
%description
|
|
%description
|
|
The Enterprise-class Monitoring Solution for Everyone.
|
|
The Enterprise-class Monitoring Solution for Everyone.
|
|
@@ -58,8 +70,12 @@ The Enterprise-class Monitoring Solution for Everyone.
|
|
%package server-common
|
|
%package server-common
|
|
Summary: common files for Zabbix Server
|
|
Summary: common files for Zabbix Server
|
|
Requires: %{name} == %{version}-%{release}
|
|
Requires: %{name} == %{version}-%{release}
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{?systemd_requires}
|
|
|
|
+%else
|
|
Requires(post,preun): chkconfig
|
|
Requires(post,preun): chkconfig
|
|
Requires(preun,postun): initscripts
|
|
Requires(preun,postun): initscripts
|
|
|
|
+%endif
|
|
|
|
|
|
%description server-common
|
|
%description server-common
|
|
This package include common files for Zabbix Server.
|
|
This package include common files for Zabbix Server.
|
|
@@ -86,8 +102,12 @@ Zabbix Server for PostgreSQL
|
|
%package agent
|
|
%package agent
|
|
Summary: Zabbix Agent
|
|
Summary: Zabbix Agent
|
|
Requires: %{name} == %{version}-%{release}
|
|
Requires: %{name} == %{version}-%{release}
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{?systemd_requires}
|
|
|
|
+%else
|
|
Requires(post,preun): chkconfig
|
|
Requires(post,preun): chkconfig
|
|
Requires(preun,postun): initscripts
|
|
Requires(preun,postun): initscripts
|
|
|
|
+%endif
|
|
|
|
|
|
%description agent
|
|
%description agent
|
|
Zabbix Agent
|
|
Zabbix Agent
|
|
@@ -98,8 +118,12 @@ Zabbix Agent
|
|
%package proxy-common
|
|
%package proxy-common
|
|
Summary: common files for Zabbix Proxy
|
|
Summary: common files for Zabbix Proxy
|
|
Requires: %{name} == %{version}-%{release}
|
|
Requires: %{name} == %{version}-%{release}
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{?systemd_requires}
|
|
|
|
+%else
|
|
Requires(post,preun): chkconfig
|
|
Requires(post,preun): chkconfig
|
|
Requires(preun,postun): initscripts
|
|
Requires(preun,postun): initscripts
|
|
|
|
+%endif
|
|
|
|
|
|
%description proxy-common
|
|
%description proxy-common
|
|
This package include common files for Zabbix Proxy
|
|
This package include common files for Zabbix Proxy
|
|
@@ -126,7 +150,7 @@ Zabbix Proxy for PostgreSQL
|
|
%package frontend-php
|
|
%package frontend-php
|
|
Summary: Zabbix web frontend with PHP
|
|
Summary: Zabbix web frontend with PHP
|
|
Group: Applications/Internet
|
|
Group: Applications/Internet
|
|
-Requires: php5
|
|
|
|
|
|
+Requires: php74
|
|
Requires: TrueType-vlgothic
|
|
Requires: TrueType-vlgothic
|
|
|
|
|
|
%description frontend-php
|
|
%description frontend-php
|
|
@@ -136,7 +160,7 @@ Zabbix web frontend with PHP.
|
|
Summary: Zabbix web frontend with PHP and MySQL/MariaDB
|
|
Summary: Zabbix web frontend with PHP and MySQL/MariaDB
|
|
Group: Applications/Internet
|
|
Group: Applications/Internet
|
|
Provides: %{name}-frontend-php == %{version}-%{release}
|
|
Provides: %{name}-frontend-php == %{version}-%{release}
|
|
-Requires: php5-mysql
|
|
|
|
|
|
+Requires: php74-mysql
|
|
|
|
|
|
%description frontend-php-mysql
|
|
%description frontend-php-mysql
|
|
Zabbix web frontend with PHP and MySQL/MariaDB.
|
|
Zabbix web frontend with PHP and MySQL/MariaDB.
|
|
@@ -145,7 +169,7 @@ Zabbix web frontend with PHP and MySQL/MariaDB.
|
|
Summary: Zabbix web frontend with PHP and PostgreSQL
|
|
Summary: Zabbix web frontend with PHP and PostgreSQL
|
|
Group: Applications/Internet
|
|
Group: Applications/Internet
|
|
Provides: %{name}-frontend-php == %{version}-%{release}
|
|
Provides: %{name}-frontend-php == %{version}-%{release}
|
|
-Requires: php5-pgsql
|
|
|
|
|
|
+Requires: php74-pgsql
|
|
|
|
|
|
%description frontend-php-postgresql
|
|
%description frontend-php-postgresql
|
|
Zabbix web frontend with PHP and PostgreSQL.
|
|
Zabbix web frontend with PHP and PostgreSQL.
|
|
@@ -158,7 +182,6 @@ mv zabbix-%{version} zabbix_mysql
|
|
pushd zabbix_mysql
|
|
pushd zabbix_mysql
|
|
%patch1 -p 1
|
|
%patch1 -p 1
|
|
%patch2 -p 1
|
|
%patch2 -p 1
|
|
-%patch3 -p 1
|
|
|
|
popd
|
|
popd
|
|
|
|
|
|
%if %{with server}%{with proxy}
|
|
%if %{with server}%{with proxy}
|
|
@@ -167,10 +190,32 @@ mv zabbix-%{version} zabbix_pgsql
|
|
pushd zabbix_pgsql
|
|
pushd zabbix_pgsql
|
|
%patch1 -p 1
|
|
%patch1 -p 1
|
|
%patch2 -p 1
|
|
%patch2 -p 1
|
|
-%patch3 -p 1
|
|
|
|
popd
|
|
popd
|
|
%endif
|
|
%endif
|
|
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+# Specific
|
|
|
|
+for v in mysql pgsql; do
|
|
|
|
+pushd zabbix_$v
|
|
|
|
+sed -i \
|
|
|
|
+ -e '\|^# PidFile=.*|a PidFile=/run/zabbix/zabbix_agentd.pid' \
|
|
|
|
+ -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_agentd.log|' \
|
|
|
|
+ conf/zabbix_agentd.conf
|
|
|
|
+
|
|
|
|
+sed -i \
|
|
|
|
+ -e '\|^# PidFile=.*|a PidFile=/run/zabbix/zabbix_proxy.pid' \
|
|
|
|
+ -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_proxy.log|' \
|
|
|
|
+ conf/zabbix_proxy.conf
|
|
|
|
+
|
|
|
|
+sed -i \
|
|
|
|
+ -e '\|^# PidFile=.*|a PidFile=/run/zabbix/zabbix_server.pid' \
|
|
|
|
+ -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_server.log|' \
|
|
|
|
+ conf/zabbix_server.conf
|
|
|
|
+popd
|
|
|
|
+done
|
|
|
|
+
|
|
|
|
+%endif
|
|
|
|
+
|
|
%build
|
|
%build
|
|
|
|
|
|
Build()
|
|
Build()
|
|
@@ -209,9 +254,9 @@ popd
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%install
|
|
%install
|
|
-%__rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
+%__rm -rf %{buildroot}
|
|
pushd zabbix_mysql
|
|
pushd zabbix_mysql
|
|
-make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
|
+make DESTDIR=%{buildroot} install
|
|
|
|
|
|
%if %{with server}
|
|
%if %{with server}
|
|
mv -f %{buildroot}%{_sbindir}/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.mysql
|
|
mv -f %{buildroot}%{_sbindir}/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.mysql
|
|
@@ -221,47 +266,63 @@ mv -f %{buildroot}%{_sbindir}/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.
|
|
%endif
|
|
%endif
|
|
|
|
|
|
# make directories
|
|
# make directories
|
|
-%__mkdir_p $RPM_BUILD_ROOT%{_localstatedir}/{log,run}/%{name}
|
|
|
|
|
|
+%__mkdir_p %{buildroot}%{_localstatedir}/{log,run}/%{name}
|
|
|
|
|
|
# DB
|
|
# DB
|
|
-%__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix
|
|
|
|
|
|
+%__mkdir_p %{buildroot}%{_datadir}/zabbix
|
|
%if %{with server}%{with proxy}
|
|
%if %{with server}%{with proxy}
|
|
-%__cp -a database/postgresql $RPM_BUILD_ROOT%{_datadir}/zabbix/
|
|
|
|
-%__cp -a database/mysql $RPM_BUILD_ROOT%{_datadir}/zabbix/
|
|
|
|
|
|
+%__cp -a database/postgresql %{buildroot}%{_datadir}/zabbix/
|
|
|
|
+%__cp -a database/mysql %{buildroot}%{_datadir}/zabbix/
|
|
%endif
|
|
%endif
|
|
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+# unit files
|
|
|
|
+%__mkdir_p %{buildroot}%{_unitdir}
|
|
|
|
+# Install different systemd units because of the requirements for DBMS daemons
|
|
|
|
+install -m 0644 -p %{SOURCE10} %{buildroot}%{_unitdir}/zabbix-agent.service
|
|
|
|
+install -m 0644 -p %{SOURCE11} %{buildroot}%{_unitdir}/zabbix-proxy-mysql.service
|
|
|
|
+install -m 0644 -p %{SOURCE12} %{buildroot}%{_unitdir}/zabbix-proxy-pgsql.service
|
|
|
|
+install -m 0644 -p %{SOURCE14} %{buildroot}%{_unitdir}/zabbix-server-mysql.service
|
|
|
|
+install -m 0644 -p %{SOURCE15} %{buildroot}%{_unitdir}/zabbix-server-pgsql.service
|
|
|
|
+
|
|
|
|
+# systemd tmpfiles
|
|
|
|
+mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
|
|
|
|
+install -m 0644 -p %{SOURCE9} %{buildroot}%{_prefix}/lib/tmpfiles.d/zabbix.conf
|
|
|
|
+
|
|
|
|
+%else
|
|
# init.d
|
|
# init.d
|
|
-%__mkdir_p $RPM_BUILD_ROOT%{_initddir}
|
|
|
|
|
|
+%__mkdir_p %{buildroot}%{_initddir}
|
|
%if %{with server}
|
|
%if %{with server}
|
|
-%__cp %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/zabbix_server
|
|
|
|
|
|
+%__cp %{SOURCE1} %{buildroot}%{_initddir}/zabbix_server
|
|
%endif
|
|
%endif
|
|
%if %{with proxy}
|
|
%if %{with proxy}
|
|
-%__cp %{SOURCE2} $RPM_BUILD_ROOT%{_initddir}/zabbix_proxy
|
|
|
|
|
|
+%__cp %{SOURCE2} %{buildroot}%{_initddir}/zabbix_proxy
|
|
%endif
|
|
%endif
|
|
%if %{with agent}
|
|
%if %{with agent}
|
|
-%__cp %{SOURCE3} $RPM_BUILD_ROOT%{_initddir}/zabbix_agentd
|
|
|
|
|
|
+%__cp %{SOURCE3} %{buildroot}%{_initddir}/zabbix_agentd
|
|
|
|
+%endif
|
|
%endif
|
|
%endif
|
|
|
|
|
|
# logrotate
|
|
# logrotate
|
|
-%__mkdir_p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
|
|
|
|
|
|
+%__mkdir_p %{buildroot}%{_sysconfdir}/logrotate.d
|
|
%if %{with server}
|
|
%if %{with server}
|
|
-%__cp %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_server
|
|
|
|
|
|
+%__cp %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/zabbix_server
|
|
%endif
|
|
%endif
|
|
%if %{with proxy}
|
|
%if %{with proxy}
|
|
-%__cp %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_proxy
|
|
|
|
|
|
+%__cp %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/zabbix_proxy
|
|
%endif
|
|
%endif
|
|
%if %{with agent}
|
|
%if %{with agent}
|
|
-%__cp %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_agentd
|
|
|
|
|
|
+%__cp %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/zabbix_agentd
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with frontend}
|
|
%if %{with frontend}
|
|
# frontend-php
|
|
# frontend-php
|
|
-%__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend
|
|
|
|
-%__cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/
|
|
|
|
-%__rm -f $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/assets/fonts/DejaVuSans.ttf
|
|
|
|
|
|
+%__mkdir_p %{buildroot}%{_datadir}/zabbix-frontend
|
|
|
|
+%__cp -a frontends/php %{buildroot}%{_datadir}/zabbix-frontend/
|
|
|
|
+%__rm -f %{buildroot}%{_datadir}/zabbix-frontend/php/assets/fonts/DejaVuSans.ttf
|
|
|
|
|
|
ln -s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf \
|
|
ln -s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf \
|
|
- $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/assets/fonts/
|
|
|
|
|
|
+ %{buildroot}%{_datadir}/zabbix-frontend/php/assets/fonts/
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with proxy}
|
|
%if %{with proxy}
|
|
@@ -281,7 +342,7 @@ popd
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%clean
|
|
%clean
|
|
-%__rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
+%__rm -rf %{buildroot}
|
|
|
|
|
|
%pre
|
|
%pre
|
|
getent group zabbix >/dev/null || groupadd -r zabbix
|
|
getent group zabbix >/dev/null || groupadd -r zabbix
|
|
@@ -292,115 +353,164 @@ exit 0
|
|
|
|
|
|
%if %{with server}
|
|
%if %{with server}
|
|
%post server-mysql
|
|
%post server-mysql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post zabbix-server-mysql.service
|
|
|
|
+%else
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_server \
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_server \
|
|
zabbix_server /usr/sbin/zabbix_server.mysql 10
|
|
zabbix_server /usr/sbin/zabbix_server.mysql 10
|
|
-
|
|
|
|
-/sbin/chkconfig --add zabbix_server
|
|
|
|
|
|
+%endif
|
|
|
|
|
|
%post server-postgresql
|
|
%post server-postgresql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post zabbix-server-pgsql.service
|
|
|
|
+%else
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_server \
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_server \
|
|
zabbix_server /usr/sbin/zabbix_server.pgsql 10
|
|
zabbix_server /usr/sbin/zabbix_server.pgsql 10
|
|
-
|
|
|
|
/sbin/chkconfig --add zabbix_server
|
|
/sbin/chkconfig --add zabbix_server
|
|
-
|
|
|
|
|
|
+%endif
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with proxy}
|
|
%if %{with proxy}
|
|
%post proxy-mysql
|
|
%post proxy-mysql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post zabbix-proxy-mysql.service
|
|
|
|
+%else
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
|
|
zabbix_proxy /usr/sbin/zabbix_proxy.mysql 10
|
|
zabbix_proxy /usr/sbin/zabbix_proxy.mysql 10
|
|
-
|
|
|
|
/sbin/chkconfig --add zabbix_proxy
|
|
/sbin/chkconfig --add zabbix_proxy
|
|
|
|
+%endif
|
|
|
|
|
|
%post proxy-postgresql
|
|
%post proxy-postgresql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post zabbix-proxy-pgsql.service
|
|
|
|
+%else
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
|
|
/sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
|
|
zabbix_proxy /usr/sbin/zabbix_proxy.pgsql 10
|
|
zabbix_proxy /usr/sbin/zabbix_proxy.pgsql 10
|
|
-
|
|
|
|
/sbin/chkconfig --add zabbix_proxy
|
|
/sbin/chkconfig --add zabbix_proxy
|
|
-
|
|
|
|
|
|
+%endif
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with agent}
|
|
%if %{with agent}
|
|
%post agent
|
|
%post agent
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post zabbix-agent.service
|
|
|
|
+%else
|
|
/sbin/chkconfig --add zabbix_agentd
|
|
/sbin/chkconfig --add zabbix_agentd
|
|
|
|
+%endif
|
|
|
|
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with server}
|
|
%if %{with server}
|
|
%preun server-mysql
|
|
%preun server-mysql
|
|
-if [ "$1" -eq 0 ]; then
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_preun zabbix-server-mysql.service
|
|
|
|
+%else
|
|
|
|
+if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
|
|
/sbin/service zabbix_server stop >/dev/null 2>&1
|
|
/sbin/service zabbix_server stop >/dev/null 2>&1
|
|
/sbin/chkconfig --del zabbix_server
|
|
/sbin/chkconfig --del zabbix_server
|
|
/sbin/update-alternatives --remove zabbix_server \
|
|
/sbin/update-alternatives --remove zabbix_server \
|
|
/usr/sbin/zabbix_server.mysql
|
|
/usr/sbin/zabbix_server.mysql
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
|
|
%preun server-postgresql
|
|
%preun server-postgresql
|
|
-if [ "$1" -eq 0 ]; then
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_preun zabbix-server-pgysql.service
|
|
|
|
+%else
|
|
|
|
+if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
|
|
/sbin/service zabbix_server stop >/dev/null 2>&1
|
|
/sbin/service zabbix_server stop >/dev/null 2>&1
|
|
/sbin/chkconfig --del zabbix_server
|
|
/sbin/chkconfig --del zabbix_server
|
|
/sbin/update-alternatives --remove zabbix_server \
|
|
/sbin/update-alternatives --remove zabbix_server \
|
|
/usr/sbin/zabbix_server.pgsql
|
|
/usr/sbin/zabbix_server.pgsql
|
|
fi
|
|
fi
|
|
-
|
|
|
|
|
|
+%endif
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with proxy}
|
|
%if %{with proxy}
|
|
%preun proxy-mysql
|
|
%preun proxy-mysql
|
|
-if [ "$1" -eq 0 ]; then
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_preun zabbix-proxy-mysql.service
|
|
|
|
+%else
|
|
|
|
+if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
|
|
/sbin/service zabbix_proxy stop >/dev/null 2>&1
|
|
/sbin/service zabbix_proxy stop >/dev/null 2>&1
|
|
/sbin/chkconfig --del zabbix_proxy
|
|
/sbin/chkconfig --del zabbix_proxy
|
|
/sbin/update-alternatives --remove zabbix_proxy \
|
|
/sbin/update-alternatives --remove zabbix_proxy \
|
|
/usr/sbin/zabbix_proxy.mysql
|
|
/usr/sbin/zabbix_proxy.mysql
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
|
|
%preun proxy-postgresql
|
|
%preun proxy-postgresql
|
|
-if [ "$1" -eq 0 ]; then
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_preun zabbix-proxy-pgsql.service
|
|
|
|
+%else
|
|
|
|
+if [ "$1" -eq 0 -o -x /bin/systemctl ]; then
|
|
/sbin/service zabbix_proxy stop >/dev/null 2>&1
|
|
/sbin/service zabbix_proxy stop >/dev/null 2>&1
|
|
/sbin/chkconfig --del zabbix_proxy
|
|
/sbin/chkconfig --del zabbix_proxy
|
|
/sbin/update-alternatives --remove zabbix_proxy \
|
|
/sbin/update-alternatives --remove zabbix_proxy \
|
|
/usr/sbin/zabbix_proxy.pgsql
|
|
/usr/sbin/zabbix_proxy.pgsql
|
|
fi
|
|
fi
|
|
-
|
|
|
|
|
|
+%endif
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with agent}
|
|
%if %{with agent}
|
|
%preun agent
|
|
%preun agent
|
|
|
|
+%systemd_preun zabbix-agent.service
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%else
|
|
if [ "$1" -eq 0 ]; then
|
|
if [ "$1" -eq 0 ]; then
|
|
/sbin/service zabbix_agentd stop >/dev/null 2>&1
|
|
/sbin/service zabbix_agentd stop >/dev/null 2>&1
|
|
/sbin/chkconfig --del zabbix_agentd
|
|
/sbin/chkconfig --del zabbix_agentd
|
|
fi
|
|
fi
|
|
-
|
|
|
|
|
|
+%endif
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with server}
|
|
%if %{with server}
|
|
%postun server-mysql
|
|
%postun server-mysql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_postun_with_restart zabbix-server-mysql.service
|
|
|
|
+%else
|
|
if [ "$1" -ge "1" ]; then
|
|
if [ "$1" -ge "1" ]; then
|
|
/sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
|
|
/sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
|
|
%postun server-postgresql
|
|
%postun server-postgresql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_postun_with_restart zabbix-server-pgsql.service
|
|
|
|
+%else
|
|
if [ "$1" -ge "1" ]; then
|
|
if [ "$1" -ge "1" ]; then
|
|
/sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
|
|
/sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
|
|
fi
|
|
fi
|
|
-
|
|
|
|
|
|
+%endif
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%if %{with proxy}
|
|
%if %{with proxy}
|
|
%postun proxy-mysql
|
|
%postun proxy-mysql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_postun_with_restart zabbix-proxy-mysql.service
|
|
|
|
+%else
|
|
if [ "$1" -ge "1" ]; then
|
|
if [ "$1" -ge "1" ]; then
|
|
/sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
|
|
/sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
|
|
%postun proxy-postgresql
|
|
%postun proxy-postgresql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_postun_with_restart zabbix-proxy-pgsql.service
|
|
|
|
+%else
|
|
if [ "$1" -ge "1" ]; then
|
|
if [ "$1" -ge "1" ]; then
|
|
/sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
|
|
/sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
|
|
%postun agent
|
|
%postun agent
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_postun_with_restart zabbix-agent.service
|
|
|
|
+%else
|
|
if [ "$1" -ge "1" ]; then
|
|
if [ "$1" -ge "1" ]; then
|
|
/sbin/service zabbix_agentd condrestart >/dev/null 2>&1 || :
|
|
/sbin/service zabbix_agentd condrestart >/dev/null 2>&1 || :
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
|
|
%endif
|
|
%endif
|
|
|
|
|
|
@@ -415,6 +525,9 @@ fi
|
|
%{_datadir}/zabbix/mysql
|
|
%{_datadir}/zabbix/mysql
|
|
%{_datadir}/zabbix/postgresql
|
|
%{_datadir}/zabbix/postgresql
|
|
%endif
|
|
%endif
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_prefix}/lib/tmpfiles.d/zabbix.conf
|
|
|
|
+%endif
|
|
|
|
|
|
%if %{with server}
|
|
%if %{with server}
|
|
%files server-common
|
|
%files server-common
|
|
@@ -422,16 +535,24 @@ fi
|
|
%dir %{_sysconfdir}/zabbix
|
|
%dir %{_sysconfdir}/zabbix
|
|
%config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf
|
|
%config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_server
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_server
|
|
|
|
+%if !%{with systemd}
|
|
%{_initddir}/zabbix_server*
|
|
%{_initddir}/zabbix_server*
|
|
|
|
+%endif
|
|
%{_mandir}/man8/zabbix_server.8*
|
|
%{_mandir}/man8/zabbix_server.8*
|
|
|
|
|
|
%files server-mysql
|
|
%files server-mysql
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
%{_sbindir}/zabbix_server.mysql
|
|
%{_sbindir}/zabbix_server.mysql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_unitdir}/zabbix-server-mysql.service
|
|
|
|
+%endif
|
|
|
|
|
|
%files server-postgresql
|
|
%files server-postgresql
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
%{_sbindir}/zabbix_server.pgsql
|
|
%{_sbindir}/zabbix_server.pgsql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_unitdir}/zabbix-server-pgsql.service
|
|
|
|
+%endif
|
|
|
|
|
|
%endif
|
|
%endif
|
|
|
|
|
|
@@ -444,7 +565,11 @@ fi
|
|
%{_bindir}/zabbix_get
|
|
%{_bindir}/zabbix_get
|
|
%{_bindir}/zabbix_sender
|
|
%{_bindir}/zabbix_sender
|
|
%{_sbindir}/zabbix_agentd
|
|
%{_sbindir}/zabbix_agentd
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_unitdir}/zabbix-agent.service
|
|
|
|
+%else
|
|
%{_initddir}/zabbix_agentd
|
|
%{_initddir}/zabbix_agentd
|
|
|
|
+%endif
|
|
%{_mandir}/man1/zabbix_get.1*
|
|
%{_mandir}/man1/zabbix_get.1*
|
|
%{_mandir}/man1/zabbix_sender.1*
|
|
%{_mandir}/man1/zabbix_sender.1*
|
|
%{_mandir}/man8/zabbix_agentd.8*
|
|
%{_mandir}/man8/zabbix_agentd.8*
|
|
@@ -457,17 +582,25 @@ fi
|
|
%dir %{_sysconfdir}/zabbix
|
|
%dir %{_sysconfdir}/zabbix
|
|
%config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf
|
|
%config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_proxy
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_proxy
|
|
|
|
+%if !%{with systemd}
|
|
%{_initddir}/zabbix_proxy
|
|
%{_initddir}/zabbix_proxy
|
|
|
|
+%endif
|
|
%{_mandir}/man8/zabbix_proxy.8*
|
|
%{_mandir}/man8/zabbix_proxy.8*
|
|
%{_datadir}/zabbix-proxy
|
|
%{_datadir}/zabbix-proxy
|
|
|
|
|
|
%files proxy-mysql
|
|
%files proxy-mysql
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
%{_sbindir}/zabbix_proxy.mysql
|
|
%{_sbindir}/zabbix_proxy.mysql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_unitdir}/zabbix-proxy-mysql.service
|
|
|
|
+%endif
|
|
|
|
|
|
%files proxy-postgresql
|
|
%files proxy-postgresql
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
%{_sbindir}/zabbix_proxy.pgsql
|
|
%{_sbindir}/zabbix_proxy.pgsql
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_unitdir}/zabbix-proxy-pgsql.service
|
|
|
|
+%endif
|
|
|
|
|
|
%endif
|
|
%endif
|
|
|
|
|
|
@@ -486,6 +619,12 @@ fi
|
|
%endif
|
|
%endif
|
|
|
|
|
|
%changelog
|
|
%changelog
|
|
|
|
+* Mon Apr 06 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.19-1
|
|
|
|
+- new upstream release.
|
|
|
|
+- dropped Patch3: fixed in upstream.
|
|
|
|
+- changed R:php5 to R:php74.
|
|
|
|
+- added systemd support (disabled as default).
|
|
|
|
+
|
|
* Thu Dec 19 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.15-1
|
|
* Thu Dec 19 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.15-1
|
|
- new upstream release.
|
|
- new upstream release.
|
|
- imported Patch13 from upstream to support php74.
|
|
- imported Patch13 from upstream to support php74.
|