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