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