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

Revision 12317, 13.4 KB checked in by tomop, 4 years ago (diff)

updated 7 packages

dovecot-2.3.9.2-1

mariadb-10.4.11-1

openssl-1.1.1d-2

php73-7.3.13-1

spamassassin-3.4.3-1

squid-4.9-1

zabbix-4.0.15-1

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