source: projects/specs/trunk/z/zabbix/zabbix-vl.spec @ 12073

Revision 12073, 13.0 KB checked in by tomop, 5 years ago (diff)

zabbix-4.0.7-1

Line 
1%define ver 4.0.7
2%define rel 1
3
4%define only_agent 0
5
6%if %{only_agent}
7%bcond_with server
8%bcond_with proxy
9%bcond_with frontend
10%else
11%bcond_without server
12%bcond_without proxy
13%bcond_without frontend
14%endif
15
16%bcond_without agent
17
18Summary: The Enterprise-class Monitoring Solution for Everyone
19Name: zabbix
20Version: %{ver}
21Release: %{rel}%{?_dist_release}
22License: GPLv2
23Group: Applications/Services
24URL: https://www.zabbix.com/
25Source0: %{name}-%{version}.tar.gz
26Source1: zabbix_server.init
27Source2: zabbix_proxy.init
28Source3: zabbix_agentd.init
29Source4: zabbix_server.logrotate
30Source5: zabbix_proxy.logrotate
31Source6: zabbix_agentd.logrotate
32Patch1: 0001-change-the-font-for-Vine-Linux.patch
33Patch2: 0002-modified-config-files-for-Vine-Linux.patch
34BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
35%if %{with server}%{with proxy}
36BuildRequires: libpq-devel
37BuildRequires: libmariadb-devel
38%endif
39BuildRequires: libevent-devel
40BuildRequires: pcre-devel
41BuildRequires: curl-devel
42BuildRequires: net-snmp-devel
43BuildRequires: OpenIPMI-devel
44BuildRequires: unixODBC-devel
45BuildRequires: libssh2-devel
46Requires(pre): glibc-common
47Requires(pre): shadow-utils
48
49Vendor: Project Vine
50Distribution: Vine Linux
51Packager: iwaim
52
53%description
54The Enterprise-class Monitoring Solution for Everyone.
55
56%if %{with server}
57%package server-common
58Summary: common files for Zabbix Server
59Requires: %{name} == %{version}-%{release}
60Requires(post,preun): chkconfig
61Requires(preun,postun): initscripts
62
63%description server-common
64This package include common files for Zabbix Server.
65
66%package server-mysql
67Summary: Zabbix Server for MySQL/MariaDB
68Provides: %{name}-server
69Requires: %{name}-server-common == %{version}-%{release}
70
71%description server-mysql
72Zabbix Server for MySQL/MariaDB
73
74%package server-postgresql
75Summary: Zabbix Server for PostgreSQL
76Provides: %{name}-server
77Requires: %{name}-server-common == %{version}-%{release}
78
79%description server-postgresql
80Zabbix Server for PostgreSQL
81
82%endif
83
84%if %{with agent}
85%package agent
86Summary: Zabbix Agent
87Requires: %{name} == %{version}-%{release}
88Requires(post,preun): chkconfig
89Requires(preun,postun): initscripts
90
91%description agent
92Zabbix Agent
93
94%endif
95
96%if %{with proxy}
97%package proxy-common
98Summary: common files for Zabbix Proxy
99Requires: %{name} == %{version}-%{release}
100Requires(post,preun): chkconfig
101Requires(preun,postun): initscripts
102
103%description proxy-common
104This package include common files for Zabbix Proxy
105
106%package proxy-mysql
107Summary: Zabbix Proxy for MySQL/MariaDB
108Provides: %{name}-proxy
109Requires: %{name}-proxy-common == %{version}-%{release}
110
111%description proxy-mysql
112Zabbix Proxy for MySQL/MariaDB
113
114%package proxy-postgresql
115Summary: Zabbix Proxy for PostgreSQL
116Provides: %{name}-proxy
117Requires: %{name}-proxy-common == %{version}-%{release}
118
119%description proxy-postgresql
120Zabbix Proxy for PostgreSQL
121
122%endif
123
124%if %{with frontend}
125%package frontend-php
126Summary: Zabbix web frontend with PHP
127Group: Applications/Internet
128Requires: php5
129Requires: TrueType-vlgothic
130
131%description frontend-php
132Zabbix web frontend with PHP.
133
134%package frontend-php-mysql
135Summary: Zabbix web frontend with PHP and MySQL/MariaDB
136Group: Applications/Internet
137Provides: %{name}-frontend-php == %{version}-%{release}
138Requires: php5-mysql
139
140%description frontend-php-mysql
141Zabbix web frontend with PHP and MySQL/MariaDB.
142
143%package frontend-php-postgresql
144Summary: Zabbix web frontend with PHP and PostgreSQL
145Group: Applications/Internet
146Provides: %{name}-frontend-php == %{version}-%{release}
147Requires: php5-pgsql
148
149%description frontend-php-postgresql
150Zabbix web frontend with PHP and PostgreSQL.
151
152%endif
153
154%prep
155%setup -q -T -a 0 -c -n zabbix-%{version}
156mv zabbix-%{version} zabbix_mysql
157pushd zabbix_mysql
158%patch1 -p 1
159%patch2 -p 1
160popd
161
162%if %{with server}%{with proxy}
163%setup -q -D -T -a 0 -n zabbix-%{version}
164mv zabbix-%{version} zabbix_pgsql
165pushd zabbix_pgsql
166%patch1 -p 1
167%patch2 -p 1
168popd
169%endif
170
171%build
172
173Build()
174{
175perl -pi -e 's|/usr/bin/traceroute|/bin/traceroute|' \
176    ./database/{ibm_db2,mysql,oracle,postgresql,sqlite3}/data.sql
177
178%configure \
179           %{?with_server:--enable-server} \
180           %{?with_proxy:--enable-proxy} \
181           %{?with_agent:--enable-agent} \
182           --enable-ipv6 \
183           --sysconfdir=%{_sysconfdir}/zabbix \
184           --with-libcurl \
185           --with-openipmi \
186           --with-net-snmp \
187           --with-unixodbc \
188           --with-ssh2 \
189           $@
190
191%__make
192}
193
194%if %{with server}%{with proxy}
195pushd zabbix_mysql
196Build --with-mysql
197popd
198
199pushd zabbix_pgsql
200Build --with-postgresql
201popd
202%else
203pushd zabbix_mysql
204Build
205popd
206%endif
207
208%install
209%__rm -rf $RPM_BUILD_ROOT
210pushd zabbix_mysql
211make DESTDIR=$RPM_BUILD_ROOT install
212
213%if %{with server}
214mv -f %{buildroot}%{_sbindir}/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.mysql
215%endif
216%if %{with proxy}
217mv -f %{buildroot}%{_sbindir}/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.mysql
218%endif
219
220# make directories
221%__mkdir_p $RPM_BUILD_ROOT%{_localstatedir}/{log,run}/%{name}
222
223# DB
224%__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix
225%if %{with server}%{with proxy}
226%__cp -a database/postgresql $RPM_BUILD_ROOT%{_datadir}/zabbix/
227%__cp -a database/mysql $RPM_BUILD_ROOT%{_datadir}/zabbix/
228%endif
229
230# init.d
231%__mkdir_p $RPM_BUILD_ROOT%{_initddir}
232%if %{with server}
233%__cp %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/zabbix_server
234%endif
235%if %{with proxy}
236%__cp %{SOURCE2} $RPM_BUILD_ROOT%{_initddir}/zabbix_proxy
237%endif
238%if %{with agent}
239%__cp %{SOURCE3} $RPM_BUILD_ROOT%{_initddir}/zabbix_agentd
240%endif
241
242# logrotate
243%__mkdir_p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
244%if %{with server}
245%__cp %{SOURCE4}  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_server
246%endif
247%if %{with proxy}
248%__cp %{SOURCE5}  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_proxy
249%endif
250%if %{with agent}
251%__cp %{SOURCE6}  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_agentd
252%endif
253
254%if %{with frontend}
255# frontend-php
256%__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend
257%__cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/
258%__rm -f $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/DejaVuSans.ttf
259
260ln -s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf \
261      $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/
262%endif
263
264%if %{with proxy}
265# proxy
266mkdir -p %{buildroot}%{_datadir}/zabbix-proxy
267ln -sf ../zabbix/mysql %{buildroot}%{_datadir}/zabbix-proxy/
268ln -sf ../zabbix/postgresql %{buildroot}%{_datadir}/zabbix-proxy/
269%endif
270
271popd
272
273%if %{with server}%{with proxy}
274pushd zabbix_pgsql
275install -m755 src/zabbix_server/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.pgsql
276install -m755 src/zabbix_proxy/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.pgsql
277popd
278%endif
279
280%clean
281%__rm -rf $RPM_BUILD_ROOT
282
283%pre
284getent group zabbix >/dev/null || groupadd -r zabbix
285getent passwd zabbix >/dev/null || \
286useradd -r -g zabbix -d %{_sysconfdir}/zabbix -s /sbin/nologin \
287-c "Zabbix Monitoring Solution" zabbix
288exit 0
289
290%if %{with server}
291%post server-mysql
292/sbin/update-alternatives --install /usr/sbin/zabbix_server \
293        zabbix_server /usr/sbin/zabbix_server.mysql 10
294
295/sbin/chkconfig --add zabbix_server
296
297%post server-postgresql
298/sbin/update-alternatives --install /usr/sbin/zabbix_server \
299        zabbix_server /usr/sbin/zabbix_server.pgsql 10
300
301/sbin/chkconfig --add zabbix_server
302
303%endif
304
305%if %{with proxy}
306%post proxy-mysql
307/sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
308        zabbix_proxy /usr/sbin/zabbix_proxy.mysql 10
309
310/sbin/chkconfig --add zabbix_proxy
311
312%post proxy-postgresql
313/sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
314        zabbix_proxy /usr/sbin/zabbix_proxy.pgsql 10
315
316/sbin/chkconfig --add zabbix_proxy
317
318%endif
319
320%if %{with agent}
321%post agent
322/sbin/chkconfig --add zabbix_agentd
323
324%endif
325
326%if %{with server}
327%preun server-mysql
328if [ "$1" -eq 0 ]; then
329        /sbin/service zabbix_server stop >/dev/null 2>&1
330        /sbin/chkconfig --del zabbix_server
331        /sbin/update-alternatives --remove zabbix_server \
332                /usr/sbin/zabbix_server.mysql
333fi
334
335%preun server-postgresql
336if [ "$1" -eq 0 ]; then
337        /sbin/service zabbix_server stop >/dev/null 2>&1
338        /sbin/chkconfig --del zabbix_server
339        /sbin/update-alternatives --remove zabbix_server \
340                /usr/sbin/zabbix_server.pgsql
341fi
342
343%endif
344
345%if %{with proxy}
346%preun proxy-mysql
347if [ "$1" -eq 0 ]; then
348        /sbin/service zabbix_proxy stop >/dev/null 2>&1
349        /sbin/chkconfig --del zabbix_proxy
350        /sbin/update-alternatives --remove zabbix_proxy \
351                /usr/sbin/zabbix_proxy.mysql
352fi
353
354%preun proxy-postgresql
355if [ "$1" -eq 0 ]; then
356        /sbin/service zabbix_proxy stop >/dev/null 2>&1
357        /sbin/chkconfig --del zabbix_proxy
358        /sbin/update-alternatives --remove zabbix_proxy \
359                /usr/sbin/zabbix_proxy.pgsql
360fi
361
362%endif
363
364%if %{with agent}
365%preun agent
366if [ "$1" -eq 0 ]; then
367        /sbin/service zabbix_agentd stop >/dev/null 2>&1
368        /sbin/chkconfig --del zabbix_agentd
369fi
370
371%endif
372
373%if %{with server}
374%postun server-mysql
375if [ "$1" -ge "1" ]; then
376        /sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
377fi
378
379%postun server-postgresql
380if [ "$1" -ge "1" ]; then
381        /sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
382fi
383
384%endif
385
386%if %{with proxy}
387%postun proxy-mysql
388if [ "$1" -ge "1" ]; then
389        /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
390fi
391
392%postun proxy-postgresql
393if [ "$1" -ge "1" ]; then
394        /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
395fi
396
397%postun agent
398if [ "$1" -ge "1" ]; then
399        /sbin/service zabbix_agentd condrestart >/dev/null 2>&1 || :
400fi
401
402%endif
403
404%files
405%defattr(-,root,root,-)
406%license zabbix_mysql/COPYING
407%doc zabbix_mysql/AUTHORS zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README
408%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/%{name}
409%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/%{name}
410%dir %{_datadir}/zabbix
411%if %{with server}%{with proxy}
412%{_datadir}/zabbix/mysql
413%{_datadir}/zabbix/postgresql
414%endif
415
416%if %{with server}
417%files server-common
418%defattr(-,root,root,-)
419%dir %{_sysconfdir}/zabbix
420%config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf
421%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_server
422%{_initddir}/zabbix_server*
423%{_mandir}/man8/zabbix_server.8*
424
425%files server-mysql
426%defattr(-,root,root,-)
427%{_sbindir}/zabbix_server.mysql
428
429%files server-postgresql
430%defattr(-,root,root,-)
431%{_sbindir}/zabbix_server.pgsql
432
433%endif
434
435%if %{with agent}
436%files agent
437%defattr(-,root,root,-)
438%dir %{_sysconfdir}/zabbix
439%config(noreplace) %{_sysconfdir}/zabbix/zabbix_agentd.conf
440%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_agentd
441%{_bindir}/zabbix_get
442%{_bindir}/zabbix_sender
443%{_sbindir}/zabbix_agentd
444%{_initddir}/zabbix_agentd
445%{_mandir}/man1/zabbix_get.1*
446%{_mandir}/man1/zabbix_sender.1*
447%{_mandir}/man8/zabbix_agentd.8*
448
449%endif
450
451%if %{with proxy}
452%files proxy-common
453%defattr(-,root,root,-)
454%dir %{_sysconfdir}/zabbix
455%config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf
456%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_proxy
457%{_initddir}/zabbix_proxy
458%{_mandir}/man8/zabbix_proxy.8*
459%{_datadir}/zabbix-proxy
460
461%files proxy-mysql
462%defattr(-,root,root,-)
463%{_sbindir}/zabbix_proxy.mysql
464
465%files proxy-postgresql
466%defattr(-,root,root,-)
467%{_sbindir}/zabbix_proxy.pgsql
468
469%endif
470
471%if %{with frontend}
472%files frontend-php
473%defattr(-,root,root,-)
474%license zabbix_mysql/COPYING
475%doc zabbix_mysql/AUTHORS zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README
476%dir %{_datadir}/zabbix-frontend
477%{_datadir}/zabbix-frontend/php
478
479%files frontend-php-mysql
480
481%files frontend-php-postgresql
482
483%endif
484
485%changelog
486* Wed May 08 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.7-1
487- new upstream release.
488- switched to 4.0 LTS.
489- dropped Patch0: made to get same effect by another method.
490- updated Patch1 and 2.
491
492* Wed Nov 07 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.23-1
493- new upstream release.
494
495* Tue Jun 12 2018 IWAI, Masaharu <iwaim.sub@gmail.com> 3.0.13-2
496- accept building only agent
497
498* Thu Dec 21 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.13-1
499- new upstream release.
500
501* Fri Apr 21 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.8-1
502- new upstream release.
503
504* Fri Mar 18 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.1-1
505- new upstream release.
506- disabled jabber support.
507
508* Wed Sep  9 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4.6-1
509- new upstream release.
510
511* Sat Apr 11 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.9-1
512- new upstream release.
513
514* Sun Jul  6 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.4-1
515- new upstream release.
516- built with both of mysql and postgresql.
517
518* Mon Oct 07 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.8-1
519- update to 2.0.8
520
521* Wed Feb 20 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.5-2
522- use %%bcond_with mysql to build with mysql
523
524* Tue Feb 19 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.5-1
525- update to 2.0.5
526- add using MySQL client library switch: default no
527  - define use_postfix and use_mysql
528  - add BuildRequires: MySQL-devel
529  - add configure option: --with-mysql
530
531* Thu Feb  7 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.4-1
532- initial build for Vine Linux
Note: See TracBrowser for help on using the repository browser.