%define _prefix /usr/local/zabbix
Name: zabbix
-Version: 1.6.1
+Version: 1.6
Release: 1
Group: System Environment/Daemons
License: GPL
Vendor: ZABBIX SIA
URL: http://www.zabbix.org
Packager: Eugene Grigorjev <eugene.grigorjev@zabbix.com>
-Source: zabbix-1.6.1.tar.gz
+Source: zabbix-%{version}.tar.gz
Autoreq: no
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
The ZABBIX gui frontend
%prep
-%setup -n zabbix-1.6.1
+%setup -n zabbix-%{version}
%build
-e "s#PIDFILE=/var/tmp/zabbix_agentd.pid#PIDFILE=%{zabbix_piddir}/zabbix_agentd.pid#g" \
%{zabbix_initdir}/zabbix_agentd > $TMP_FILE
cat $TMP_FILE > %{zabbix_initdir}/zabbix_agentd
-# TODO: copy to /etc/init.d/
+
+# NOTE: Run every runlevel as soon as possible, and stop as late as possible
cp %{zabbix_initdir}/zabbix_agentd %{_initrddir}
+sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
+ %{_initrddir}/zabbix_agentd
rm -f $TMP_FILE
+chkconfig --add zabbix_agentd
chkconfig zabbix_agentd on
%post server
-e "s#PIDFILE=/var/tmp/zabbix_server.pid#PIDFILE=%{zabbix_piddir}/zabbix_server.pid#g" \
%{zabbix_initdir}/zabbix_server > $TMP_FILE
cat $TMP_FILE > %{zabbix_initdir}/zabbix_server
-cp %{zabbix_initdir}/zabbix_server %{_initrddir}
-
rm -f $TMP_FILE
+# NOTE: Run every runlevel as soon as possible, and stop as late as possible
+cp %{zabbix_initdir}/zabbix_server %{_initrddir}
+sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
+ %{_initrddir}/zabbix_server
+
+chkconfig --add zabbix_server
chkconfig zabbix_server on
%post gui