3 # _with_mysql - 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_mysql:BuildRequires: mysql-devel}
18 %{?_with_mysql:BuildRequires: postgresql-devel}
19 BuildRequires: ucd-snmp-devel
20 BuildRequires: openssl-devel >= 0.9.6j
22 Requires: %{name}-common
23 #Requires(pre,post): -
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _sysconfdir /etc/%{name}
37 Summary: zabbix common
38 Group: Networking/Admin
44 Summary: PHP frontend for zabbix
45 Group: Networking/Admin
49 %description frontend-php
53 Summary: inetd agent for zabbix
54 Group: Networking/Admin
55 Requires: %{name}-common
57 Obsoletes: %{name}-agent-standalone
59 %description agent-inetd
62 %package agent-standalone
63 Summary: standalone agent for zabbix
64 Group: Networking/Admin
65 Requires: %{name}-common
66 Obsoletes: %{name}-agent-inetd
68 %description agent-standalone
72 Summary: sucker daemon for zabbix
73 Group: Networking/Admin
79 %package trapper-inetd
80 Summary: inetd trapper for zabbix
81 Group: Networking/Admin
84 Obsoletes: %{name}-trapper-standalone
86 %description trapper-inetd
89 %package trapper-standalone
90 Summary: standalone trapper for zabbix
91 Group: Networking/Admin
93 Obsoletes: %{name}-trapper-inetd
95 %description trapper-standalone
99 Summary: zabbix's sender
100 Group: Networking/Admin
106 %setup -q -n %{name}-%{version}%{_beta}
113 %{!?_with_mysql:--with-pgsql} \
114 %{?_with_mysql:--with-mysql}
119 rm -rf $RPM_BUILD_ROOT
120 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig/rc-inetd,%{_sbindir},/home/services/html/zabbix}
122 install bin/zabbix_* $RPM_BUILD_ROOT%{_sbindir}
123 install misc/conf/* $RPM_BUILD_ROOT%{_sysconfdir}
124 cp -r frontends/php/* $RPM_BUILD_ROOT/home/services/html/zabbix
126 install %SOURCE1 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
127 install %SOURCE2 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-trapper
130 rm -rf $RPM_BUILD_ROOT
133 if [ -z "`/usr/bin/getgid zabbix`" ]; then
134 /usr/sbin/groupadd zabbix
136 if [ -z "`/bin/id -u zabbix 2>/dev/null`" ]; then
137 /usr/sbin/useradd -d / -g zabbix -c "Zabbix User" -s /bin/false zabbix
141 if [ "$1" = "0" ]; then
142 /usr/sbin/userdel zabbix
143 /usr/sbin/groupdel zabbix
147 if [ -f /var/lock/subsys/rc-inetd ]; then
148 /etc/rc.d/init.d/rc-inetd reload
150 echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
154 if [ -f /var/lock/subsys/rc-inetd ]; then
155 /etc/rc.d/init.d/rc-inetd reload
159 if [ -f /var/lock/subsys/rc-inetd ]; then
160 /etc/rc.d/init.d/rc-inetd reload
162 echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
165 %postun trapper-inetd
166 if [ -f /var/lock/subsys/rc-inetd ]; then
167 /etc/rc.d/init.d/rc-inetd reload
171 %defattr(644,root,root,755)
172 %doc doc/manual.pdf AUTHORS ChangeLog FAQ TODO create bin/ZabbixW32.exe
175 %defattr(644,root,root,755)
176 %attr(750,root,zabbix) %dir %{_sysconfdir}
179 %defattr(644,root,root,755)
180 /home/services/html/zabbix
183 %defattr(644,root,root,755)
184 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
185 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-agent
186 %attr(755,root,root) %{_sbindir}/zabbix_agent
188 %files agent-standalone
189 %defattr(644,root,root,755)
190 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
191 %attr(755,root,root) %{_sbindir}/zabbix_agentd
194 %defattr(644,root,root,755)
195 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_suckerd.conf
196 %attr(755,root,root) %{_sbindir}/zabbix_suckerd
199 %defattr(644,root,root,755)
200 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapper.conf
201 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-trapper
202 %attr(755,root,root) %{_sbindir}/zabbix_trapper
204 %files trapper-standalone
205 %defattr(644,root,root,755)
206 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapperd.conf
207 %attr(755,root,root) %{_sbindir}/zabbix_trapperd
210 %defattr(644,root,root,755)
211 %attr(755,root,root) %{_sbindir}/zabbix_sender