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

RevLine 
[12073]1%define ver 4.0.7
[11880]2%define rel 1
[7440]3
[11716]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
[7440]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
[12073]32Patch1: 0001-change-the-font-for-Vine-Linux.patch
33Patch2: 0002-modified-config-files-for-Vine-Linux.patch
[7440]34BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
[11716]35%if %{with server}%{with proxy}
[8748]36BuildRequires: libpq-devel
[11880]37BuildRequires: libmariadb-devel
[11716]38%endif
[12073]39BuildRequires: libevent-devel
40BuildRequires: pcre-devel
[7440]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
[11716]56%if %{with server}
[8748]57%package server-common
58Summary: common files for Zabbix Server
[7440]59Requires: %{name} == %{version}-%{release}
60Requires(post,preun): chkconfig
61Requires(preun,postun): initscripts
62
[8748]63%description server-common
64This package include common files for Zabbix Server.
[7440]65
[8748]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
[11716]82%endif
83
84%if %{with agent}
[7440]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
[11716]94%endif
95
96%if %{with proxy}
[8748]97%package proxy-common
98Summary: common files for Zabbix Proxy
[7440]99Requires: %{name} == %{version}-%{release}
100Requires(post,preun): chkconfig
101Requires(preun,postun): initscripts
102
[8748]103%description proxy-common
104This package include common files for Zabbix Proxy
[7440]105
[8748]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
[11716]122%endif
123
124%if %{with frontend}
[7440]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
[8748]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
[11716]152%endif
153
[7440]154%prep
[8748]155%setup -q -T -a 0 -c -n zabbix-%{version}
156mv zabbix-%{version} zabbix_mysql
157pushd zabbix_mysql
[7440]158%patch1 -p 1
159%patch2 -p 1
[8748]160popd
[7440]161
[11716]162%if %{with server}%{with proxy}
[8748]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
[11716]169%endif
[8748]170
[7440]171%build
[8748]172
173Build()
174{
[12073]175perl -pi -e 's|/usr/bin/traceroute|/bin/traceroute|' \
176    ./database/{ibm_db2,mysql,oracle,postgresql,sqlite3}/data.sql
177
[8748]178%configure \
[11716]179           %{?with_server:--enable-server} \
180           %{?with_proxy:--enable-proxy} \
181           %{?with_agent:--enable-agent} \
[8748]182           --enable-ipv6 \
[7440]183           --sysconfdir=%{_sysconfdir}/zabbix \
184           --with-libcurl \
185           --with-openipmi \
186           --with-net-snmp \
187           --with-unixodbc \
[8748]188           --with-ssh2 \
189           $@
[7440]190
191%__make
[8748]192}
[7440]193
[11716]194%if %{with server}%{with proxy}
[8748]195pushd zabbix_mysql
[11716]196Build --with-mysql
[8748]197popd
198
199pushd zabbix_pgsql
200Build --with-postgresql
201popd
[11716]202%else
203pushd zabbix_mysql
204Build
205popd
206%endif
[8748]207
[7440]208%install
209%__rm -rf $RPM_BUILD_ROOT
[8748]210pushd zabbix_mysql
[7440]211make DESTDIR=$RPM_BUILD_ROOT install
212
[11716]213%if %{with server}
[8748]214mv -f %{buildroot}%{_sbindir}/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.mysql
[11716]215%endif
216%if %{with proxy}
[8748]217mv -f %{buildroot}%{_sbindir}/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.mysql
[11716]218%endif
[8748]219
[7440]220# make directories
221%__mkdir_p $RPM_BUILD_ROOT%{_localstatedir}/{log,run}/%{name}
222
223# DB
224%__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix
[11716]225%if %{with server}%{with proxy}
[7440]226%__cp -a database/postgresql $RPM_BUILD_ROOT%{_datadir}/zabbix/
[7480]227%__cp -a database/mysql $RPM_BUILD_ROOT%{_datadir}/zabbix/
[11716]228%endif
[7440]229
230# init.d
231%__mkdir_p $RPM_BUILD_ROOT%{_initddir}
[11716]232%if %{with server}
[7440]233%__cp %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/zabbix_server
[11716]234%endif
235%if %{with proxy}
[7440]236%__cp %{SOURCE2} $RPM_BUILD_ROOT%{_initddir}/zabbix_proxy
[11716]237%endif
238%if %{with agent}
[7440]239%__cp %{SOURCE3} $RPM_BUILD_ROOT%{_initddir}/zabbix_agentd
[11716]240%endif
[7440]241
242# logrotate
243%__mkdir_p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
[11716]244%if %{with server}
[7440]245%__cp %{SOURCE4}  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_server
[11716]246%endif
247%if %{with proxy}
[7440]248%__cp %{SOURCE5}  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_proxy
[11716]249%endif
250%if %{with agent}
[7440]251%__cp %{SOURCE6}  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_agentd
[11716]252%endif
[7440]253
[11716]254%if %{with frontend}
[7440]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/
[11716]262%endif
[7440]263
[11716]264%if %{with proxy}
[8748]265# proxy
266mkdir -p %{buildroot}%{_datadir}/zabbix-proxy
267ln -sf ../zabbix/mysql %{buildroot}%{_datadir}/zabbix-proxy/
268ln -sf ../zabbix/postgresql %{buildroot}%{_datadir}/zabbix-proxy/
[11716]269%endif
[8748]270
271popd
272
[11716]273%if %{with server}%{with proxy}
[8748]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
[11716]278%endif
[8748]279
[7440]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
[11716]290%if %{with server}
[8748]291%post server-mysql
292/sbin/update-alternatives --install /usr/sbin/zabbix_server \
293        zabbix_server /usr/sbin/zabbix_server.mysql 10
294
[7440]295/sbin/chkconfig --add zabbix_server
296
[8748]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
[11716]303%endif
304
305%if %{with proxy}
[8748]306%post proxy-mysql
307/sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
308        zabbix_proxy /usr/sbin/zabbix_proxy.mysql 10
309
[7440]310/sbin/chkconfig --add zabbix_proxy
311
[8748]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
[11716]318%endif
319
320%if %{with agent}
[7440]321%post agent
322/sbin/chkconfig --add zabbix_agentd
323
[11716]324%endif
325
326%if %{with server}
[8748]327%preun server-mysql
[7440]328if [ "$1" -eq 0 ]; then
329        /sbin/service zabbix_server stop >/dev/null 2>&1
330        /sbin/chkconfig --del zabbix_server
[8748]331        /sbin/update-alternatives --remove zabbix_server \
332                /usr/sbin/zabbix_server.mysql
[7440]333fi
334
[8748]335%preun server-postgresql
[7440]336if [ "$1" -eq 0 ]; then
[8748]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
[11716]343%endif
344
345%if %{with proxy}
[8748]346%preun proxy-mysql
347if [ "$1" -eq 0 ]; then
[7440]348        /sbin/service zabbix_proxy stop >/dev/null 2>&1
349        /sbin/chkconfig --del zabbix_proxy
[8748]350        /sbin/update-alternatives --remove zabbix_proxy \
351                /usr/sbin/zabbix_proxy.mysql
[7440]352fi
353
[8748]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
[11716]362%endif
363
364%if %{with agent}
[7440]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
[11716]371%endif
372
373%if %{with server}
[8748]374%postun server-mysql
[7440]375if [ "$1" -ge "1" ]; then
376        /sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
377fi
378
[8748]379%postun server-postgresql
[7440]380if [ "$1" -ge "1" ]; then
[8748]381        /sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
382fi
383
[11716]384%endif
385
386%if %{with proxy}
[8748]387%postun proxy-mysql
388if [ "$1" -ge "1" ]; then
[7440]389        /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
390fi
391
[8748]392%postun proxy-postgresql
393if [ "$1" -ge "1" ]; then
394        /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
395fi
396
[7440]397%postun agent
398if [ "$1" -ge "1" ]; then
399        /sbin/service zabbix_agentd condrestart >/dev/null 2>&1 || :
400fi
401
[11716]402%endif
403
[7440]404%files
405%defattr(-,root,root,-)
[12073]406%license zabbix_mysql/COPYING
407%doc zabbix_mysql/AUTHORS zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README
[7440]408%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/%{name}
409%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/%{name}
410%dir %{_datadir}/zabbix
[11716]411%if %{with server}%{with proxy}
[8748]412%{_datadir}/zabbix/mysql
[7440]413%{_datadir}/zabbix/postgresql
[11716]414%endif
[7440]415
[11716]416%if %{with server}
[8748]417%files server-common
[7440]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
[8748]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
[11716]433%endif
434
435%if %{with agent}
[7440]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
[11716]449%endif
450
451%if %{with proxy}
[8748]452%files proxy-common
[7440]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*
[8748]459%{_datadir}/zabbix-proxy
[7440]460
[8748]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
[11716]469%endif
470
471%if %{with frontend}
[7440]472%files frontend-php
473%defattr(-,root,root,-)
[12073]474%license zabbix_mysql/COPYING
475%doc zabbix_mysql/AUTHORS zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README
[7440]476%dir %{_datadir}/zabbix-frontend
477%{_datadir}/zabbix-frontend/php
478
[8748]479%files frontend-php-mysql
480
481%files frontend-php-postgresql
482
[11716]483%endif
484
[7440]485%changelog
[12073]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
[11880]492* Wed Nov 07 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.23-1
493- new upstream release.
494
[11716]495* Tue Jun 12 2018 IWAI, Masaharu <iwaim.sub@gmail.com> 3.0.13-2
496- accept building only agent
497
[11300]498* Thu Dec 21 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.13-1
499- new upstream release.
500
[11058]501* Fri Apr 21 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.8-1
502- new upstream release.
503
[10091]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
[9746]508* Wed Sep  9 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4.6-1
509- new upstream release.
510
[9497]511* Sat Apr 11 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.9-1
512- new upstream release.
513
[8748]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
[7879]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
[7480]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
[7440]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.