]>
Commit | Line | Data |
---|---|---|
06317756 JK |
1 | # TODO: |
2 | # - initscript for zabbix-agentd, zabbix-server, zabbix-proxy and zabbix-java | |
10a854a6 TO |
3 | # |
4 | # Conditional build: | |
7efbcfc2 JK |
5 | %bcond_without pgsql # enable PostgreSQL support |
6 | %bcond_without sqlite3 # enable sqlite3 support | |
cd323295 | 7 | %bcond_without mysql # enable MySQL support |
cd323295 JK |
8 | %bcond_without java # disable java support |
9 | ||
7efbcfc2 | 10 | %define databases %{?with_pgsql:postgresql} %{?with_mysql:mysql} %{?with_sqlite3:sqlite3} |
2a82feb1 | 11 | %define any_database %{with pgsql}%{with mysql}%{with sqlite3} |
2fe2194b | 12 | |
0196d0f6 | 13 | %define php_min_version 5.4.0 |
06317756 JK |
14 | Summary: Zabbix - network monitoring software |
15 | Summary(pl.UTF-8): Zabbix - oprogramowanie do monitorowania sieci | |
10a854a6 | 16 | Name: zabbix |
cd323295 | 17 | Version: 3.2.0 |
30d58f27 | 18 | Release: 1 |
10a854a6 | 19 | License: GPL v2+ |
d0e25550 | 20 | Group: Networking/Utilities |
88b80688 | 21 | Source0: http://downloads.sourceforge.net/zabbix/%{name}-%{version}.tar.gz |
cd323295 JK |
22 | # Source0-md5: e2491b482868059f251902d5f636eacb |
23 | Source1: %{name}-apache.conf | |
0196d0f6 ER |
24 | Source2: %{name}_server.service |
25 | Source3: %{name}_agentd.service | |
26 | Source4: %{name}_proxy.service | |
27 | Source5: %{name}_java.service | |
28 | Source6: %{name}.tmpfiles | |
06317756 | 29 | Patch0: config.patch |
7efbcfc2 | 30 | Patch1: sqlite3_dbname.patch |
f339e071 | 31 | Patch2: tag_conditions.patch |
10a854a6 | 32 | URL: http://zabbix.sourceforge.net/ |
cd323295 | 33 | BuildRequires: OpenIPMI-devel |
73af344b | 34 | BuildRequires: curl-devel |
35 | BuildRequires: iksemel-devel | |
cd323295 | 36 | %{?with_java:BuildRequires: jdk} |
cd323295 | 37 | BuildRequires: libssh2-devel |
0196d0f6 | 38 | BuildRequires: libxml2-devel |
cd323295 | 39 | %{?with_mysql:BuildRequires: mysql-devel} |
39709426 | 40 | BuildRequires: net-snmp-devel |
246efd79 | 41 | BuildRequires: openldap-devel >= 2.4.6 |
2886d983 | 42 | BuildRequires: openssl-devel >= 0.9.7d |
9ffbc0d2 | 43 | %{?with_pgsql:BuildRequires: postgresql-devel} |
0196d0f6 | 44 | BuildRequires: rpmbuild(macros) >= 1.671 |
cd323295 JK |
45 | %{?with_sqlite3:BuildRequires: sqlite3-devel} |
46 | BuildRequires: unixODBC-devel | |
0196d0f6 ER |
47 | Requires: %{name}-agentd = %{version}-%{release} |
48 | Requires: %{name}-frontend-php = %{version}-%{release} | |
49 | Requires: %{name}-server = %{version}-%{release} | |
10a854a6 TO |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
a5bb35f6 | 52 | %define _sysconfdir /etc/%{name} |
7dcff817 TP |
53 | %define _appdir %{_datadir}/%{name} |
54 | %define _webapps /etc/webapps | |
55 | %define _webapp %{name} | |
10a854a6 TO |
56 | |
57 | %description | |
06317756 | 58 | Zabbix is software that monitors numerous parameters of a network and |
0196d0f6 ER |
59 | the servers on that network. It is a useful tool for monitoring the |
60 | health and integrity of servers. Zabbix uses a flexible notification | |
61 | mechanism that allows users to configure email based alerts for | |
62 | virtually any event. All monitored parameters are stored in a | |
63 | database. Zabbix offers excellent reporting and data visualisation | |
06317756 JK |
64 | features based on the stored data. Zabbix supports both polling and |
65 | trapping. All Zabbix reports and statistics, as well as configuration | |
7f4b6a83 | 66 | parameters, are accessed through a web-based front end. |
67 | ||
ff14176a | 68 | %description -l pl.UTF-8 |
06317756 | 69 | Zabbix to oprogramowanie do monitorowania licznych parametrów sieci i |
1266ba50 TP |
70 | serwerów sieciowych. Jest przydatny przy monitorowaniu działania |
71 | serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który | |
72 | pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną | |
73 | dla praktycznie wszelkich zdarzeń. Monitorowane parametry są | |
06317756 | 74 | przechowywane w bazie danych. W oparciu o przechowywane dane Zabbix |
1266ba50 TP |
75 | oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno |
76 | odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i | |
06317756 JK |
77 | statystyk Zabbiksa jest możliwy poprzez interfejs oparty o WWW. |
78 | ||
79 | %package common | |
80 | Summary: Common files for Zabbix monitoring software | |
81 | Summary(pl.UTF-8): Wspólne pliki dla oprogramowania monitorującego Zabbix | |
82 | Group: Networking/Utilities | |
83 | Requires(postun): /usr/sbin/groupdel | |
84 | Requires(postun): /usr/sbin/userdel | |
85 | Requires(pre): /bin/id | |
86 | Requires(pre): /usr/bin/getgid | |
87 | Requires(pre): /usr/sbin/groupadd | |
88 | Requires(pre): /usr/sbin/useradd | |
89 | Provides: group(zabbix) | |
90 | Provides: user(zabbix) | |
91 | ||
92 | %description common | |
93 | Common files for Zabbix monitoring software. | |
94 | ||
95 | %description common -l pl.UTF-8 | |
96 | Wspólne pliki dla oprogramowania monitorującego Zabbix. | |
10a854a6 | 97 | |
cd323295 | 98 | %package agentd |
06317756 JK |
99 | Summary: Zabbix Agent |
100 | Summary(pl.UTF-8): Agenta Zabbiksa | |
d0e25550 | 101 | Group: Networking/Utilities |
06317756 | 102 | Requires: %{name}-common = %{version}-%{release} |
0196d0f6 | 103 | Requires: systemd-units >= 38 |
96b8972f | 104 | Obsoletes: zabbix-agent-inetd |
cd323295 | 105 | Obsoletes: zabbix-agent-standalone |
10a854a6 | 106 | |
cd323295 | 107 | %description agentd |
06317756 | 108 | Zabbix agent collects data from the local system for a Zabbix server. |
90e6d4b1 | 109 | |
cd323295 | 110 | %description agentd -l pl.UTF-8 |
06317756 | 111 | Agent zbiera dane z lokalnej maszyny dla serwera Zabbix. |
7dcff817 TP |
112 | |
113 | %package frontend-php | |
06317756 JK |
114 | Summary: PHP frontend for Zabbix |
115 | Summary(pl.UTF-8): Interfejs PHP dla Zabbiksa | |
d0e25550 | 116 | Group: Applications/WWW |
cd323295 | 117 | Requires: php(bcmath) |
1d07384b | 118 | Requires: php(core) >= %{php_min_version} |
cd323295 | 119 | Requires: php(ctype) |
1d07384b JK |
120 | Requires: php(gd) |
121 | Requires: php(gettext) | |
8cc30dbd | 122 | Requires: php(json) |
cd323295 JK |
123 | Requires: php(mbstring) |
124 | Requires: php(pcre) | |
cd323295 | 125 | Requires: php(session) |
1d07384b JK |
126 | Requires: php(sockets) |
127 | Requires: php(xml) | |
128 | Requires: php(xmlreader) | |
129 | Requires: php(xmlwriter) | |
7dcff817 | 130 | Requires: webapps |
cb5654b1 | 131 | Requires: webserver(alias) |
66fbc8af | 132 | Requires: webserver(indexfile) |
7dcff817 | 133 | Requires: webserver(php) |
7efbcfc2 JK |
134 | Suggests: php(mysql) |
135 | Suggests: php(pgsql) | |
136 | Suggests: php(sqlite3) | |
7dcff817 TP |
137 | |
138 | %description frontend-php | |
06317756 | 139 | This package provides web based (PHP) frontend for Zabbix. |
7dcff817 TP |
140 | |
141 | %description frontend-php -l pl.UTF-8 | |
06317756 | 142 | Ten pakiet dostarcza napisany w PHP frontend dla Zabbiksa. |
7dcff817 TP |
143 | |
144 | %package get | |
06317756 JK |
145 | Summary: Program retrieving data from Zabbix agent |
146 | Summary(pl.UTF-8): Program odpytujÄcy agenta Zabbiksa | |
d0e25550 | 147 | Group: Networking/Utilities |
7dcff817 TP |
148 | |
149 | %description get | |
06317756 | 150 | This package provides a program retrieving data from Zabbix agent. |
7dcff817 TP |
151 | |
152 | %description get -l pl.UTF-8 | |
06317756 | 153 | Ten pakiet zawiera program odpytujÄcy agenta Zabbiksa. |
10a854a6 | 154 | |
1b6bdd87 | 155 | %package proxy |
156 | Summary: Zabbix proxy | |
06317756 | 157 | Summary(pl.UTF-8): Proxy do Zabbiksa |
1b6bdd87 | 158 | Group: Networking/Utilities |
06317756 | 159 | Requires: %{name}-common = %{version}-%{release} |
7efbcfc2 | 160 | Requires: zabbix-proxy(db) = %{version}-%{release} |
0196d0f6 | 161 | Requires: systemd-units >= 38 |
1b6bdd87 | 162 | |
163 | %description proxy | |
06317756 | 164 | This package provides the Zabbix proxy. |
1b6bdd87 | 165 | |
166 | %description proxy -l pl.UTF-8 | |
06317756 | 167 | Ten pakiet zawiera proxy Zabbix. |
1b6bdd87 | 168 | |
7efbcfc2 JK |
169 | %package proxy-mysql |
170 | Summary: MySQL support for Zabbix proxy | |
171 | Summary(pl.UTF-8): Obsługa MySQL dla proxy do Zabbiksa | |
172 | Group: Networking/Utilities | |
173 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
174 | Obsoletes: %{name}-proxy-postgresql | |
175 | Obsoletes: %{name}-proxy-sqlite3 | |
176 | ||
177 | %description proxy-mysql | |
178 | This package provides the Zabbix proxy binary with MySQL support. | |
179 | ||
180 | %description proxy-mysql -l pl.UTF-8 | |
181 | Ten pakiet zawiera proxy Zabbix z obsługą MySQL. | |
182 | ||
183 | %package proxy-postgresql | |
184 | Summary: PostgreSQL support for Zabbix proxy | |
185 | Summary(pl.UTF-8): Obsługa PostgreSQL dla proxy do Zabbiksa | |
186 | Group: Networking/Utilities | |
187 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
188 | Obsoletes: %{name}-proxy-mysql | |
189 | Obsoletes: %{name}-proxy-sqlite3 | |
190 | ||
191 | %description proxy-postgresql | |
192 | This package provides the Zabbix proxy binary with PostgreSQL support. | |
193 | ||
194 | %description proxy-postgresql -l pl.UTF-8 | |
195 | Ten pakiet zawiera proxy Zabbix z obsługą PostgreSQL. | |
196 | ||
197 | %package proxy-sqlite3 | |
198 | Summary: SQLite 3 support for Zabbix proxy | |
199 | Summary(pl.UTF-8): Obsługa SQLite 3 dla proxy do Zabbiksa | |
200 | Group: Networking/Utilities | |
201 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
202 | Obsoletes: %{name}-proxy-mysql | |
203 | Obsoletes: %{name}-proxy-postgresql | |
204 | ||
205 | %description proxy-sqlite3 | |
206 | This package provides the Zabbix proxy binary with SQLite 3 support. | |
207 | ||
208 | %description proxy-sqlite3 -l pl.UTF-8 | |
209 | Ten pakiet zawiera proxy Zabbix z obsługą SQLite 3. | |
210 | ||
10a854a6 | 211 | %package sender |
7dcff817 | 212 | Summary: Zabbix sender |
06317756 | 213 | Summary(pl.UTF-8): Program zawiadamiający Zabbiksa |
d0e25550 | 214 | Group: Networking/Utilities |
10a854a6 TO |
215 | |
216 | %description sender | |
06317756 | 217 | This package provides the Zabbix sender. |
10a854a6 | 218 | |
ff14176a | 219 | %description sender -l pl.UTF-8 |
06317756 | 220 | Ten pakiet zawiera program zawiadamiający Zabbiksa. |
a5bb35f6 | 221 | |
a7e2963d | 222 | %package server |
7dcff817 | 223 | Summary: Zabbix server |
06317756 | 224 | Summary(pl.UTF-8): Serwer Zabbiksa |
d0e25550 | 225 | Group: Networking/Utilities |
06317756 | 226 | Requires: %{name}-common = %{version}-%{release} |
7efbcfc2 | 227 | Requires: %{name}-server(db) = %{version}-%{release} |
0196d0f6 ER |
228 | Requires: systemd-units >= 38 |
229 | Obsoletes: zabbix-suckerd | |
230 | Obsoletes: zabbix-trapper-inetd | |
231 | Obsoletes: zabbix-trapper-standalone | |
a7e2963d | 232 | |
233 | %description server | |
06317756 | 234 | This package provides the Zabbix server. |
a7e2963d | 235 | |
236 | %description server -l pl.UTF-8 | |
06317756 | 237 | Ten pakiet zawiera serwer Zabbiksa. |
a7e2963d | 238 | |
7efbcfc2 JK |
239 | %package server-mysql |
240 | Summary: MySQL support for Zabbix server | |
241 | Summary(pl.UTF-8): Obsługa MySQL sla serwera Zabbiksa | |
242 | Group: Networking/Utilities | |
243 | Provides: %{name}-server(db) = %{version}-%{release} | |
244 | Obsoletes: %{name}-server-postgresql | |
245 | Obsoletes: %{name}-server-sqlite3 | |
246 | ||
247 | %description server-mysql | |
248 | This package provides the Zabbix server binary for use with MySQL database. | |
249 | ||
250 | %description server-mysql -l pl.UTF-8 | |
251 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych MySQL. | |
252 | ||
253 | %package server-postgresql | |
254 | Summary: PostgreSQL support for Zabbix server | |
255 | Summary(pl.UTF-8): Obsługa PostgreSQL sla serwera Zabbiksa | |
256 | Group: Networking/Utilities | |
257 | Provides: %{name}-server(db) = %{version}-%{release} | |
258 | Obsoletes: %{name}-server-mysql | |
259 | Obsoletes: %{name}-server-sqlite3 | |
260 | ||
261 | %description server-postgresql | |
262 | This package provides the Zabbix server binary for use with PostgreSQL database. | |
263 | ||
264 | %description server-postgresql -l pl.UTF-8 | |
265 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych PostgreSQL. | |
266 | ||
267 | %package server-sqlite3 | |
268 | Summary: SQLite 3 support for Zabbix server | |
269 | Summary(pl.UTF-8): Obsługa SQLite 3 sla serwera Zabbiksa | |
270 | Group: Networking/Utilities | |
271 | Requires(post): /bin/zcat | |
272 | Provides: %{name}-server(db) = %{version}-%{release} | |
273 | Obsoletes: %{name}-server-mysql | |
274 | Obsoletes: %{name}-server-postgresql | |
275 | ||
276 | %description server-sqlite3 | |
277 | This package provides the Zabbix server binary for use with SQLite 3 database. | |
278 | ||
279 | %description server-sqlite3 -l pl.UTF-8 | |
280 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych SQLite 3. | |
281 | ||
cd323295 JK |
282 | %package java |
283 | Summary: Zabbix Java Gateway | |
284 | Group: Networking/Utilities | |
06317756 | 285 | Requires: %{name}-common = %{version}-%{release} |
0196d0f6 | 286 | Requires: systemd-units >= 38 |
cd323295 JK |
287 | |
288 | %description java | |
289 | This package provides the Zabbix Java Gateway. | |
290 | ||
10a854a6 | 291 | %prep |
5d18cc59 | 292 | %setup -q |
10a854a6 | 293 | |
06317756 | 294 | %patch0 -p1 |
7efbcfc2 | 295 | %patch1 -p1 |
f339e071 | 296 | %patch2 -p1 |
06317756 | 297 | |
10a854a6 | 298 | %build |
7efbcfc2 JK |
299 | |
300 | configure() { | |
301 | %configure \ | |
2fe2194b | 302 | --enable-agent \ |
cd323295 JK |
303 | --enable-ipv6 \ |
304 | %{__enable_disable java} \ | |
73af344b | 305 | --with-jabber \ |
cd323295 JK |
306 | --with-ldap \ |
307 | --with-libcurl \ | |
308 | --with-libxml2 \ | |
309 | --with-net-snmp \ | |
310 | --with-openipmi \ | |
311 | --with-openssl \ | |
312 | --with-ssh2 \ | |
7efbcfc2 JK |
313 | --with-unixodbc \ |
314 | "$@" | |
315 | } | |
316 | ||
317 | configure \ | |
318 | --disable-server \ | |
319 | --disable-proxy | |
10a854a6 TO |
320 | |
321 | %{__make} | |
322 | ||
7efbcfc2 JK |
323 | # keep timestamps to prevent unneccessary rebuilds |
324 | cp -a include/config.h include/config.h.old | |
325 | cp -a include/stamp-h1 include/stamp-h1.old | |
326 | ||
327 | for database in %{databases} ; do | |
328 | configure \ | |
329 | --with-$database \ | |
330 | --enable-server \ | |
331 | --enable-proxy | |
332 | ||
333 | # restore timestamps | |
334 | touch --reference=include/config.h.old include/config.h | |
335 | touch --reference=include/stamp-h1.old include/stamp-h1 | |
336 | ||
337 | # clean what needs rebuilding | |
338 | for dir in src/libs/zbxdb* src/libs/zbxserver ; do | |
339 | %{__make} -C $dir clean | |
340 | done | |
341 | ||
342 | touch include/zbxdb.h | |
343 | ||
344 | %{__make} | |
345 | ||
346 | %{__make} install \ | |
347 | -C src/zabbix_server \ | |
348 | DESTDIR=$PWD/install-${database} | |
349 | %{__make} install \ | |
350 | -C src/zabbix_proxy \ | |
351 | DESTDIR=$PWD/install-${database} | |
352 | ||
353 | # prepare dirs for %%doc | |
354 | for dir in upgrades/dbpatches/* ; do | |
355 | [ -d $dir/${database} ] || continue | |
356 | mkdir -p install-${database}/upgrade/$(basename $dir) | |
357 | cp -a $dir/${databases}/* install-${database}/upgrade/$(basename $dir) | |
358 | done | |
359 | done | |
360 | ||
10a854a6 TO |
361 | %install |
362 | rm -rf $RPM_BUILD_ROOT | |
06317756 | 363 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}} \ |
6594aa3f | 364 | $RPM_BUILD_ROOT{/run/zabbix,/var/log/zabbix,%{systemdunitdir},%{systemdtmpfilesdir}} |
10a854a6 | 365 | |
2fe2194b | 366 | %{__make} install \ |
cd323295 JK |
367 | DESTDIR=$RPM_BUILD_ROOT \ |
368 | ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java | |
10a854a6 | 369 | |
7efbcfc2 JK |
370 | for database in %{databases} ; do |
371 | cp -p install-$database/%{_sbindir}/zabbix_server \ | |
372 | $RPM_BUILD_ROOT%{_sbindir}/zabbix_server-$database | |
373 | cp -p install-$database/%{_sbindir}/zabbix_proxy \ | |
374 | $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy-$database | |
375 | done | |
376 | ||
377 | if [ -n "$database" ] ; then | |
378 | ln -sf %{_sbindir}/zabbix_server-$database $RPM_BUILD_ROOT%{_sbindir}/zabbix_server | |
379 | ln -sf %{_sbindir}/zabbix_proxy-$database $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy | |
380 | fi | |
381 | ||
382 | %if %{with sqlite3} | |
383 | install -d $RPM_BUILD_ROOT/var/lib/zabbix | |
384 | touch $RPM_BUILD_ROOT/var/lib/zabbix/zabbix.db | |
385 | %endif | |
386 | ||
7dcff817 | 387 | cp -r frontends $RPM_BUILD_ROOT%{_appdir} |
06317756 | 388 | |
0196d0f6 ER |
389 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
390 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
cd323295 | 391 | |
06317756 JK |
392 | install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_server.service |
393 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_agentd.service | |
394 | install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_proxy.service | |
395 | install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_java.service | |
396 | ||
6594aa3f | 397 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/zabbix.conf |
06317756 JK |
398 | |
399 | mv $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf $RPM_BUILD_ROOT%{_sysconfdir}/frontend | |
400 | ln -s %{_sysconfdir}/frontend $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf | |
401 | touch $RPM_BUILD_ROOT%{_sysconfdir}/frontend/zabbix.conf.php | |
402 | ||
cd323295 JK |
403 | %if %{with java} |
404 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf | |
405 | ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh | |
06317756 JK |
406 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback.xml |
407 | ln -s %{_sysconfdir}/java-logback.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml | |
408 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback-console.xml | |
409 | ln -s %{_sysconfdir}/java-logback-console.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml | |
cd323295 JK |
410 | |
411 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF' | |
412 | #!/bin/sh | |
413 | ||
414 | exec %{_datadir}/zabbix_java/startup.sh "$@" | |
415 | EOF | |
416 | ||
417 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF' | |
418 | #!/bin/sh | |
419 | ||
420 | exec %{_datadir}/zabbix_java/shutdown.sh "$@" | |
421 | EOF | |
422 | %endif | |
10a854a6 TO |
423 | |
424 | %clean | |
425 | rm -rf $RPM_BUILD_ROOT | |
426 | ||
7dcff817 TP |
427 | %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base |
428 | %webapp_register apache %{_webapp} | |
429 | ||
430 | %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base | |
431 | %webapp_unregister apache %{_webapp} | |
432 | ||
433 | %triggerin frontend-php -- apache < 2.2.0, apache-base | |
434 | %webapp_register httpd %{_webapp} | |
435 | ||
436 | %triggerun frontend-php -- apache < 2.2.0, apache-base | |
437 | %webapp_unregister httpd %{_webapp} | |
438 | ||
06317756 | 439 | %pre common |
78794d78 ER |
440 | %groupadd -g 111 zabbix |
441 | %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
10a854a6 | 442 | |
06317756 JK |
443 | %postun common |
444 | if [ "$1" = "0" ]; then | |
445 | %userremove zabbix | |
446 | %groupremove zabbix | |
447 | fi | |
448 | ||
7efbcfc2 | 449 | %post server-mysql |
96b8972f | 450 | if [ "$1" = 1 ]; then |
cd323295 | 451 | %banner -e %{name}-server <<-EOF |
c4962172 | 452 | You should create database for Zabbix. |
7efbcfc2 | 453 | |
cd323295 | 454 | Running these should be fine in most cases: |
c4962172 | 455 | mysqladmin create zabbix |
7efbcfc2 JK |
456 | zcat %{_docdir}/%{name}-server-mysql-%{version}/schema.sql.gz | mysql zabbix |
457 | zcat %{_docdir}/%{name}-server-mysql-%{version}/images.sql.gz | mysql zabbix | |
458 | zcat %{_docdir}/%{name}-server-mysql-%{version}/data.sql.gz | mysql zabbix | |
459 | EOF | |
460 | fi | |
461 | ln -sf %{_sbindir}/zabbix_server-mysql %{_sbindir}/zabbix_server || : | |
462 | ||
463 | %post server-postgresql | |
464 | if [ "$1" = 1 ]; then | |
465 | %banner -e %{name}-server <<-EOF | |
466 | You should create database for Zabbix. | |
467 | ||
468 | Running these should be fine in most cases: | |
469 | ||
470 | createuser zabbix | |
471 | createdb -O zabbix zabbix | |
472 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/schema.sql.gz | psql -u zabbix zabbix | |
473 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/images.sql.gz | psql -u zabbix zabbix | |
474 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/data.sql.gz | psql -u zabbix zabbix | |
475 | EOF | |
476 | fi | |
477 | ln -sf %{_sbindir}/zabbix_server-postgresql %{_sbindir}/zabbix_server || : | |
478 | ||
479 | %post server-sqlite3 | |
480 | if [ "$1" = 1 ]; then | |
481 | if [ ! -f /var/lib/zabbix/zabbix.db ] ; then | |
482 | %banner -e %{name}-server <<-EOF | |
483 | Creating sqlite3 database for Zabbix in /var/lib/zabbix/zabbix.db | |
c4962172 | 484 | EOF |
7efbcfc2 JK |
485 | zcat %{_docdir}/%{name}-server-sqlite3-%{version}/schema.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \ |
486 | zcat %{_docdir}/%{name}-server-sqlite3-%{version}/images.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \ | |
487 | zcat %{_docdir}/%{name}-server-sqlite3-%{version}/data.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \ | |
488 | chown zabbix:zabbix /var/lib/zabbix/zabbix.db && \ | |
489 | chmod 644 /var/lib/zabbix/zabbix.db || : | |
490 | fi | |
96b8972f | 491 | fi |
7efbcfc2 JK |
492 | ln -sf %{_sbindir}/zabbix_server-sqlite3 %{_sbindir}/zabbix_server || : |
493 | ||
494 | %post server | |
06317756 | 495 | %systemd_post zabbix_server.service |
c4962172 | 496 | |
06317756 JK |
497 | %preun server |
498 | %systemd_preun zabbix_server.service | |
499 | ||
500 | %postun server | |
7efbcfc2 JK |
501 | if [ "$1" = "0" ]; then |
502 | if [ -L %{_sbindir}/zabbix_server ] ; then | |
503 | rm -f %{_sbindir}/zabbix_server || : | |
504 | fi | |
505 | fi | |
06317756 JK |
506 | %systemd_reload |
507 | ||
508 | %post agentd | |
509 | %systemd_post zabbix_agentd.service | |
510 | ||
511 | %preun agentd | |
512 | %systemd_preun zabbix_agentd.service | |
513 | ||
514 | %postun agentd | |
515 | %systemd_reload | |
516 | ||
7efbcfc2 JK |
517 | %post proxy-mysql |
518 | ln -sf %{_sbindir}/zabbix_proxy-mysql %{_sbindir}/zabbix_proxy || : | |
519 | ||
520 | %post proxy-postgresql | |
521 | ln -sf %{_sbindir}/zabbix_proxy-postgresql %{_sbindir}/zabbix_proxy || : | |
522 | ||
523 | %post proxy-sqlite3 | |
524 | ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : | |
525 | ||
06317756 JK |
526 | %post proxy |
527 | %systemd_post zabbix_proxy.service | |
528 | ||
529 | %preun proxy | |
530 | %systemd_preun zabbix_proxy.service | |
531 | ||
532 | %postun proxy | |
533 | %systemd_reload | |
534 | ||
535 | %post java | |
536 | %systemd_post zabbix_java.service | |
537 | ||
538 | %preun java | |
539 | %systemd_preun zabbix_java.service | |
540 | ||
541 | %postun java | |
542 | %systemd_reload | |
10a854a6 | 543 | |
10a854a6 TO |
544 | %files |
545 | %defattr(644,root,root,755) | |
cd323295 | 546 | %doc AUTHORS ChangeLog README |
06317756 JK |
547 | |
548 | %files common | |
549 | %defattr(644,root,root,755) | |
550 | %doc AUTHORS ChangeLog README | |
551 | %attr(751,root,zabbix) %dir %{_sysconfdir} | |
552 | %attr(751,root,http) %dir %{_sysconfdir}/frontend | |
e4c376d6 | 553 | %dir %{_appdir} |
7dcff817 | 554 | %dir %{_appdir}/frontends |
06317756 JK |
555 | %dir %attr(770,root,zabbix) /run/zabbix |
556 | %dir %attr(775,root,zabbix) /var/log/zabbix | |
6594aa3f | 557 | %{systemdtmpfilesdir}/zabbix.conf |
10a854a6 | 558 | |
cd323295 | 559 | %files agentd |
10a854a6 | 560 | %defattr(644,root,root,755) |
3e3c35a0 | 561 | %doc conf/zabbix_agentd/*.conf |
7dcff817 | 562 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf |
3e3c35a0 | 563 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_agentd.conf.d |
b0f13a65 | 564 | %attr(755,root,root) %{_sbindir}/zabbix_agentd |
ed93a3d2 | 565 | %{_mandir}/man8/zabbix_agentd* |
06317756 | 566 | %{systemdunitdir}/zabbix_agentd.service |
10a854a6 | 567 | |
7dcff817 | 568 | %files frontend-php |
10a854a6 | 569 | %defattr(644,root,root,755) |
7dcff817 TP |
570 | %attr(750,root,http) %dir %{_webapps}/%{_webapp} |
571 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/* | |
572 | %{_appdir}/frontends/php | |
06317756 JK |
573 | %ghost %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php |
574 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/.htaccess | |
575 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/maintenance.inc.php | |
576 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php.example | |
10a854a6 | 577 | |
a7e2963d | 578 | %files get |
10a854a6 | 579 | %defattr(644,root,root,755) |
ed93a3d2 | 580 | %attr(755,root,root) %{_bindir}/zabbix_get |
581 | %{_mandir}/man1/zabbix_get* | |
10a854a6 | 582 | |
2a82feb1 | 583 | %if %{any_database} |
1b6bdd87 | 584 | %files proxy |
585 | %defattr(644,root,root,755) | |
cd323295 | 586 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf |
3e3c35a0 | 587 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_proxy.conf.d |
7efbcfc2 | 588 | %ghost %attr(755,root,root) %{_sbindir}/zabbix_proxy |
1b6bdd87 | 589 | %{_mandir}/man8/zabbix_proxy* |
06317756 | 590 | %{systemdunitdir}/zabbix_proxy.service |
2a82feb1 | 591 | %endif |
1b6bdd87 | 592 | |
7efbcfc2 JK |
593 | %if %{with mysql} |
594 | %files proxy-mysql | |
595 | %defattr(644,root,root,755) | |
596 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-mysql | |
597 | %endif | |
598 | ||
599 | %if %{with pgsql} | |
600 | %files proxy-postgresql | |
601 | %defattr(644,root,root,755) | |
602 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-postgresql | |
603 | %endif | |
604 | ||
605 | %if %{with sqlite3} | |
606 | %files proxy-sqlite3 | |
607 | %defattr(644,root,root,755) | |
608 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-sqlite3 | |
609 | %endif | |
610 | ||
7dcff817 TP |
611 | %files sender |
612 | %defattr(644,root,root,755) | |
ed93a3d2 | 613 | %attr(755,root,root) %{_bindir}/zabbix_sender |
614 | %{_mandir}/man1/zabbix_sender* | |
7dcff817 | 615 | |
2a82feb1 | 616 | %if %{any_database} |
a7e2963d | 617 | %files server |
10a854a6 | 618 | %defattr(644,root,root,755) |
cd323295 | 619 | %doc upgrades/dbpatches |
7efbcfc2 | 620 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf |
3e3c35a0 | 621 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_server.conf.d |
7efbcfc2 JK |
622 | %ghost %attr(755,root,root) %{_sbindir}/zabbix_server |
623 | %{_mandir}/man8/zabbix_server* | |
624 | %{systemdunitdir}/zabbix_server.service | |
2a82feb1 | 625 | %endif |
7efbcfc2 | 626 | |
cd323295 | 627 | %if %{with mysql} |
7efbcfc2 JK |
628 | %files server-mysql |
629 | %defattr(644,root,root,755) | |
630 | %doc database/mysql/*.sql install-mysql/upgrade | |
631 | %attr(755,root,root) %{_sbindir}/zabbix_server-mysql | |
cd323295 | 632 | %endif |
7efbcfc2 | 633 | |
06317756 | 634 | %if %{with pgsql} |
7efbcfc2 JK |
635 | %files server-postgresql |
636 | %defattr(644,root,root,755) | |
637 | %doc database/postgresql/*.sql install-postgresql/upgrade | |
638 | %attr(755,root,root) %{_sbindir}/zabbix_server-postgresql | |
cd323295 | 639 | %endif |
7efbcfc2 | 640 | |
cd323295 | 641 | %if %{with sqlite3} |
7efbcfc2 JK |
642 | %files server-sqlite3 |
643 | %defattr(644,root,root,755) | |
644 | %doc database/sqlite3/*.sql | |
645 | %attr(755,root,root) %{_sbindir}/zabbix_server-sqlite3 | |
646 | %dir %attr(771,root,zabbix) /var/lib/zabbix | |
647 | %ghost %attr(644,zabbix,zabbix) /var/lib/zabbix/zabbix.db | |
cd323295 | 648 | %endif |
cd323295 JK |
649 | |
650 | %if %{with java} | |
651 | %files java | |
652 | %defattr(644,root,root,755) | |
653 | %attr(755,root,root) %{_sbindir}/zabbix_java-start | |
654 | %attr(755,root,root) %{_sbindir}/zabbix_java-stop | |
655 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf | |
06317756 JK |
656 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback.xml |
657 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback-console.xml | |
cd323295 JK |
658 | %dir %{_datadir}/zabbix_java |
659 | %{_datadir}/zabbix_java/bin | |
660 | %{_datadir}/zabbix_java/lib | |
661 | %{_datadir}/zabbix_java/settings.sh | |
662 | %attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh | |
663 | %attr(755,root,root) %{_datadir}/zabbix_java/startup.sh | |
06317756 | 664 | %{systemdunitdir}/zabbix_java.service |
cd323295 | 665 | %endif |