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