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

Revision 11880, 12.6 KB checked in by tomop, 6 years ago (diff)

zabbix-3.0.23-1

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