]>
Commit | Line | Data |
---|---|---|
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 | |
18 | ERROR: exactly one database must be selected | |
19 | %endif | |
2fe2194b | 20 | |
1d07384b JK |
21 | %define php_min_version 5.4.0 |
22 | ||
7f4b6a83 | 23 | Summary: zabbix - network monitoring software |
5750cc93 | 24 | Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci |
10a854a6 | 25 | Name: zabbix |
cd323295 | 26 | Version: 3.2.0 |
3b06db17 | 27 | Release: 0.1 |
10a854a6 | 28 | License: GPL v2+ |
d0e25550 | 29 | Group: Networking/Utilities |
b37e41ff | 30 | Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz |
cd323295 JK |
31 | # Source0-md5: e2491b482868059f251902d5f636eacb |
32 | Source1: %{name}-apache.conf | |
10a854a6 | 33 | URL: http://zabbix.sourceforge.net/ |
cd323295 | 34 | BuildRequires: OpenIPMI-devel |
73af344b | 35 | BuildRequires: curl-devel |
36 | BuildRequires: iksemel-devel | |
cd323295 JK |
37 | %{?with_java:BuildRequires: jdk} |
38 | BuildRequires: libxml2-devel | |
39 | BuildRequires: libssh2-devel | |
40 | %{?with_mysql:BuildRequires: mysql-devel} | |
39709426 | 41 | BuildRequires: net-snmp-devel |
246efd79 | 42 | BuildRequires: openldap-devel >= 2.4.6 |
2886d983 | 43 | BuildRequires: openssl-devel >= 0.9.7d |
9ffbc0d2 | 44 | %{?with_pgsql:BuildRequires: postgresql-devel} |
cd323295 JK |
45 | %{?with_sqlite3:BuildRequires: sqlite3-devel} |
46 | BuildRequires: unixODBC-devel | |
96b8972f | 47 | BuildRequires: rpmbuild(macros) >= 1.268 |
9ffbc0d2 ER |
48 | Requires(postun): /usr/sbin/groupdel |
49 | Requires(postun): /usr/sbin/userdel | |
a5bb35f6 | 50 | Requires(pre): /bin/id |
9b19117f | 51 | Requires(pre): /usr/bin/getgid |
a5bb35f6 JB |
52 | Requires(pre): /usr/sbin/groupadd |
53 | Requires(pre): /usr/sbin/useradd | |
9b19117f | 54 | Provides: group(zabbix) |
55 | Provides: user(zabbix) | |
10a854a6 TO |
56 | BuildRoot: %{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 | 64 | zabbix is software that monitors numerous parameters of a network and |
1266ba50 | 65 | the servers on that network. It is a useful tool for monitoring |
b82afc4b | 66 | the health and integrity of servers. zabbix uses a flexible |
7f4b6a83 | 67 | notification mechanism that allows users to configure email based |
68 | alerts for virtually any event. All monitored parameters are stored in | |
b82afc4b | 69 | a database. zabbix offers excellent reporting and data visualisation |
70 | features based on the stored data. zabbix supports both polling and | |
71 | trapping. All zabbix reports and statistics, as well as configuration | |
7f4b6a83 | 72 | parameters, are accessed through a web-based front end. |
73 | ||
ff14176a JR |
74 | %description -l pl.UTF-8 |
75 | zabbix to oprogramowanie do monitorowania licznych parametrów sieci i | |
1266ba50 TP |
76 | serwerów sieciowych. Jest przydatny przy monitorowaniu działania |
77 | serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który | |
78 | pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną | |
79 | dla praktycznie wszelkich zdarzeń. Monitorowane parametry są | |
80 | przechowywane w bazie danych. W oparciu o przechowywane dane zabbix | |
81 | oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno | |
82 | odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i | |
83 | statystyk zabbiksa jest możliwy poprzez interfejs oparty o WWW. | |
10a854a6 | 84 | |
cd323295 | 85 | %package agentd |
7f4b6a83 | 86 | Summary: Standalone agent for zabbix |
5750cc93 | 87 | Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa |
d0e25550 | 88 | Group: Networking/Utilities |
b37e41ff | 89 | Requires: %{name} = %{version}-%{release} |
96b8972f | 90 | Obsoletes: zabbix-agent-inetd |
cd323295 | 91 | Obsoletes: zabbix-agent-standalone |
10a854a6 | 92 | |
cd323295 JK |
93 | %description agentd |
94 | This package provides the zabbix agent. | |
90e6d4b1 | 95 | |
cd323295 JK |
96 | %description agentd -l pl.UTF-8 |
97 | Ten pakiet dostarcza agenta zabbiksa. | |
7dcff817 TP |
98 | |
99 | %package frontend-php | |
100 | Summary: PHP frontend for zabbix | |
101 | Summary(pl.UTF-8): Interfejs PHP dla zabbiksa | |
d0e25550 | 102 | Group: Applications/WWW |
cd323295 | 103 | Requires: php(bcmath) |
1d07384b | 104 | Requires: php(core) >= %{php_min_version} |
cd323295 | 105 | Requires: php(ctype) |
1d07384b JK |
106 | Requires: php(gd) |
107 | Requires: php(gettext) | |
cd323295 JK |
108 | Requires: php(mbstring) |
109 | Requires: php(pcre) | |
cd323295 | 110 | Requires: php(session) |
1d07384b JK |
111 | Requires: php(sockets) |
112 | Requires: php(xml) | |
113 | Requires: php(xmlreader) | |
114 | Requires: php(xmlwriter) | |
cd323295 JK |
115 | %{?with_mysql:Requires: php(mysql)} |
116 | %{?with_pgsql:Requires: php(pgsql)} | |
7dcff817 | 117 | Requires: webapps |
7dcff817 TP |
118 | Requires: webserver(php) |
119 | ||
120 | %description frontend-php | |
121 | This package provides web based (PHP) frontend for zabbix. | |
122 | ||
123 | %description frontend-php -l pl.UTF-8 | |
124 | Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa. | |
125 | ||
126 | %package get | |
127 | Summary: Program retrieving data from zabbix agent | |
128 | Summary(pl.UTF-8): Program odpytujÄcy agenta zabbiksa | |
d0e25550 | 129 | Group: Networking/Utilities |
7dcff817 TP |
130 | |
131 | %description get | |
132 | This package provides a program retrieving data from zabbix agent. | |
133 | ||
134 | %description get -l pl.UTF-8 | |
135 | Ten pakiet zawiera program odpytujÄcy agenta zabbiksa. | |
10a854a6 | 136 | |
1b6bdd87 | 137 | %package proxy |
138 | Summary: Zabbix proxy | |
139 | Summary(pl.UTF-8): Proxy do zabbiksa | |
140 | Group: Networking/Utilities | |
141 | ||
142 | %description proxy | |
143 | This package provides the zabbix proxy. | |
144 | ||
145 | %description proxy -l pl.UTF-8 | |
146 | Ten pakiet zawiera proxy zabbix. | |
147 | ||
10a854a6 | 148 | %package sender |
7dcff817 | 149 | Summary: Zabbix sender |
5750cc93 | 150 | Summary(pl.UTF-8): Program zawiadamiający zabbiksa |
d0e25550 | 151 | Group: Networking/Utilities |
10a854a6 TO |
152 | |
153 | %description sender | |
39709426 | 154 | This package provides the zabbix sender. |
10a854a6 | 155 | |
ff14176a JR |
156 | %description sender -l pl.UTF-8 |
157 | Ten pakiet zawiera program zawiadamiający zabbiksa. | |
a5bb35f6 | 158 | |
a7e2963d | 159 | %package server |
7dcff817 TP |
160 | Summary: Zabbix server |
161 | Summary(pl.UTF-8): Serwer zabbiksa | |
d0e25550 | 162 | Group: Networking/Utilities |
7dcff817 | 163 | Requires: %{name} = %{version}-%{release} |
1266ba50 TP |
164 | Obsoletes: %{name}-suckerd |
165 | Obsoletes: %{name}-trapper-inetd | |
166 | Obsoletes: %{name}-trapper-standalone | |
a7e2963d | 167 | |
168 | %description server | |
169 | This package provides the zabbix server. | |
170 | ||
171 | %description server -l pl.UTF-8 | |
172 | Ten pakiet zawiera serwer zabbiksa. | |
173 | ||
cd323295 JK |
174 | %package java |
175 | Summary: Zabbix Java Gateway | |
176 | Group: Networking/Utilities | |
177 | Requires: %{name} = %{version}-%{release} | |
178 | ||
179 | %description java | |
180 | This 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 | |
209 | rm -rf $RPM_BUILD_ROOT | |
cd323295 | 210 | install -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 | 216 | cp -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 |
219 | install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
220 | install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
221 | ||
222 | %if %{with java} | |
223 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf | |
224 | ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh | |
225 | ||
226 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF' | |
227 | #!/bin/sh | |
228 | ||
229 | exec %{_datadir}/zabbix_java/startup.sh "$@" | |
230 | EOF | |
231 | ||
232 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF' | |
233 | #!/bin/sh | |
234 | ||
235 | exec %{_datadir}/zabbix_java/shutdown.sh "$@" | |
236 | EOF | |
237 | %endif | |
10a854a6 TO |
238 | |
239 | %clean | |
240 | rm -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 | 259 | if [ "$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 | 280 | EOF |
96b8972f | 281 | fi |
c4962172 | 282 | |
e9e15753 | 283 | %postun |
10a854a6 | 284 | if [ "$1" = "0" ]; then |
9b19117f | 285 | %userremove zabbix |
286 | %groupremove zabbix | |
10a854a6 TO |
287 | fi |
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 |