3 # _with_pgsql - enable postgresql support (by default use mysql)
10 Release: 0.%{_beta}.0.1
12 Group: Networking/Admin
13 Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}%{_beta}.tar.gz
14 Source1: %{name}-agent.inetd
15 Source2: %{name}-trapper.inetd
16 URL: http://zabbix.sourceforge.net/
17 %{!?_with_pgsql:BuildRequires: mysql-devel}
18 %{?_with_pgsql:BuildRequires: postgresql-devel}
19 BuildRequires: ucd-snmp-devel
20 BuildRequires: openssl-devel >= 0.9.6j
23 #Requires(pre,post): -
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _sysconfdir /etc/%{name}
37 Summary: PHP frontend for zabbix
38 Group: Networking/Admin
42 %description frontend-php
46 Summary: inetd agent for zabbix
47 Group: Networking/Admin
50 Obsoletes: %{name}-agent-standalone
52 %description agent-inetd
55 %package agent-standalone
56 Summary: standalone agent for zabbix
57 Group: Networking/Admin
59 Obsoletes: %{name}-agent-inetd
61 %description agent-standalone
65 Summary: sucker daemon for zabbix
66 Group: Networking/Admin
68 %{!?_with_pgsql:Requires: mysql}
69 %{?_with_pgsql:Requires: postgresql}
74 %package trapper-inetd
75 Summary: inetd trapper for zabbix
76 Group: Networking/Admin
79 Obsoletes: %{name}-trapper-standalone
81 %description trapper-inetd
84 %package trapper-standalone
85 Summary: standalone trapper for zabbix
86 Group: Networking/Admin
88 Obsoletes: %{name}-trapper-inetd
90 %description trapper-standalone
94 Summary: zabbix's sender
95 Group: Networking/Admin
101 %setup -q -n %{name}-%{version}%{_beta}
108 %{!?_with_pgsql:--with-mysql} \
109 %{?_with_pgsql:--with-pgsql}
114 rm -rf $RPM_BUILD_ROOT
115 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig/rc-inetd,%{_sbindir},/home/services/html/zabbix}
117 install bin/zabbix_* $RPM_BUILD_ROOT%{_sbindir}
118 install misc/conf/* $RPM_BUILD_ROOT%{_sysconfdir}
119 cp -r frontends/php/* $RPM_BUILD_ROOT/home/services/html/zabbix
121 install %SOURCE1 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
122 install %SOURCE2 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-trapper
125 rm -rf $RPM_BUILD_ROOT
128 if [ -z "`/usr/bin/getgid zabbix`" ]; then
129 /usr/sbin/groupadd zabbix
131 if [ -z "`/bin/id -u zabbix 2>/dev/null`" ]; then
132 /usr/sbin/useradd -d / -g zabbix -c "Zabbix User" -s /bin/false zabbix
136 if [ "$1" = "0" ]; then
137 /usr/sbin/userdel zabbix
138 /usr/sbin/groupdel zabbix
142 if [ -f /var/lock/subsys/rc-inetd ]; then
143 /etc/rc.d/init.d/rc-inetd reload
145 echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
149 if [ -f /var/lock/subsys/rc-inetd ]; then
150 /etc/rc.d/init.d/rc-inetd reload
154 if [ -f /var/lock/subsys/rc-inetd ]; then
155 /etc/rc.d/init.d/rc-inetd reload
157 echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
160 %postun trapper-inetd
161 if [ -f /var/lock/subsys/rc-inetd ]; then
162 /etc/rc.d/init.d/rc-inetd reload
166 %defattr(644,root,root,755)
167 %doc doc/manual.pdf AUTHORS ChangeLog FAQ TODO create bin/ZabbixW32.exe
168 %attr(750,root,zabbix) %dir %{_sysconfdir}
171 %defattr(644,root,root,755)
172 /home/services/html/zabbix
175 %defattr(644,root,root,755)
176 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
177 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-agent
178 %attr(755,root,root) %{_sbindir}/zabbix_agent
180 %files agent-standalone
181 %defattr(644,root,root,755)
182 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
183 %attr(755,root,root) %{_sbindir}/zabbix_agentd
186 %defattr(644,root,root,755)
187 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_suckerd.conf
188 %attr(755,root,root) %{_sbindir}/zabbix_suckerd
191 %defattr(644,root,root,755)
192 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapper.conf
193 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-trapper
194 %attr(755,root,root) %{_sbindir}/zabbix_trapper
196 %files trapper-standalone
197 %defattr(644,root,root,755)
198 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapperd.conf
199 %attr(755,root,root) %{_sbindir}/zabbix_trapperd
202 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_sbindir}/zabbix_sender