]>
Commit | Line | Data |
---|---|---|
10a854a6 TO |
1 | # |
2 | # Conditional build: | |
e9e15753 | 3 | # _with_pgsql - enable postgresql support (by default use mysql) |
10a854a6 TO |
4 | # |
5 | %define _beta beta8 | |
6 | Summary: zabbix | |
7 | Summary(pl): zabbix | |
8 | Name: zabbix | |
9 | Version: 1.0 | |
10 | Release: 0.%{_beta}.0.1 | |
11 | License: GPL v2+ | |
12 | Group: Networking/Admin | |
13 | Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}%{_beta}.tar.gz | |
fabb54b6 | 14 | # Source0-md5: ed691c777df63aa6081dde750f10e733 |
10a854a6 TO |
15 | Source1: %{name}-agent.inetd |
16 | Source2: %{name}-trapper.inetd | |
17 | URL: http://zabbix.sourceforge.net/ | |
e9e15753 | 18 | %{!?_with_pgsql:BuildRequires: mysql-devel} |
19 | %{?_with_pgsql:BuildRequires: postgresql-devel} | |
10a854a6 TO |
20 | BuildRequires: ucd-snmp-devel |
21 | BuildRequires: openssl-devel >= 0.9.6j | |
e9e15753 | 22 | #PreReq: - |
23 | #Requires - | |
10a854a6 TO |
24 | #Requires(pre,post): - |
25 | #Requires(preun): - | |
26 | #Requires(postun): - | |
27 | #Provides: - | |
28 | #Obsoletes: - | |
29 | #Conflicts: - | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %define _sysconfdir /etc/%{name} | |
33 | ||
34 | %description | |
35 | none yet | |
36 | ||
10a854a6 TO |
37 | %package frontend-php |
38 | Summary: PHP frontend for zabbix | |
39 | Group: Networking/Admin | |
40 | Requires: apache | |
41 | Requires: php | |
42 | ||
43 | %description frontend-php | |
44 | blah | |
45 | ||
46 | %package agent-inetd | |
47 | Summary: inetd agent for zabbix | |
48 | Group: Networking/Admin | |
e9e15753 | 49 | Requires: %{name} |
10a854a6 TO |
50 | Requires: inetdaemon |
51 | Obsoletes: %{name}-agent-standalone | |
52 | ||
53 | %description agent-inetd | |
54 | blah | |
55 | ||
56 | %package agent-standalone | |
57 | Summary: standalone agent for zabbix | |
58 | Group: Networking/Admin | |
e9e15753 | 59 | Requires: %{name} |
10a854a6 TO |
60 | Obsoletes: %{name}-agent-inetd |
61 | ||
62 | %description agent-standalone | |
63 | blah | |
64 | ||
65 | %package suckerd | |
66 | Summary: sucker daemon for zabbix | |
67 | Group: Networking/Admin | |
68 | Requires: %{name} | |
e9e15753 | 69 | %{!?_with_pgsql:Requires: mysql} |
70 | %{?_with_pgsql:Requires: postgresql} | |
10a854a6 TO |
71 | |
72 | %description suckerd | |
73 | blah | |
74 | ||
75 | %package trapper-inetd | |
76 | Summary: inetd trapper for zabbix | |
77 | Group: Networking/Admin | |
78 | Requires: %{name} | |
79 | Requires: inetdaemon | |
80 | Obsoletes: %{name}-trapper-standalone | |
81 | ||
82 | %description trapper-inetd | |
83 | blah | |
84 | ||
85 | %package trapper-standalone | |
86 | Summary: standalone trapper for zabbix | |
87 | Group: Networking/Admin | |
88 | Requires: %{name} | |
89 | Obsoletes: %{name}-trapper-inetd | |
90 | ||
91 | %description trapper-standalone | |
92 | blah | |
93 | ||
94 | %package sender | |
95 | Summary: zabbix's sender | |
96 | Group: Networking/Admin | |
97 | ||
98 | %description sender | |
99 | blah | |
100 | ||
101 | %prep | |
102 | %setup -q -n %{name}-%{version}%{_beta} | |
103 | ||
104 | %build | |
105 | rm -f missing | |
106 | %{__aclocal} | |
107 | %{__autoconf} | |
108 | %configure \ | |
e9e15753 | 109 | %{!?_with_pgsql:--with-mysql} \ |
110 | %{?_with_pgsql:--with-pgsql} | |
10a854a6 TO |
111 | |
112 | %{__make} | |
113 | ||
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig/rc-inetd,%{_sbindir},/home/services/html/zabbix} | |
117 | ||
118 | install bin/zabbix_* $RPM_BUILD_ROOT%{_sbindir} | |
119 | install misc/conf/* $RPM_BUILD_ROOT%{_sysconfdir} | |
120 | cp -r frontends/php/* $RPM_BUILD_ROOT/home/services/html/zabbix | |
121 | ||
122 | install %SOURCE1 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent | |
123 | install %SOURCE2 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-trapper | |
124 | ||
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
e9e15753 | 128 | %pre |
10a854a6 TO |
129 | if [ -z "`/usr/bin/getgid zabbix`" ]; then |
130 | /usr/sbin/groupadd zabbix | |
131 | fi | |
132 | if [ -z "`/bin/id -u zabbix 2>/dev/null`" ]; then | |
133 | /usr/sbin/useradd -d / -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
134 | fi | |
135 | ||
e9e15753 | 136 | %postun |
10a854a6 TO |
137 | if [ "$1" = "0" ]; then |
138 | /usr/sbin/userdel zabbix | |
139 | /usr/sbin/groupdel zabbix | |
140 | fi | |
141 | ||
142 | %post agent-inetd | |
143 | if [ -f /var/lock/subsys/rc-inetd ]; then | |
144 | /etc/rc.d/init.d/rc-inetd reload | |
145 | else | |
146 | echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2 | |
147 | fi | |
148 | ||
149 | %postun agent-inetd | |
150 | if [ -f /var/lock/subsys/rc-inetd ]; then | |
151 | /etc/rc.d/init.d/rc-inetd reload | |
152 | fi | |
153 | ||
154 | %post trapper-inetd | |
155 | if [ -f /var/lock/subsys/rc-inetd ]; then | |
156 | /etc/rc.d/init.d/rc-inetd reload | |
157 | else | |
158 | echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2 | |
159 | fi | |
160 | ||
161 | %postun trapper-inetd | |
162 | if [ -f /var/lock/subsys/rc-inetd ]; then | |
163 | /etc/rc.d/init.d/rc-inetd reload | |
164 | fi | |
165 | ||
166 | %files | |
167 | %defattr(644,root,root,755) | |
168 | %doc doc/manual.pdf AUTHORS ChangeLog FAQ TODO create bin/ZabbixW32.exe | |
10a854a6 TO |
169 | %attr(750,root,zabbix) %dir %{_sysconfdir} |
170 | ||
171 | %files frontend-php | |
172 | %defattr(644,root,root,755) | |
173 | /home/services/html/zabbix | |
174 | ||
175 | %files agent-inetd | |
176 | %defattr(644,root,root,755) | |
177 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf | |
178 | %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-agent | |
179 | %attr(755,root,root) %{_sbindir}/zabbix_agent | |
180 | ||
181 | %files agent-standalone | |
182 | %defattr(644,root,root,755) | |
183 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf | |
184 | %attr(755,root,root) %{_sbindir}/zabbix_agentd | |
185 | ||
186 | %files suckerd | |
187 | %defattr(644,root,root,755) | |
188 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_suckerd.conf | |
189 | %attr(755,root,root) %{_sbindir}/zabbix_suckerd | |
190 | ||
191 | %files trapper-inetd | |
192 | %defattr(644,root,root,755) | |
193 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapper.conf | |
194 | %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-trapper | |
195 | %attr(755,root,root) %{_sbindir}/zabbix_trapper | |
196 | ||
197 | %files trapper-standalone | |
198 | %defattr(644,root,root,755) | |
199 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapperd.conf | |
200 | %attr(755,root,root) %{_sbindir}/zabbix_trapperd | |
201 | ||
202 | %files sender | |
203 | %defattr(644,root,root,755) | |
204 | %attr(755,root,root) %{_sbindir}/zabbix_sender |