]> git.pld-linux.org Git - packages/zabbix.git/blame - zabbix.spec
PHP dependencies updated
[packages/zabbix.git] / zabbix.spec
CommitLineData
c4962172 1# TODO
cd323295
JK
2# - systemd units for zabbix-agentd, zabbix-server and zabbix-java
3# - initscript for zabbix-agentd, zabbix-server and zabbix-java
10a854a6
TO
4#
5# Conditional build:
cd323295
JK
6%bcond_with pgsql # enable PostgreSQL support
7%bcond_with oracle # enable Oracle support
8%bcond_with sqlite3 # enable sqlite3 support
9%bcond_without mysql # enable MySQL support
10
11%bcond_without java # disable java support
12
13%if %{with pgsql} || %{with oracle} || %{with sqlite3}
14%undefine with_mysql
15%endif
16
17%if %{?with_pgsql:1}%{?with_oracle:1}%{?with_sqlite3:1}%{?with_mysql:1} != 1
18ERROR: exactly one database must be selected
19%endif
2fe2194b 20
1d07384b
JK
21%define php_min_version 5.4.0
22
7f4b6a83 23Summary: zabbix - network monitoring software
5750cc93 24Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci
10a854a6 25Name: zabbix
cd323295 26Version: 3.2.0
3b06db17 27Release: 0.1
10a854a6 28License: GPL v2+
d0e25550 29Group: Networking/Utilities
b37e41ff 30Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
cd323295
JK
31# Source0-md5: e2491b482868059f251902d5f636eacb
32Source1: %{name}-apache.conf
10a854a6 33URL: http://zabbix.sourceforge.net/
cd323295 34BuildRequires: OpenIPMI-devel
73af344b 35BuildRequires: curl-devel
36BuildRequires: iksemel-devel
cd323295
JK
37%{?with_java:BuildRequires: jdk}
38BuildRequires: libxml2-devel
39BuildRequires: libssh2-devel
40%{?with_mysql:BuildRequires: mysql-devel}
39709426 41BuildRequires: net-snmp-devel
246efd79 42BuildRequires: openldap-devel >= 2.4.6
2886d983 43BuildRequires: openssl-devel >= 0.9.7d
9ffbc0d2 44%{?with_pgsql:BuildRequires: postgresql-devel}
cd323295
JK
45%{?with_sqlite3:BuildRequires: sqlite3-devel}
46BuildRequires: unixODBC-devel
96b8972f 47BuildRequires: rpmbuild(macros) >= 1.268
9ffbc0d2
ER
48Requires(postun): /usr/sbin/groupdel
49Requires(postun): /usr/sbin/userdel
a5bb35f6 50Requires(pre): /bin/id
9b19117f 51Requires(pre): /usr/bin/getgid
a5bb35f6
JB
52Requires(pre): /usr/sbin/groupadd
53Requires(pre): /usr/sbin/useradd
9b19117f 54Provides: group(zabbix)
55Provides: user(zabbix)
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
b82afc4b 64zabbix is software that monitors numerous parameters of a network and
1266ba50 65the servers on that network. It is a useful tool for monitoring
b82afc4b 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
b82afc4b 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
JR
74%description -l pl.UTF-8
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ą
80przechowywane w bazie danych. W oparciu o przechowywane dane zabbix
81oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno
82odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i
83statystyk zabbiksa jest możliwy poprzez interfejs oparty o WWW.
10a854a6 84
cd323295 85%package agentd
7f4b6a83 86Summary: Standalone agent for zabbix
5750cc93 87Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa
d0e25550 88Group: Networking/Utilities
b37e41ff 89Requires: %{name} = %{version}-%{release}
96b8972f 90Obsoletes: zabbix-agent-inetd
cd323295 91Obsoletes: zabbix-agent-standalone
10a854a6 92
cd323295
JK
93%description agentd
94This package provides the zabbix agent.
90e6d4b1 95
cd323295
JK
96%description agentd -l pl.UTF-8
97Ten pakiet dostarcza agenta zabbiksa.
7dcff817
TP
98
99%package frontend-php
100Summary: PHP frontend for zabbix
101Summary(pl.UTF-8): Interfejs PHP dla zabbiksa
d0e25550 102Group: Applications/WWW
cd323295 103Requires: php(bcmath)
1d07384b 104Requires: php(core) >= %{php_min_version}
cd323295 105Requires: php(ctype)
1d07384b
JK
106Requires: php(gd)
107Requires: php(gettext)
cd323295
JK
108Requires: php(mbstring)
109Requires: php(pcre)
cd323295 110Requires: php(session)
1d07384b
JK
111Requires: php(sockets)
112Requires: php(xml)
113Requires: php(xmlreader)
114Requires: php(xmlwriter)
cd323295
JK
115%{?with_mysql:Requires: php(mysql)}
116%{?with_pgsql:Requires: php(pgsql)}
7dcff817 117Requires: webapps
7dcff817
TP
118Requires: webserver(php)
119
120%description frontend-php
121This package provides web based (PHP) frontend for zabbix.
122
123%description frontend-php -l pl.UTF-8
124Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa.
125
126%package get
127Summary: Program retrieving data from zabbix agent
128Summary(pl.UTF-8): Program odpytujÄcy agenta zabbiksa
d0e25550 129Group: Networking/Utilities
7dcff817
TP
130
131%description get
132This package provides a program retrieving data from zabbix agent.
133
134%description get -l pl.UTF-8
135Ten pakiet zawiera program odpytujÄcy agenta zabbiksa.
10a854a6 136
1b6bdd87 137%package proxy
138Summary: Zabbix proxy
139Summary(pl.UTF-8): Proxy do zabbiksa
140Group: Networking/Utilities
141
142%description proxy
143This package provides the zabbix proxy.
144
145%description proxy -l pl.UTF-8
146Ten pakiet zawiera proxy zabbix.
147
10a854a6 148%package sender
7dcff817 149Summary: Zabbix sender
5750cc93 150Summary(pl.UTF-8): Program zawiadamiający zabbiksa
d0e25550 151Group: Networking/Utilities
10a854a6
TO
152
153%description sender
39709426 154This package provides the zabbix sender.
10a854a6 155
ff14176a
JR
156%description sender -l pl.UTF-8
157Ten pakiet zawiera program zawiadamiający zabbiksa.
a5bb35f6 158
a7e2963d 159%package server
7dcff817
TP
160Summary: Zabbix server
161Summary(pl.UTF-8): Serwer zabbiksa
d0e25550 162Group: Networking/Utilities
7dcff817 163Requires: %{name} = %{version}-%{release}
1266ba50
TP
164Obsoletes: %{name}-suckerd
165Obsoletes: %{name}-trapper-inetd
166Obsoletes: %{name}-trapper-standalone
a7e2963d 167
168%description server
169This package provides the zabbix server.
170
171%description server -l pl.UTF-8
172Ten pakiet zawiera serwer zabbiksa.
173
cd323295
JK
174%package java
175Summary: Zabbix Java Gateway
176Group: Networking/Utilities
177Requires: %{name} = %{version}-%{release}
178
179%description java
180This package provides the Zabbix Java Gateway.
181
10a854a6 182%prep
5d18cc59 183%setup -q
10a854a6
TO
184
185%build
10a854a6 186%configure \
cd323295 187 %{?with_mysql:--with-mysql} \
39709426 188 %{?with_pgsql:--with-pgsql} \
2fe2194b 189 %{?with_oracle:--with-oracle} \
cd323295 190 %{?with_sqlite3:--with-sqlite3} \
2fe2194b
MWP
191 --enable-server \
192 --enable-agent \
1b6bdd87 193 --enable-proxy \
cd323295
JK
194 --enable-ipv6 \
195 %{__enable_disable java} \
73af344b 196 --with-jabber \
cd323295
JK
197 --with-ldap \
198 --with-libcurl \
199 --with-libxml2 \
200 --with-net-snmp \
201 --with-openipmi \
202 --with-openssl \
203 --with-ssh2 \
204 --with-unixodbc
10a854a6
TO
205
206%{__make}
207
208%install
209rm -rf $RPM_BUILD_ROOT
cd323295 210install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}}
10a854a6 211
2fe2194b 212%{__make} install \
cd323295
JK
213 DESTDIR=$RPM_BUILD_ROOT \
214 ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java
10a854a6 215
7dcff817 216cp -r frontends $RPM_BUILD_ROOT%{_appdir}
27f8996a 217#mv -f $RPM_BUILD_ROOT%{_appdir}/frontends/php/include/db.inc.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
218#ln -s %{_webapps}/%{_webapp}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/frontends/php/include
cd323295
JK
219install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
220install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
221
222%if %{with java}
223mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf
224ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh
225
226cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF'
227#!/bin/sh
228
229exec %{_datadir}/zabbix_java/startup.sh "$@"
230EOF
231
232cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF'
233#!/bin/sh
234
235exec %{_datadir}/zabbix_java/shutdown.sh "$@"
236EOF
237%endif
10a854a6
TO
238
239%clean
240rm -rf $RPM_BUILD_ROOT
241
7dcff817
TP
242%triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base
243%webapp_register apache %{_webapp}
244
245%triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base
246%webapp_unregister apache %{_webapp}
247
248%triggerin frontend-php -- apache < 2.2.0, apache-base
249%webapp_register httpd %{_webapp}
250
251%triggerun frontend-php -- apache < 2.2.0, apache-base
252%webapp_unregister httpd %{_webapp}
253
e9e15753 254%pre
78794d78
ER
255%groupadd -g 111 zabbix
256%useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
10a854a6 257
27f8996a 258%post server
96b8972f 259if [ "$1" = 1 ]; then
cd323295 260 %banner -e %{name}-server <<-EOF
c4962172 261 You should create database for Zabbix.
c4962172 262%if %{with pgsql}
cd323295 263 Running these should be fine in most cases:
c4962172 264 psql -c 'create database zabbix'
cd323295
JK
265 zcat %{_docdir}/%{name}-server-%{version}/postgresql/schema.sql.gz | psql zabbix
266 zcat %{_docdir}/%{name}-server-%{version}/postgresql/data.sql.gz | psql zabbix
267 zcat %{_docdir}/%{name}-server-%{version}/postgresql/images.sql.gz | psql zabbix
c4962172 268%else
cd323295
JK
269%if %{with mysql}
270 Running these should be fine in most cases:
c4962172 271 mysqladmin create zabbix
cd323295
JK
272 zcat %{_docdir}/%{name}-server-%{version}/mysql/schema.sql.gz | mysql zabbix
273 zcat %{_docdir}/%{name}-server-%{version}/mysql/images.sql.gz | mysql zabbix
274 zcat %{_docdir}/%{name}-server-%{version}/mysql/data.sql.gz | mysql zabbix
275%else
276 Database template is available in %{_docdir}/%{name}-%{version}
277%endif
c4962172 278%endif
cd323295 279 %{?TODO:You also need zabbix-agent. install zabbix-agentd.}
c4962172 280EOF
96b8972f 281fi
c4962172 282
e9e15753 283%postun
10a854a6 284if [ "$1" = "0" ]; then
9b19117f 285 %userremove zabbix
286 %groupremove zabbix
10a854a6
TO
287fi
288
10a854a6
TO
289%files
290%defattr(644,root,root,755)
cd323295 291%doc AUTHORS ChangeLog README
7dcff817 292%attr(750,root,zabbix) %dir %{_sysconfdir}
e4c376d6 293%dir %{_appdir}
7dcff817 294%dir %{_appdir}/frontends
10a854a6 295
cd323295 296%files agentd
10a854a6 297%defattr(644,root,root,755)
7dcff817 298%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
b0f13a65 299%attr(755,root,root) %{_sbindir}/zabbix_agentd
ed93a3d2 300%{_mandir}/man8/zabbix_agentd*
10a854a6 301
7dcff817 302%files frontend-php
10a854a6 303%defattr(644,root,root,755)
7dcff817
TP
304%attr(750,root,http) %dir %{_webapps}/%{_webapp}
305%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/*
306%{_appdir}/frontends/php
10a854a6 307
a7e2963d 308%files get
10a854a6 309%defattr(644,root,root,755)
ed93a3d2 310%attr(755,root,root) %{_bindir}/zabbix_get
311%{_mandir}/man1/zabbix_get*
10a854a6 312
1b6bdd87 313%files proxy
314%defattr(644,root,root,755)
cd323295 315%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf
1b6bdd87 316%attr(755,root,root) %{_sbindir}/zabbix_proxy
317%{_mandir}/man8/zabbix_proxy*
318
7dcff817
TP
319%files sender
320%defattr(644,root,root,755)
ed93a3d2 321%attr(755,root,root) %{_bindir}/zabbix_sender
322%{_mandir}/man1/zabbix_sender*
7dcff817 323
a7e2963d 324%files server
10a854a6 325%defattr(644,root,root,755)
cd323295
JK
326%doc upgrades/dbpatches
327%if %{with mysql}
328%doc database/mysql
329%endif
330%if %{with postgresql}
331%doc database/postgresql
332%endif
333%if %{with oracle}
334%doc database/oracle
335%endif
336%if %{with sqlite3}
337%doc database/sqlite3
338%endif
7dcff817 339%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
b0f13a65 340%attr(755,root,root) %{_sbindir}/zabbix_server
ed93a3d2 341%{_mandir}/man8/zabbix_server*
cd323295
JK
342
343%if %{with java}
344%files java
345%defattr(644,root,root,755)
346%attr(755,root,root) %{_sbindir}/zabbix_java-start
347%attr(755,root,root) %{_sbindir}/zabbix_java-stop
348%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf
349%dir %{_datadir}/zabbix_java
350%{_datadir}/zabbix_java/bin
351%{_datadir}/zabbix_java/lib
352%{_datadir}/zabbix_java/settings.sh
353%attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh
354%attr(755,root,root) %{_datadir}/zabbix_java/startup.sh
355%endif
This page took 0.091666 seconds and 4 git commands to generate.