1 | %define ver 2.2.9 |
---|
2 | %define rel 1 |
---|
3 | |
---|
4 | Summary: The Enterprise-class Monitoring Solution for Everyone |
---|
5 | Name: zabbix |
---|
6 | Version: %{ver} |
---|
7 | Release: %{rel}%{?_dist_release} |
---|
8 | License: GPLv2 |
---|
9 | Group: Applications/Services |
---|
10 | URL: https://www.zabbix.com/ |
---|
11 | Source0: %{name}-%{version}.tar.gz |
---|
12 | Source1: zabbix_server.init |
---|
13 | Source2: zabbix_proxy.init |
---|
14 | Source3: zabbix_agentd.init |
---|
15 | Source4: zabbix_server.logrotate |
---|
16 | Source5: zabbix_proxy.logrotate |
---|
17 | Source6: zabbix_agentd.logrotate |
---|
18 | Patch0: zabbix-2.0.4-vine_path.patch |
---|
19 | Patch1: zabbix-2.0.4-font.patch |
---|
20 | Patch2: zabbix-2.0.4-config.patch |
---|
21 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
---|
22 | BuildRequires: libpq-devel |
---|
23 | BuildRequires: libmysqlclient-devel |
---|
24 | BuildRequires: curl-devel |
---|
25 | BuildRequires: net-snmp-devel |
---|
26 | BuildRequires: OpenIPMI-devel |
---|
27 | BuildRequires: iksemel-devel |
---|
28 | BuildRequires: unixODBC-devel |
---|
29 | BuildRequires: libssh2-devel |
---|
30 | Requires(pre): glibc-common |
---|
31 | Requires(pre): shadow-utils |
---|
32 | |
---|
33 | Vendor: Project Vine |
---|
34 | Distribution: Vine Linux |
---|
35 | Packager: iwaim |
---|
36 | |
---|
37 | %description |
---|
38 | The Enterprise-class Monitoring Solution for Everyone. |
---|
39 | |
---|
40 | %package server-common |
---|
41 | Summary: common files for Zabbix Server |
---|
42 | Requires: %{name} == %{version}-%{release} |
---|
43 | Requires(post,preun): chkconfig |
---|
44 | Requires(preun,postun): initscripts |
---|
45 | |
---|
46 | %description server-common |
---|
47 | This package include common files for Zabbix Server. |
---|
48 | |
---|
49 | %package server-mysql |
---|
50 | Summary: Zabbix Server for MySQL/MariaDB |
---|
51 | Provides: %{name}-server |
---|
52 | Requires: %{name}-server-common == %{version}-%{release} |
---|
53 | |
---|
54 | %description server-mysql |
---|
55 | Zabbix Server for MySQL/MariaDB |
---|
56 | |
---|
57 | %package server-postgresql |
---|
58 | Summary: Zabbix Server for PostgreSQL |
---|
59 | Provides: %{name}-server |
---|
60 | Requires: %{name}-server-common == %{version}-%{release} |
---|
61 | |
---|
62 | %description server-postgresql |
---|
63 | Zabbix Server for PostgreSQL |
---|
64 | |
---|
65 | %package agent |
---|
66 | Summary: Zabbix Agent |
---|
67 | Requires: %{name} == %{version}-%{release} |
---|
68 | Requires(post,preun): chkconfig |
---|
69 | Requires(preun,postun): initscripts |
---|
70 | |
---|
71 | %description agent |
---|
72 | Zabbix Agent |
---|
73 | |
---|
74 | %package proxy-common |
---|
75 | Summary: common files for Zabbix Proxy |
---|
76 | Requires: %{name} == %{version}-%{release} |
---|
77 | Requires(post,preun): chkconfig |
---|
78 | Requires(preun,postun): initscripts |
---|
79 | |
---|
80 | %description proxy-common |
---|
81 | This package include common files for Zabbix Proxy |
---|
82 | |
---|
83 | %package proxy-mysql |
---|
84 | Summary: Zabbix Proxy for MySQL/MariaDB |
---|
85 | Provides: %{name}-proxy |
---|
86 | Requires: %{name}-proxy-common == %{version}-%{release} |
---|
87 | |
---|
88 | %description proxy-mysql |
---|
89 | Zabbix Proxy for MySQL/MariaDB |
---|
90 | |
---|
91 | %package proxy-postgresql |
---|
92 | Summary: Zabbix Proxy for PostgreSQL |
---|
93 | Provides: %{name}-proxy |
---|
94 | Requires: %{name}-proxy-common == %{version}-%{release} |
---|
95 | |
---|
96 | %description proxy-postgresql |
---|
97 | Zabbix Proxy for PostgreSQL |
---|
98 | |
---|
99 | %package frontend-php |
---|
100 | Summary: Zabbix web frontend with PHP |
---|
101 | Group: Applications/Internet |
---|
102 | Requires: php5 |
---|
103 | Requires: TrueType-vlgothic |
---|
104 | |
---|
105 | %description frontend-php |
---|
106 | Zabbix web frontend with PHP. |
---|
107 | |
---|
108 | %package frontend-php-mysql |
---|
109 | Summary: Zabbix web frontend with PHP and MySQL/MariaDB |
---|
110 | Group: Applications/Internet |
---|
111 | Provides: %{name}-frontend-php == %{version}-%{release} |
---|
112 | Requires: php5-mysql |
---|
113 | |
---|
114 | %description frontend-php-mysql |
---|
115 | Zabbix web frontend with PHP and MySQL/MariaDB. |
---|
116 | |
---|
117 | %package frontend-php-postgresql |
---|
118 | Summary: Zabbix web frontend with PHP and PostgreSQL |
---|
119 | Group: Applications/Internet |
---|
120 | Provides: %{name}-frontend-php == %{version}-%{release} |
---|
121 | Requires: php5-pgsql |
---|
122 | |
---|
123 | %description frontend-php-postgresql |
---|
124 | Zabbix web frontend with PHP and PostgreSQL. |
---|
125 | |
---|
126 | %prep |
---|
127 | %setup -q -T -a 0 -c -n zabbix-%{version} |
---|
128 | mv zabbix-%{version} zabbix_mysql |
---|
129 | pushd zabbix_mysql |
---|
130 | %patch0 -p 1 |
---|
131 | %patch1 -p 1 |
---|
132 | %patch2 -p 1 |
---|
133 | popd |
---|
134 | |
---|
135 | %setup -q -D -T -a 0 -n zabbix-%{version} |
---|
136 | mv zabbix-%{version} zabbix_pgsql |
---|
137 | pushd zabbix_pgsql |
---|
138 | %patch0 -p 1 |
---|
139 | %patch1 -p 1 |
---|
140 | %patch2 -p 1 |
---|
141 | popd |
---|
142 | |
---|
143 | %build |
---|
144 | |
---|
145 | Build() |
---|
146 | { |
---|
147 | %configure \ |
---|
148 | --enable-server \ |
---|
149 | --enable-proxy \ |
---|
150 | --enable-ipv6 \ |
---|
151 | --sysconfdir=%{_sysconfdir}/zabbix \ |
---|
152 | --with-libcurl \ |
---|
153 | --with-openipmi \ |
---|
154 | --with-net-snmp \ |
---|
155 | --with-jabber \ |
---|
156 | --with-unixodbc \ |
---|
157 | --with-ssh2 \ |
---|
158 | $@ |
---|
159 | |
---|
160 | %__make |
---|
161 | } |
---|
162 | |
---|
163 | pushd zabbix_mysql |
---|
164 | Build --with-mysql \ |
---|
165 | --enable-agent |
---|
166 | popd |
---|
167 | |
---|
168 | pushd zabbix_pgsql |
---|
169 | Build --with-postgresql |
---|
170 | popd |
---|
171 | |
---|
172 | |
---|
173 | %install |
---|
174 | %__rm -rf $RPM_BUILD_ROOT |
---|
175 | pushd zabbix_mysql |
---|
176 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
177 | |
---|
178 | mv -f %{buildroot}%{_sbindir}/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.mysql |
---|
179 | mv -f %{buildroot}%{_sbindir}/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.mysql |
---|
180 | |
---|
181 | # make directories |
---|
182 | %__mkdir_p $RPM_BUILD_ROOT%{_localstatedir}/{log,run}/%{name} |
---|
183 | |
---|
184 | # DB |
---|
185 | %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix |
---|
186 | %__cp -a database/postgresql $RPM_BUILD_ROOT%{_datadir}/zabbix/ |
---|
187 | %__cp -a database/mysql $RPM_BUILD_ROOT%{_datadir}/zabbix/ |
---|
188 | |
---|
189 | # init.d |
---|
190 | %__mkdir_p $RPM_BUILD_ROOT%{_initddir} |
---|
191 | %__cp %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/zabbix_server |
---|
192 | %__cp %{SOURCE2} $RPM_BUILD_ROOT%{_initddir}/zabbix_proxy |
---|
193 | %__cp %{SOURCE3} $RPM_BUILD_ROOT%{_initddir}/zabbix_agentd |
---|
194 | |
---|
195 | # logrotate |
---|
196 | %__mkdir_p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d |
---|
197 | %__cp %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_server |
---|
198 | %__cp %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_proxy |
---|
199 | %__cp %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_agentd |
---|
200 | |
---|
201 | # frontend-php |
---|
202 | %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend |
---|
203 | %__cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/ |
---|
204 | %__rm -f $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/DejaVuSans.ttf |
---|
205 | |
---|
206 | ln -s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf \ |
---|
207 | $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/ |
---|
208 | |
---|
209 | # proxy |
---|
210 | mkdir -p %{buildroot}%{_datadir}/zabbix-proxy |
---|
211 | ln -sf ../zabbix/mysql %{buildroot}%{_datadir}/zabbix-proxy/ |
---|
212 | ln -sf ../zabbix/postgresql %{buildroot}%{_datadir}/zabbix-proxy/ |
---|
213 | |
---|
214 | popd |
---|
215 | |
---|
216 | pushd zabbix_pgsql |
---|
217 | install -m755 src/zabbix_server/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.pgsql |
---|
218 | install -m755 src/zabbix_proxy/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.pgsql |
---|
219 | popd |
---|
220 | |
---|
221 | %clean |
---|
222 | %__rm -rf $RPM_BUILD_ROOT |
---|
223 | |
---|
224 | %pre |
---|
225 | getent group zabbix >/dev/null || groupadd -r zabbix |
---|
226 | getent passwd zabbix >/dev/null || \ |
---|
227 | useradd -r -g zabbix -d %{_sysconfdir}/zabbix -s /sbin/nologin \ |
---|
228 | -c "Zabbix Monitoring Solution" zabbix |
---|
229 | exit 0 |
---|
230 | |
---|
231 | %post server-mysql |
---|
232 | /sbin/update-alternatives --install /usr/sbin/zabbix_server \ |
---|
233 | zabbix_server /usr/sbin/zabbix_server.mysql 10 |
---|
234 | |
---|
235 | /sbin/chkconfig --add zabbix_server |
---|
236 | |
---|
237 | %post server-postgresql |
---|
238 | /sbin/update-alternatives --install /usr/sbin/zabbix_server \ |
---|
239 | zabbix_server /usr/sbin/zabbix_server.pgsql 10 |
---|
240 | |
---|
241 | /sbin/chkconfig --add zabbix_server |
---|
242 | |
---|
243 | %post proxy-mysql |
---|
244 | /sbin/update-alternatives --install /usr/sbin/zabbix_proxy \ |
---|
245 | zabbix_proxy /usr/sbin/zabbix_proxy.mysql 10 |
---|
246 | |
---|
247 | /sbin/chkconfig --add zabbix_proxy |
---|
248 | |
---|
249 | %post proxy-postgresql |
---|
250 | /sbin/update-alternatives --install /usr/sbin/zabbix_proxy \ |
---|
251 | zabbix_proxy /usr/sbin/zabbix_proxy.pgsql 10 |
---|
252 | |
---|
253 | /sbin/chkconfig --add zabbix_proxy |
---|
254 | |
---|
255 | %post agent |
---|
256 | /sbin/chkconfig --add zabbix_agentd |
---|
257 | |
---|
258 | %preun server-mysql |
---|
259 | if [ "$1" -eq 0 ]; then |
---|
260 | /sbin/service zabbix_server stop >/dev/null 2>&1 |
---|
261 | /sbin/chkconfig --del zabbix_server |
---|
262 | /sbin/update-alternatives --remove zabbix_server \ |
---|
263 | /usr/sbin/zabbix_server.mysql |
---|
264 | fi |
---|
265 | |
---|
266 | %preun server-postgresql |
---|
267 | if [ "$1" -eq 0 ]; then |
---|
268 | /sbin/service zabbix_server stop >/dev/null 2>&1 |
---|
269 | /sbin/chkconfig --del zabbix_server |
---|
270 | /sbin/update-alternatives --remove zabbix_server \ |
---|
271 | /usr/sbin/zabbix_server.pgsql |
---|
272 | fi |
---|
273 | |
---|
274 | %preun proxy-mysql |
---|
275 | if [ "$1" -eq 0 ]; then |
---|
276 | /sbin/service zabbix_proxy stop >/dev/null 2>&1 |
---|
277 | /sbin/chkconfig --del zabbix_proxy |
---|
278 | /sbin/update-alternatives --remove zabbix_proxy \ |
---|
279 | /usr/sbin/zabbix_proxy.mysql |
---|
280 | fi |
---|
281 | |
---|
282 | %preun proxy-postgresql |
---|
283 | if [ "$1" -eq 0 ]; then |
---|
284 | /sbin/service zabbix_proxy stop >/dev/null 2>&1 |
---|
285 | /sbin/chkconfig --del zabbix_proxy |
---|
286 | /sbin/update-alternatives --remove zabbix_proxy \ |
---|
287 | /usr/sbin/zabbix_proxy.pgsql |
---|
288 | fi |
---|
289 | |
---|
290 | %preun agent |
---|
291 | if [ "$1" -eq 0 ]; then |
---|
292 | /sbin/service zabbix_agentd stop >/dev/null 2>&1 |
---|
293 | /sbin/chkconfig --del zabbix_agentd |
---|
294 | fi |
---|
295 | |
---|
296 | %postun server-mysql |
---|
297 | if [ "$1" -ge "1" ]; then |
---|
298 | /sbin/service zabbix_server condrestart >/dev/null 2>&1 || : |
---|
299 | fi |
---|
300 | |
---|
301 | %postun server-postgresql |
---|
302 | if [ "$1" -ge "1" ]; then |
---|
303 | /sbin/service zabbix_server condrestart >/dev/null 2>&1 || : |
---|
304 | fi |
---|
305 | |
---|
306 | %postun proxy-mysql |
---|
307 | if [ "$1" -ge "1" ]; then |
---|
308 | /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || : |
---|
309 | fi |
---|
310 | |
---|
311 | %postun proxy-postgresql |
---|
312 | if [ "$1" -ge "1" ]; then |
---|
313 | /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || : |
---|
314 | fi |
---|
315 | |
---|
316 | %postun agent |
---|
317 | if [ "$1" -ge "1" ]; then |
---|
318 | /sbin/service zabbix_agentd condrestart >/dev/null 2>&1 || : |
---|
319 | fi |
---|
320 | |
---|
321 | %files |
---|
322 | %defattr(-,root,root,-) |
---|
323 | %doc zabbix_mysql/AUTHORS zabbix_mysql/COPYING zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README |
---|
324 | %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/%{name} |
---|
325 | %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/%{name} |
---|
326 | %dir %{_datadir}/zabbix |
---|
327 | %{_datadir}/zabbix/mysql |
---|
328 | %{_datadir}/zabbix/postgresql |
---|
329 | |
---|
330 | %files server-common |
---|
331 | %defattr(-,root,root,-) |
---|
332 | %dir %{_sysconfdir}/zabbix |
---|
333 | %config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf |
---|
334 | %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_server |
---|
335 | %{_initddir}/zabbix_server* |
---|
336 | %{_mandir}/man8/zabbix_server.8* |
---|
337 | |
---|
338 | %files server-mysql |
---|
339 | %defattr(-,root,root,-) |
---|
340 | %{_sbindir}/zabbix_server.mysql |
---|
341 | |
---|
342 | %files server-postgresql |
---|
343 | %defattr(-,root,root,-) |
---|
344 | %{_sbindir}/zabbix_server.pgsql |
---|
345 | |
---|
346 | %files agent |
---|
347 | %defattr(-,root,root,-) |
---|
348 | %dir %{_sysconfdir}/zabbix |
---|
349 | %config(noreplace) %{_sysconfdir}/zabbix/zabbix_agent.conf |
---|
350 | %config(noreplace) %{_sysconfdir}/zabbix/zabbix_agentd.conf |
---|
351 | %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_agentd |
---|
352 | %{_bindir}/zabbix_get |
---|
353 | %{_bindir}/zabbix_sender |
---|
354 | %{_sbindir}/zabbix_agent |
---|
355 | %{_sbindir}/zabbix_agentd |
---|
356 | %{_initddir}/zabbix_agentd |
---|
357 | %{_mandir}/man1/zabbix_get.1* |
---|
358 | %{_mandir}/man1/zabbix_sender.1* |
---|
359 | %{_mandir}/man8/zabbix_agentd.8* |
---|
360 | |
---|
361 | %files proxy-common |
---|
362 | %defattr(-,root,root,-) |
---|
363 | %dir %{_sysconfdir}/zabbix |
---|
364 | %config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf |
---|
365 | %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_proxy |
---|
366 | %{_initddir}/zabbix_proxy |
---|
367 | %{_mandir}/man8/zabbix_proxy.8* |
---|
368 | %{_datadir}/zabbix-proxy |
---|
369 | |
---|
370 | %files proxy-mysql |
---|
371 | %defattr(-,root,root,-) |
---|
372 | %{_sbindir}/zabbix_proxy.mysql |
---|
373 | |
---|
374 | %files proxy-postgresql |
---|
375 | %defattr(-,root,root,-) |
---|
376 | %{_sbindir}/zabbix_proxy.pgsql |
---|
377 | |
---|
378 | %files frontend-php |
---|
379 | %defattr(-,root,root,-) |
---|
380 | %doc zabbix_mysql/AUTHORS zabbix_mysql/COPYING zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README |
---|
381 | %dir %{_datadir}/zabbix-frontend |
---|
382 | %{_datadir}/zabbix-frontend/php |
---|
383 | |
---|
384 | %files frontend-php-mysql |
---|
385 | |
---|
386 | %files frontend-php-postgresql |
---|
387 | |
---|
388 | %changelog |
---|
389 | * Sat Apr 11 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.9-1 |
---|
390 | - new upstream release. |
---|
391 | |
---|
392 | * Sun Jul 6 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.4-1 |
---|
393 | - new upstream release. |
---|
394 | - built with both of mysql and postgresql. |
---|
395 | |
---|
396 | * Mon Oct 07 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.8-1 |
---|
397 | - update to 2.0.8 |
---|
398 | |
---|
399 | * Wed Feb 20 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.5-2 |
---|
400 | - use %%bcond_with mysql to build with mysql |
---|
401 | |
---|
402 | * Tue Feb 19 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.5-1 |
---|
403 | - update to 2.0.5 |
---|
404 | - add using MySQL client library switch: default no |
---|
405 | - define use_postfix and use_mysql |
---|
406 | - add BuildRequires: MySQL-devel |
---|
407 | - add configure option: --with-mysql |
---|
408 | |
---|
409 | * Thu Feb 7 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.4-1 |
---|
410 | - initial build for Vine Linux |
---|