]> git.pld-linux.org Git - packages/zabbix.git/blame - zabbix.spec
finish packaging
[packages/zabbix.git] / zabbix.spec
CommitLineData
06317756
JK
1# TODO:
2# - initscript for zabbix-agentd, zabbix-server, zabbix-proxy and zabbix-java
10a854a6
TO
3#
4# Conditional build:
cd323295
JK
5%bcond_with pgsql # enable PostgreSQL support
6%bcond_with oracle # enable Oracle support
7%bcond_with sqlite3 # enable sqlite3 support
8%bcond_without mysql # enable MySQL support
9
10%bcond_without java # disable java support
11
12%if %{with pgsql} || %{with oracle} || %{with sqlite3}
13%undefine with_mysql
14%endif
15
16%if %{?with_pgsql:1}%{?with_oracle:1}%{?with_sqlite3:1}%{?with_mysql:1} != 1
17ERROR: exactly one database must be selected
18%endif
2fe2194b 19
1d07384b
JK
20%define php_min_version 5.4.0
21
06317756
JK
22Summary: Zabbix - network monitoring software
23Summary(pl.UTF-8): Zabbix - oprogramowanie do monitorowania sieci
10a854a6 24Name: zabbix
cd323295 25Version: 3.2.0
06317756 26Release: 0.2
10a854a6 27License: GPL v2+
d0e25550 28Group: Networking/Utilities
b37e41ff 29Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
cd323295
JK
30# Source0-md5: e2491b482868059f251902d5f636eacb
31Source1: %{name}-apache.conf
06317756
JK
32Source2: zabbix_server.service
33Source3: zabbix_agentd.service
34Source4: zabbix_proxy.service
35Source5: zabbix_java.service
36Source6: zabbix.tmpfiles
37Patch0: config.patch
10a854a6 38URL: http://zabbix.sourceforge.net/
cd323295 39BuildRequires: OpenIPMI-devel
73af344b 40BuildRequires: curl-devel
41BuildRequires: iksemel-devel
cd323295
JK
42%{?with_java:BuildRequires: jdk}
43BuildRequires: libxml2-devel
44BuildRequires: libssh2-devel
45%{?with_mysql:BuildRequires: mysql-devel}
39709426 46BuildRequires: net-snmp-devel
246efd79 47BuildRequires: openldap-devel >= 2.4.6
2886d983 48BuildRequires: openssl-devel >= 0.9.7d
9ffbc0d2 49%{?with_pgsql:BuildRequires: postgresql-devel}
cd323295
JK
50%{?with_sqlite3:BuildRequires: sqlite3-devel}
51BuildRequires: unixODBC-devel
06317756
JK
52BuildRequires: rpmbuild(macros) >= 1.671
53Requires: zabbix-server
54Requires: zabbix-agentd
55Requires: zabbix-frontend-php
10a854a6
TO
56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
a5bb35f6 58%define _sysconfdir /etc/%{name}
7dcff817
TP
59%define _appdir %{_datadir}/%{name}
60%define _webapps /etc/webapps
61%define _webapp %{name}
10a854a6
TO
62
63%description
06317756 64Zabbix is software that monitors numerous parameters of a network and
1266ba50 65the servers on that network. It is a useful tool for monitoring
06317756 66the health and integrity of servers. Zabbix uses a flexible
7f4b6a83 67notification mechanism that allows users to configure email based
68alerts for virtually any event. All monitored parameters are stored in
06317756
JK
69a database. Zabbix offers excellent reporting and data visualisation
70features based on the stored data. Zabbix supports both polling and
71trapping. All Zabbix reports and statistics, as well as configuration
7f4b6a83 72parameters, are accessed through a web-based front end.
73
ff14176a 74%description -l pl.UTF-8
06317756 75Zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
1266ba50
TP
76serwerów sieciowych. Jest przydatny przy monitorowaniu działania
77serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który
78pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną
79dla praktycznie wszelkich zdarzeń. Monitorowane parametry są
06317756 80przechowywane w bazie danych. W oparciu o przechowywane dane Zabbix
1266ba50
TP
81oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno
82odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i
06317756
JK
83statystyk Zabbiksa jest możliwy poprzez interfejs oparty o WWW.
84
85%package common
86Summary: Common files for Zabbix monitoring software
87Summary(pl.UTF-8): Wspólne pliki dla oprogramowania monitorującego Zabbix
88Group: Networking/Utilities
89Requires(postun): /usr/sbin/groupdel
90Requires(postun): /usr/sbin/userdel
91Requires(pre): /bin/id
92Requires(pre): /usr/bin/getgid
93Requires(pre): /usr/sbin/groupadd
94Requires(pre): /usr/sbin/useradd
95Provides: group(zabbix)
96Provides: user(zabbix)
97
98%description common
99Common files for Zabbix monitoring software.
100
101%description common -l pl.UTF-8
102Wspólne pliki dla oprogramowania monitorującego Zabbix.
10a854a6 103
cd323295 104%package agentd
06317756
JK
105Summary: Zabbix Agent
106Summary(pl.UTF-8): Agenta Zabbiksa
d0e25550 107Group: Networking/Utilities
06317756
JK
108Requires: systemd-units >= 38
109Requires: %{name}-common = %{version}-%{release}
96b8972f 110Obsoletes: zabbix-agent-inetd
cd323295 111Obsoletes: zabbix-agent-standalone
10a854a6 112
cd323295 113%description agentd
06317756 114Zabbix agent collects data from the local system for a Zabbix server.
90e6d4b1 115
cd323295 116%description agentd -l pl.UTF-8
06317756 117Agent zbiera dane z lokalnej maszyny dla serwera Zabbix.
7dcff817
TP
118
119%package frontend-php
06317756
JK
120Summary: PHP frontend for Zabbix
121Summary(pl.UTF-8): Interfejs PHP dla Zabbiksa
d0e25550 122Group: Applications/WWW
cd323295 123Requires: php(bcmath)
1d07384b 124Requires: php(core) >= %{php_min_version}
cd323295 125Requires: php(ctype)
1d07384b
JK
126Requires: php(gd)
127Requires: php(gettext)
cd323295
JK
128Requires: php(mbstring)
129Requires: php(pcre)
cd323295 130Requires: php(session)
1d07384b
JK
131Requires: php(sockets)
132Requires: php(xml)
133Requires: php(xmlreader)
134Requires: php(xmlwriter)
cd323295
JK
135%{?with_mysql:Requires: php(mysql)}
136%{?with_pgsql:Requires: php(pgsql)}
7dcff817 137Requires: webapps
7dcff817
TP
138Requires: webserver(php)
139
140%description frontend-php
06317756 141This package provides web based (PHP) frontend for Zabbix.
7dcff817
TP
142
143%description frontend-php -l pl.UTF-8
06317756 144Ten pakiet dostarcza napisany w PHP frontend dla Zabbiksa.
7dcff817
TP
145
146%package get
06317756
JK
147Summary: Program retrieving data from Zabbix agent
148Summary(pl.UTF-8): Program odpytujÄcy agenta Zabbiksa
d0e25550 149Group: Networking/Utilities
7dcff817
TP
150
151%description get
06317756 152This package provides a program retrieving data from Zabbix agent.
7dcff817
TP
153
154%description get -l pl.UTF-8
06317756 155Ten pakiet zawiera program odpytujÄcy agenta Zabbiksa.
10a854a6 156
1b6bdd87 157%package proxy
158Summary: Zabbix proxy
06317756 159Summary(pl.UTF-8): Proxy do Zabbiksa
1b6bdd87 160Group: Networking/Utilities
06317756
JK
161Requires: systemd-units >= 38
162Requires: %{name}-common = %{version}-%{release}
1b6bdd87 163
164%description proxy
06317756 165This package provides the Zabbix proxy.
1b6bdd87 166
167%description proxy -l pl.UTF-8
06317756 168Ten pakiet zawiera proxy Zabbix.
1b6bdd87 169
10a854a6 170%package sender
7dcff817 171Summary: Zabbix sender
06317756 172Summary(pl.UTF-8): Program zawiadamiający Zabbiksa
d0e25550 173Group: Networking/Utilities
10a854a6
TO
174
175%description sender
06317756 176This package provides the Zabbix sender.
10a854a6 177
ff14176a 178%description sender -l pl.UTF-8
06317756 179Ten pakiet zawiera program zawiadamiający Zabbiksa.
a5bb35f6 180
a7e2963d 181%package server
7dcff817 182Summary: Zabbix server
06317756 183Summary(pl.UTF-8): Serwer Zabbiksa
d0e25550 184Group: Networking/Utilities
06317756
JK
185Requires: systemd-units >= 38
186Requires: %{name}-common = %{version}-%{release}
1266ba50
TP
187Obsoletes: %{name}-suckerd
188Obsoletes: %{name}-trapper-inetd
189Obsoletes: %{name}-trapper-standalone
a7e2963d 190
191%description server
06317756 192This package provides the Zabbix server.
a7e2963d 193
194%description server -l pl.UTF-8
06317756 195Ten pakiet zawiera serwer Zabbiksa.
a7e2963d 196
cd323295
JK
197%package java
198Summary: Zabbix Java Gateway
199Group: Networking/Utilities
06317756
JK
200Requires: systemd-units >= 38
201Requires: %{name}-common = %{version}-%{release}
cd323295
JK
202
203%description java
204This package provides the Zabbix Java Gateway.
205
10a854a6 206%prep
5d18cc59 207%setup -q
10a854a6 208
06317756
JK
209%patch0 -p1
210
10a854a6 211%build
10a854a6 212%configure \
cd323295 213 %{?with_mysql:--with-mysql} \
06317756 214 %{?with_pgsql:--with-postgresql} \
2fe2194b 215 %{?with_oracle:--with-oracle} \
cd323295 216 %{?with_sqlite3:--with-sqlite3} \
2fe2194b
MWP
217 --enable-server \
218 --enable-agent \
1b6bdd87 219 --enable-proxy \
cd323295
JK
220 --enable-ipv6 \
221 %{__enable_disable java} \
73af344b 222 --with-jabber \
cd323295
JK
223 --with-ldap \
224 --with-libcurl \
225 --with-libxml2 \
226 --with-net-snmp \
227 --with-openipmi \
228 --with-openssl \
229 --with-ssh2 \
230 --with-unixodbc
10a854a6
TO
231
232%{__make}
233
234%install
235rm -rf $RPM_BUILD_ROOT
06317756
JK
236install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}} \
237 $RPM_BUILD_ROOT{/run/zabbix,/var/log/zabbix,%{systemdunitdir},%{tmpfilesdir}}
10a854a6 238
2fe2194b 239%{__make} install \
cd323295
JK
240 DESTDIR=$RPM_BUILD_ROOT \
241 ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java
10a854a6 242
7dcff817 243cp -r frontends $RPM_BUILD_ROOT%{_appdir}
06317756 244
cd323295
JK
245install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
246install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
247
06317756
JK
248install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_server.service
249install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_agentd.service
250install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_proxy.service
251install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_java.service
252
253install %{SOURCE6} $RPM_BUILD_ROOT%{tmpfilesdir}/zabbix.conf
254
255mv $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf $RPM_BUILD_ROOT%{_sysconfdir}/frontend
256ln -s %{_sysconfdir}/frontend $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf
257touch $RPM_BUILD_ROOT%{_sysconfdir}/frontend/zabbix.conf.php
258
cd323295
JK
259%if %{with java}
260mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf
261ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh
06317756
JK
262mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback.xml
263ln -s %{_sysconfdir}/java-logback.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml
264mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback-console.xml
265ln -s %{_sysconfdir}/java-logback-console.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml
cd323295
JK
266
267cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF'
268#!/bin/sh
269
270exec %{_datadir}/zabbix_java/startup.sh "$@"
271EOF
272
273cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF'
274#!/bin/sh
275
276exec %{_datadir}/zabbix_java/shutdown.sh "$@"
277EOF
278%endif
10a854a6
TO
279
280%clean
281rm -rf $RPM_BUILD_ROOT
282
7dcff817
TP
283%triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base
284%webapp_register apache %{_webapp}
285
286%triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base
287%webapp_unregister apache %{_webapp}
288
289%triggerin frontend-php -- apache < 2.2.0, apache-base
290%webapp_register httpd %{_webapp}
291
292%triggerun frontend-php -- apache < 2.2.0, apache-base
293%webapp_unregister httpd %{_webapp}
294
06317756 295%pre common
78794d78
ER
296%groupadd -g 111 zabbix
297%useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
10a854a6 298
06317756
JK
299%postun common
300if [ "$1" = "0" ]; then
301 %userremove zabbix
302 %groupremove zabbix
303fi
304
27f8996a 305%post server
96b8972f 306if [ "$1" = 1 ]; then
cd323295 307 %banner -e %{name}-server <<-EOF
c4962172 308 You should create database for Zabbix.
c4962172 309%if %{with pgsql}
cd323295 310 Running these should be fine in most cases:
c4962172 311 psql -c 'create database zabbix'
cd323295 312 zcat %{_docdir}/%{name}-server-%{version}/postgresql/schema.sql.gz | psql zabbix
cd323295 313 zcat %{_docdir}/%{name}-server-%{version}/postgresql/images.sql.gz | psql zabbix
06317756 314 zcat %{_docdir}/%{name}-server-%{version}/postgresql/data.sql.gz | psql zabbix
c4962172 315%else
cd323295
JK
316%if %{with mysql}
317 Running these should be fine in most cases:
c4962172 318 mysqladmin create zabbix
cd323295
JK
319 zcat %{_docdir}/%{name}-server-%{version}/mysql/schema.sql.gz | mysql zabbix
320 zcat %{_docdir}/%{name}-server-%{version}/mysql/images.sql.gz | mysql zabbix
321 zcat %{_docdir}/%{name}-server-%{version}/mysql/data.sql.gz | mysql zabbix
322%else
323 Database template is available in %{_docdir}/%{name}-%{version}
324%endif
c4962172 325%endif
cd323295 326 %{?TODO:You also need zabbix-agent. install zabbix-agentd.}
c4962172 327EOF
96b8972f 328fi
06317756 329%systemd_post zabbix_server.service
c4962172 330
06317756
JK
331%preun server
332%systemd_preun zabbix_server.service
333
334%postun server
335%systemd_reload
336
337%post agentd
338%systemd_post zabbix_agentd.service
339
340%preun agentd
341%systemd_preun zabbix_agentd.service
342
343%postun agentd
344%systemd_reload
345
346%post proxy
347%systemd_post zabbix_proxy.service
348
349%preun proxy
350%systemd_preun zabbix_proxy.service
351
352%postun proxy
353%systemd_reload
354
355%post java
356%systemd_post zabbix_java.service
357
358%preun java
359%systemd_preun zabbix_java.service
360
361%postun java
362%systemd_reload
10a854a6 363
10a854a6
TO
364%files
365%defattr(644,root,root,755)
cd323295 366%doc AUTHORS ChangeLog README
06317756
JK
367
368%files common
369%defattr(644,root,root,755)
370%doc AUTHORS ChangeLog README
371%attr(751,root,zabbix) %dir %{_sysconfdir}
372%attr(751,root,http) %dir %{_sysconfdir}/frontend
e4c376d6 373%dir %{_appdir}
7dcff817 374%dir %{_appdir}/frontends
06317756
JK
375%dir %attr(770,root,zabbix) /run/zabbix
376%dir %attr(775,root,zabbix) /var/log/zabbix
10a854a6 377
cd323295 378%files agentd
10a854a6 379%defattr(644,root,root,755)
7dcff817 380%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
b0f13a65 381%attr(755,root,root) %{_sbindir}/zabbix_agentd
ed93a3d2 382%{_mandir}/man8/zabbix_agentd*
06317756 383%{systemdunitdir}/zabbix_agentd.service
10a854a6 384
7dcff817 385%files frontend-php
10a854a6 386%defattr(644,root,root,755)
7dcff817
TP
387%attr(750,root,http) %dir %{_webapps}/%{_webapp}
388%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/*
389%{_appdir}/frontends/php
06317756
JK
390%ghost %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php
391%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/.htaccess
392%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/maintenance.inc.php
393%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php.example
10a854a6 394
a7e2963d 395%files get
10a854a6 396%defattr(644,root,root,755)
ed93a3d2 397%attr(755,root,root) %{_bindir}/zabbix_get
398%{_mandir}/man1/zabbix_get*
10a854a6 399
1b6bdd87 400%files proxy
401%defattr(644,root,root,755)
cd323295 402%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf
1b6bdd87 403%attr(755,root,root) %{_sbindir}/zabbix_proxy
404%{_mandir}/man8/zabbix_proxy*
06317756 405%{systemdunitdir}/zabbix_proxy.service
1b6bdd87 406
7dcff817
TP
407%files sender
408%defattr(644,root,root,755)
ed93a3d2 409%attr(755,root,root) %{_bindir}/zabbix_sender
410%{_mandir}/man1/zabbix_sender*
7dcff817 411
a7e2963d 412%files server
10a854a6 413%defattr(644,root,root,755)
cd323295
JK
414%doc upgrades/dbpatches
415%if %{with mysql}
416%doc database/mysql
417%endif
06317756 418%if %{with pgsql}
cd323295
JK
419%doc database/postgresql
420%endif
421%if %{with oracle}
422%doc database/oracle
423%endif
424%if %{with sqlite3}
425%doc database/sqlite3
426%endif
7dcff817 427%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
b0f13a65 428%attr(755,root,root) %{_sbindir}/zabbix_server
ed93a3d2 429%{_mandir}/man8/zabbix_server*
06317756 430%{systemdunitdir}/zabbix_server.service
cd323295
JK
431
432%if %{with java}
433%files java
434%defattr(644,root,root,755)
435%attr(755,root,root) %{_sbindir}/zabbix_java-start
436%attr(755,root,root) %{_sbindir}/zabbix_java-stop
437%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf
06317756
JK
438%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback.xml
439%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback-console.xml
cd323295
JK
440%dir %{_datadir}/zabbix_java
441%{_datadir}/zabbix_java/bin
442%{_datadir}/zabbix_java/lib
443%{_datadir}/zabbix_java/settings.sh
444%attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh
445%attr(755,root,root) %{_datadir}/zabbix_java/startup.sh
06317756 446%{systemdunitdir}/zabbix_java.service
cd323295 447%endif
This page took 0.189537 seconds and 4 git commands to generate.