]>
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 |
7dcff817 | 131 | Requires: webserver(php) |
7efbcfc2 JK |
132 | Suggests: php(mysql) |
133 | Suggests: php(pgsql) | |
134 | Suggests: php(sqlite3) | |
7dcff817 TP |
135 | |
136 | %description frontend-php | |
06317756 | 137 | This package provides web based (PHP) frontend for Zabbix. |
7dcff817 TP |
138 | |
139 | %description frontend-php -l pl.UTF-8 | |
06317756 | 140 | Ten pakiet dostarcza napisany w PHP frontend dla Zabbiksa. |
7dcff817 TP |
141 | |
142 | %package get | |
06317756 JK |
143 | Summary: Program retrieving data from Zabbix agent |
144 | Summary(pl.UTF-8): Program odpytujÄcy agenta Zabbiksa | |
d0e25550 | 145 | Group: Networking/Utilities |
7dcff817 TP |
146 | |
147 | %description get | |
06317756 | 148 | This package provides a program retrieving data from Zabbix agent. |
7dcff817 TP |
149 | |
150 | %description get -l pl.UTF-8 | |
06317756 | 151 | Ten pakiet zawiera program odpytujÄcy agenta Zabbiksa. |
10a854a6 | 152 | |
1b6bdd87 | 153 | %package proxy |
154 | Summary: Zabbix proxy | |
06317756 | 155 | Summary(pl.UTF-8): Proxy do Zabbiksa |
1b6bdd87 | 156 | Group: Networking/Utilities |
06317756 | 157 | Requires: %{name}-common = %{version}-%{release} |
7efbcfc2 | 158 | Requires: zabbix-proxy(db) = %{version}-%{release} |
0196d0f6 | 159 | Requires: systemd-units >= 38 |
1b6bdd87 | 160 | |
161 | %description proxy | |
06317756 | 162 | This package provides the Zabbix proxy. |
1b6bdd87 | 163 | |
164 | %description proxy -l pl.UTF-8 | |
06317756 | 165 | Ten pakiet zawiera proxy Zabbix. |
1b6bdd87 | 166 | |
7efbcfc2 JK |
167 | %package proxy-mysql |
168 | Summary: MySQL support for Zabbix proxy | |
169 | Summary(pl.UTF-8): Obsługa MySQL dla proxy do Zabbiksa | |
170 | Group: Networking/Utilities | |
171 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
172 | Obsoletes: %{name}-proxy-postgresql | |
173 | Obsoletes: %{name}-proxy-sqlite3 | |
174 | ||
175 | %description proxy-mysql | |
176 | This package provides the Zabbix proxy binary with MySQL support. | |
177 | ||
178 | %description proxy-mysql -l pl.UTF-8 | |
179 | Ten pakiet zawiera proxy Zabbix z obsługą MySQL. | |
180 | ||
181 | %package proxy-postgresql | |
182 | Summary: PostgreSQL support for Zabbix proxy | |
183 | Summary(pl.UTF-8): Obsługa PostgreSQL dla proxy do Zabbiksa | |
184 | Group: Networking/Utilities | |
185 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
186 | Obsoletes: %{name}-proxy-mysql | |
187 | Obsoletes: %{name}-proxy-sqlite3 | |
188 | ||
189 | %description proxy-postgresql | |
190 | This package provides the Zabbix proxy binary with PostgreSQL support. | |
191 | ||
192 | %description proxy-postgresql -l pl.UTF-8 | |
193 | Ten pakiet zawiera proxy Zabbix z obsługą PostgreSQL. | |
194 | ||
195 | %package proxy-sqlite3 | |
196 | Summary: SQLite 3 support for Zabbix proxy | |
197 | Summary(pl.UTF-8): Obsługa SQLite 3 dla proxy do Zabbiksa | |
198 | Group: Networking/Utilities | |
199 | Provides: %{name}-proxy(db) = %{version}-%{release} | |
200 | Obsoletes: %{name}-proxy-mysql | |
201 | Obsoletes: %{name}-proxy-postgresql | |
202 | ||
203 | %description proxy-sqlite3 | |
204 | This package provides the Zabbix proxy binary with SQLite 3 support. | |
205 | ||
206 | %description proxy-sqlite3 -l pl.UTF-8 | |
207 | Ten pakiet zawiera proxy Zabbix z obsługą SQLite 3. | |
208 | ||
10a854a6 | 209 | %package sender |
7dcff817 | 210 | Summary: Zabbix sender |
06317756 | 211 | Summary(pl.UTF-8): Program zawiadamiający Zabbiksa |
d0e25550 | 212 | Group: Networking/Utilities |
10a854a6 TO |
213 | |
214 | %description sender | |
06317756 | 215 | This package provides the Zabbix sender. |
10a854a6 | 216 | |
ff14176a | 217 | %description sender -l pl.UTF-8 |
06317756 | 218 | Ten pakiet zawiera program zawiadamiający Zabbiksa. |
a5bb35f6 | 219 | |
a7e2963d | 220 | %package server |
7dcff817 | 221 | Summary: Zabbix server |
06317756 | 222 | Summary(pl.UTF-8): Serwer Zabbiksa |
d0e25550 | 223 | Group: Networking/Utilities |
06317756 | 224 | Requires: %{name}-common = %{version}-%{release} |
7efbcfc2 | 225 | Requires: %{name}-server(db) = %{version}-%{release} |
0196d0f6 ER |
226 | Requires: systemd-units >= 38 |
227 | Obsoletes: zabbix-suckerd | |
228 | Obsoletes: zabbix-trapper-inetd | |
229 | Obsoletes: zabbix-trapper-standalone | |
a7e2963d | 230 | |
231 | %description server | |
06317756 | 232 | This package provides the Zabbix server. |
a7e2963d | 233 | |
234 | %description server -l pl.UTF-8 | |
06317756 | 235 | Ten pakiet zawiera serwer Zabbiksa. |
a7e2963d | 236 | |
7efbcfc2 JK |
237 | %package server-mysql |
238 | Summary: MySQL support for Zabbix server | |
239 | Summary(pl.UTF-8): Obsługa MySQL sla serwera Zabbiksa | |
240 | Group: Networking/Utilities | |
241 | Provides: %{name}-server(db) = %{version}-%{release} | |
242 | Obsoletes: %{name}-server-postgresql | |
243 | Obsoletes: %{name}-server-sqlite3 | |
244 | ||
245 | %description server-mysql | |
246 | This package provides the Zabbix server binary for use with MySQL database. | |
247 | ||
248 | %description server-mysql -l pl.UTF-8 | |
249 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych MySQL. | |
250 | ||
251 | %package server-postgresql | |
252 | Summary: PostgreSQL support for Zabbix server | |
253 | Summary(pl.UTF-8): Obsługa PostgreSQL sla serwera Zabbiksa | |
254 | Group: Networking/Utilities | |
255 | Provides: %{name}-server(db) = %{version}-%{release} | |
256 | Obsoletes: %{name}-server-mysql | |
257 | Obsoletes: %{name}-server-sqlite3 | |
258 | ||
259 | %description server-postgresql | |
260 | This package provides the Zabbix server binary for use with PostgreSQL database. | |
261 | ||
262 | %description server-postgresql -l pl.UTF-8 | |
263 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych PostgreSQL. | |
264 | ||
265 | %package server-sqlite3 | |
266 | Summary: SQLite 3 support for Zabbix server | |
267 | Summary(pl.UTF-8): Obsługa SQLite 3 sla serwera Zabbiksa | |
268 | Group: Networking/Utilities | |
269 | Requires(post): /bin/zcat | |
270 | Provides: %{name}-server(db) = %{version}-%{release} | |
271 | Obsoletes: %{name}-server-mysql | |
272 | Obsoletes: %{name}-server-postgresql | |
273 | ||
274 | %description server-sqlite3 | |
275 | This package provides the Zabbix server binary for use with SQLite 3 database. | |
276 | ||
277 | %description server-sqlite3 -l pl.UTF-8 | |
278 | Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych SQLite 3. | |
279 | ||
cd323295 JK |
280 | %package java |
281 | Summary: Zabbix Java Gateway | |
282 | Group: Networking/Utilities | |
06317756 | 283 | Requires: %{name}-common = %{version}-%{release} |
0196d0f6 | 284 | Requires: systemd-units >= 38 |
cd323295 JK |
285 | |
286 | %description java | |
287 | This package provides the Zabbix Java Gateway. | |
288 | ||
10a854a6 | 289 | %prep |
5d18cc59 | 290 | %setup -q |
10a854a6 | 291 | |
06317756 | 292 | %patch0 -p1 |
7efbcfc2 | 293 | %patch1 -p1 |
f339e071 | 294 | %patch2 -p1 |
06317756 | 295 | |
10a854a6 | 296 | %build |
7efbcfc2 JK |
297 | |
298 | configure() { | |
299 | %configure \ | |
2fe2194b | 300 | --enable-agent \ |
cd323295 JK |
301 | --enable-ipv6 \ |
302 | %{__enable_disable java} \ | |
73af344b | 303 | --with-jabber \ |
cd323295 JK |
304 | --with-ldap \ |
305 | --with-libcurl \ | |
306 | --with-libxml2 \ | |
307 | --with-net-snmp \ | |
308 | --with-openipmi \ | |
309 | --with-openssl \ | |
310 | --with-ssh2 \ | |
7efbcfc2 JK |
311 | --with-unixodbc \ |
312 | "$@" | |
313 | } | |
314 | ||
315 | configure \ | |
316 | --disable-server \ | |
317 | --disable-proxy | |
10a854a6 TO |
318 | |
319 | %{__make} | |
320 | ||
7efbcfc2 JK |
321 | # keep timestamps to prevent unneccessary rebuilds |
322 | cp -a include/config.h include/config.h.old | |
323 | cp -a include/stamp-h1 include/stamp-h1.old | |
324 | ||
325 | for database in %{databases} ; do | |
326 | configure \ | |
327 | --with-$database \ | |
328 | --enable-server \ | |
329 | --enable-proxy | |
330 | ||
331 | # restore timestamps | |
332 | touch --reference=include/config.h.old include/config.h | |
333 | touch --reference=include/stamp-h1.old include/stamp-h1 | |
334 | ||
335 | # clean what needs rebuilding | |
336 | for dir in src/libs/zbxdb* src/libs/zbxserver ; do | |
337 | %{__make} -C $dir clean | |
338 | done | |
339 | ||
340 | touch include/zbxdb.h | |
341 | ||
342 | %{__make} | |
343 | ||
344 | %{__make} install \ | |
345 | -C src/zabbix_server \ | |
346 | DESTDIR=$PWD/install-${database} | |
347 | %{__make} install \ | |
348 | -C src/zabbix_proxy \ | |
349 | DESTDIR=$PWD/install-${database} | |
350 | ||
351 | # prepare dirs for %%doc | |
352 | for dir in upgrades/dbpatches/* ; do | |
353 | [ -d $dir/${database} ] || continue | |
354 | mkdir -p install-${database}/upgrade/$(basename $dir) | |
355 | cp -a $dir/${databases}/* install-${database}/upgrade/$(basename $dir) | |
356 | done | |
357 | done | |
358 | ||
10a854a6 TO |
359 | %install |
360 | rm -rf $RPM_BUILD_ROOT | |
06317756 | 361 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}} \ |
6594aa3f | 362 | $RPM_BUILD_ROOT{/run/zabbix,/var/log/zabbix,%{systemdunitdir},%{systemdtmpfilesdir}} |
10a854a6 | 363 | |
2fe2194b | 364 | %{__make} install \ |
cd323295 JK |
365 | DESTDIR=$RPM_BUILD_ROOT \ |
366 | ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java | |
10a854a6 | 367 | |
7efbcfc2 JK |
368 | for database in %{databases} ; do |
369 | cp -p install-$database/%{_sbindir}/zabbix_server \ | |
370 | $RPM_BUILD_ROOT%{_sbindir}/zabbix_server-$database | |
371 | cp -p install-$database/%{_sbindir}/zabbix_proxy \ | |
372 | $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy-$database | |
373 | done | |
374 | ||
375 | if [ -n "$database" ] ; then | |
376 | ln -sf %{_sbindir}/zabbix_server-$database $RPM_BUILD_ROOT%{_sbindir}/zabbix_server | |
377 | ln -sf %{_sbindir}/zabbix_proxy-$database $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy | |
378 | fi | |
379 | ||
380 | %if %{with sqlite3} | |
381 | install -d $RPM_BUILD_ROOT/var/lib/zabbix | |
382 | touch $RPM_BUILD_ROOT/var/lib/zabbix/zabbix.db | |
383 | %endif | |
384 | ||
7dcff817 | 385 | cp -r frontends $RPM_BUILD_ROOT%{_appdir} |
06317756 | 386 | |
0196d0f6 ER |
387 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
388 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
cd323295 | 389 | |
06317756 JK |
390 | install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_server.service |
391 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_agentd.service | |
392 | install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_proxy.service | |
393 | install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_java.service | |
394 | ||
6594aa3f | 395 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/zabbix.conf |
06317756 JK |
396 | |
397 | mv $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf $RPM_BUILD_ROOT%{_sysconfdir}/frontend | |
398 | ln -s %{_sysconfdir}/frontend $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf | |
399 | touch $RPM_BUILD_ROOT%{_sysconfdir}/frontend/zabbix.conf.php | |
400 | ||
cd323295 JK |
401 | %if %{with java} |
402 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf | |
403 | ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh | |
06317756 JK |
404 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback.xml |
405 | ln -s %{_sysconfdir}/java-logback.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml | |
406 | mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback-console.xml | |
407 | ln -s %{_sysconfdir}/java-logback-console.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml | |
cd323295 JK |
408 | |
409 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF' | |
410 | #!/bin/sh | |
411 | ||
412 | exec %{_datadir}/zabbix_java/startup.sh "$@" | |
413 | EOF | |
414 | ||
415 | cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF' | |
416 | #!/bin/sh | |
417 | ||
418 | exec %{_datadir}/zabbix_java/shutdown.sh "$@" | |
419 | EOF | |
420 | %endif | |
10a854a6 TO |
421 | |
422 | %clean | |
423 | rm -rf $RPM_BUILD_ROOT | |
424 | ||
7dcff817 TP |
425 | %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base |
426 | %webapp_register apache %{_webapp} | |
427 | ||
428 | %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base | |
429 | %webapp_unregister apache %{_webapp} | |
430 | ||
431 | %triggerin frontend-php -- apache < 2.2.0, apache-base | |
432 | %webapp_register httpd %{_webapp} | |
433 | ||
434 | %triggerun frontend-php -- apache < 2.2.0, apache-base | |
435 | %webapp_unregister httpd %{_webapp} | |
436 | ||
06317756 | 437 | %pre common |
78794d78 ER |
438 | %groupadd -g 111 zabbix |
439 | %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
10a854a6 | 440 | |
06317756 JK |
441 | %postun common |
442 | if [ "$1" = "0" ]; then | |
443 | %userremove zabbix | |
444 | %groupremove zabbix | |
445 | fi | |
446 | ||
7efbcfc2 | 447 | %post server-mysql |
96b8972f | 448 | if [ "$1" = 1 ]; then |
cd323295 | 449 | %banner -e %{name}-server <<-EOF |
c4962172 | 450 | You should create database for Zabbix. |
7efbcfc2 | 451 | |
cd323295 | 452 | Running these should be fine in most cases: |
c4962172 | 453 | mysqladmin create zabbix |
7efbcfc2 JK |
454 | zcat %{_docdir}/%{name}-server-mysql-%{version}/schema.sql.gz | mysql zabbix |
455 | zcat %{_docdir}/%{name}-server-mysql-%{version}/images.sql.gz | mysql zabbix | |
456 | zcat %{_docdir}/%{name}-server-mysql-%{version}/data.sql.gz | mysql zabbix | |
457 | EOF | |
458 | fi | |
459 | ln -sf %{_sbindir}/zabbix_server-mysql %{_sbindir}/zabbix_server || : | |
460 | ||
461 | %post server-postgresql | |
462 | if [ "$1" = 1 ]; then | |
463 | %banner -e %{name}-server <<-EOF | |
464 | You should create database for Zabbix. | |
465 | ||
466 | Running these should be fine in most cases: | |
467 | ||
468 | createuser zabbix | |
469 | createdb -O zabbix zabbix | |
470 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/schema.sql.gz | psql -u zabbix zabbix | |
471 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/images.sql.gz | psql -u zabbix zabbix | |
472 | zcat %{_docdir}/%{name}-server-postgresql-%{version}/data.sql.gz | psql -u zabbix zabbix | |
473 | EOF | |
474 | fi | |
475 | ln -sf %{_sbindir}/zabbix_server-postgresql %{_sbindir}/zabbix_server || : | |
476 | ||
477 | %post server-sqlite3 | |
478 | if [ "$1" = 1 ]; then | |
479 | if [ ! -f /var/lib/zabbix/zabbix.db ] ; then | |
480 | %banner -e %{name}-server <<-EOF | |
481 | Creating sqlite3 database for Zabbix in /var/lib/zabbix/zabbix.db | |
c4962172 | 482 | EOF |
7efbcfc2 JK |
483 | zcat %{_docdir}/%{name}-server-sqlite3-%{version}/schema.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \ |
484 | zcat %{_docdir}/%{name}-server-sqlite3-%{version}/images.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \ | |
485 | zcat %{_docdir}/%{name}-server-sqlite3-%{version}/data.sql.gz | sqlite3 /var/lib/zabbix/zabbix.db && \ | |
486 | chown zabbix:zabbix /var/lib/zabbix/zabbix.db && \ | |
487 | chmod 644 /var/lib/zabbix/zabbix.db || : | |
488 | fi | |
96b8972f | 489 | fi |
7efbcfc2 JK |
490 | ln -sf %{_sbindir}/zabbix_server-sqlite3 %{_sbindir}/zabbix_server || : |
491 | ||
492 | %post server | |
06317756 | 493 | %systemd_post zabbix_server.service |
c4962172 | 494 | |
06317756 JK |
495 | %preun server |
496 | %systemd_preun zabbix_server.service | |
497 | ||
498 | %postun server | |
7efbcfc2 JK |
499 | if [ "$1" = "0" ]; then |
500 | if [ -L %{_sbindir}/zabbix_server ] ; then | |
501 | rm -f %{_sbindir}/zabbix_server || : | |
502 | fi | |
503 | fi | |
06317756 JK |
504 | %systemd_reload |
505 | ||
506 | %post agentd | |
507 | %systemd_post zabbix_agentd.service | |
508 | ||
509 | %preun agentd | |
510 | %systemd_preun zabbix_agentd.service | |
511 | ||
512 | %postun agentd | |
513 | %systemd_reload | |
514 | ||
7efbcfc2 JK |
515 | %post proxy-mysql |
516 | ln -sf %{_sbindir}/zabbix_proxy-mysql %{_sbindir}/zabbix_proxy || : | |
517 | ||
518 | %post proxy-postgresql | |
519 | ln -sf %{_sbindir}/zabbix_proxy-postgresql %{_sbindir}/zabbix_proxy || : | |
520 | ||
521 | %post proxy-sqlite3 | |
522 | ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : | |
523 | ||
06317756 JK |
524 | %post proxy |
525 | %systemd_post zabbix_proxy.service | |
526 | ||
527 | %preun proxy | |
528 | %systemd_preun zabbix_proxy.service | |
529 | ||
530 | %postun proxy | |
531 | %systemd_reload | |
532 | ||
533 | %post java | |
534 | %systemd_post zabbix_java.service | |
535 | ||
536 | %preun java | |
537 | %systemd_preun zabbix_java.service | |
538 | ||
539 | %postun java | |
540 | %systemd_reload | |
10a854a6 | 541 | |
10a854a6 TO |
542 | %files |
543 | %defattr(644,root,root,755) | |
cd323295 | 544 | %doc AUTHORS ChangeLog README |
06317756 JK |
545 | |
546 | %files common | |
547 | %defattr(644,root,root,755) | |
548 | %doc AUTHORS ChangeLog README | |
549 | %attr(751,root,zabbix) %dir %{_sysconfdir} | |
550 | %attr(751,root,http) %dir %{_sysconfdir}/frontend | |
e4c376d6 | 551 | %dir %{_appdir} |
7dcff817 | 552 | %dir %{_appdir}/frontends |
06317756 JK |
553 | %dir %attr(770,root,zabbix) /run/zabbix |
554 | %dir %attr(775,root,zabbix) /var/log/zabbix | |
6594aa3f | 555 | %{systemdtmpfilesdir}/zabbix.conf |
10a854a6 | 556 | |
cd323295 | 557 | %files agentd |
10a854a6 | 558 | %defattr(644,root,root,755) |
3e3c35a0 | 559 | %doc conf/zabbix_agentd/*.conf |
7dcff817 | 560 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf |
3e3c35a0 | 561 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_agentd.conf.d |
b0f13a65 | 562 | %attr(755,root,root) %{_sbindir}/zabbix_agentd |
ed93a3d2 | 563 | %{_mandir}/man8/zabbix_agentd* |
06317756 | 564 | %{systemdunitdir}/zabbix_agentd.service |
10a854a6 | 565 | |
7dcff817 | 566 | %files frontend-php |
10a854a6 | 567 | %defattr(644,root,root,755) |
7dcff817 TP |
568 | %attr(750,root,http) %dir %{_webapps}/%{_webapp} |
569 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/* | |
570 | %{_appdir}/frontends/php | |
06317756 JK |
571 | %ghost %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php |
572 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/.htaccess | |
573 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/maintenance.inc.php | |
574 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php.example | |
10a854a6 | 575 | |
a7e2963d | 576 | %files get |
10a854a6 | 577 | %defattr(644,root,root,755) |
ed93a3d2 | 578 | %attr(755,root,root) %{_bindir}/zabbix_get |
579 | %{_mandir}/man1/zabbix_get* | |
10a854a6 | 580 | |
2a82feb1 | 581 | %if %{any_database} |
1b6bdd87 | 582 | %files proxy |
583 | %defattr(644,root,root,755) | |
cd323295 | 584 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf |
3e3c35a0 | 585 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_proxy.conf.d |
7efbcfc2 | 586 | %ghost %attr(755,root,root) %{_sbindir}/zabbix_proxy |
1b6bdd87 | 587 | %{_mandir}/man8/zabbix_proxy* |
06317756 | 588 | %{systemdunitdir}/zabbix_proxy.service |
2a82feb1 | 589 | %endif |
1b6bdd87 | 590 | |
7efbcfc2 JK |
591 | %if %{with mysql} |
592 | %files proxy-mysql | |
593 | %defattr(644,root,root,755) | |
594 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-mysql | |
595 | %endif | |
596 | ||
597 | %if %{with pgsql} | |
598 | %files proxy-postgresql | |
599 | %defattr(644,root,root,755) | |
600 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-postgresql | |
601 | %endif | |
602 | ||
603 | %if %{with sqlite3} | |
604 | %files proxy-sqlite3 | |
605 | %defattr(644,root,root,755) | |
606 | %attr(755,root,root) %{_sbindir}/zabbix_proxy-sqlite3 | |
607 | %endif | |
608 | ||
7dcff817 TP |
609 | %files sender |
610 | %defattr(644,root,root,755) | |
ed93a3d2 | 611 | %attr(755,root,root) %{_bindir}/zabbix_sender |
612 | %{_mandir}/man1/zabbix_sender* | |
7dcff817 | 613 | |
2a82feb1 | 614 | %if %{any_database} |
a7e2963d | 615 | %files server |
10a854a6 | 616 | %defattr(644,root,root,755) |
cd323295 | 617 | %doc upgrades/dbpatches |
7efbcfc2 | 618 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf |
3e3c35a0 | 619 | %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_server.conf.d |
7efbcfc2 JK |
620 | %ghost %attr(755,root,root) %{_sbindir}/zabbix_server |
621 | %{_mandir}/man8/zabbix_server* | |
622 | %{systemdunitdir}/zabbix_server.service | |
2a82feb1 | 623 | %endif |
7efbcfc2 | 624 | |
cd323295 | 625 | %if %{with mysql} |
7efbcfc2 JK |
626 | %files server-mysql |
627 | %defattr(644,root,root,755) | |
628 | %doc database/mysql/*.sql install-mysql/upgrade | |
629 | %attr(755,root,root) %{_sbindir}/zabbix_server-mysql | |
cd323295 | 630 | %endif |
7efbcfc2 | 631 | |
06317756 | 632 | %if %{with pgsql} |
7efbcfc2 JK |
633 | %files server-postgresql |
634 | %defattr(644,root,root,755) | |
635 | %doc database/postgresql/*.sql install-postgresql/upgrade | |
636 | %attr(755,root,root) %{_sbindir}/zabbix_server-postgresql | |
cd323295 | 637 | %endif |
7efbcfc2 | 638 | |
cd323295 | 639 | %if %{with sqlite3} |
7efbcfc2 JK |
640 | %files server-sqlite3 |
641 | %defattr(644,root,root,755) | |
642 | %doc database/sqlite3/*.sql | |
643 | %attr(755,root,root) %{_sbindir}/zabbix_server-sqlite3 | |
644 | %dir %attr(771,root,zabbix) /var/lib/zabbix | |
645 | %ghost %attr(644,zabbix,zabbix) /var/lib/zabbix/zabbix.db | |
cd323295 | 646 | %endif |
cd323295 JK |
647 | |
648 | %if %{with java} | |
649 | %files java | |
650 | %defattr(644,root,root,755) | |
651 | %attr(755,root,root) %{_sbindir}/zabbix_java-start | |
652 | %attr(755,root,root) %{_sbindir}/zabbix_java-stop | |
653 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf | |
06317756 JK |
654 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback.xml |
655 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback-console.xml | |
cd323295 JK |
656 | %dir %{_datadir}/zabbix_java |
657 | %{_datadir}/zabbix_java/bin | |
658 | %{_datadir}/zabbix_java/lib | |
659 | %{_datadir}/zabbix_java/settings.sh | |
660 | %attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh | |
661 | %attr(755,root,root) %{_datadir}/zabbix_java/startup.sh | |
06317756 | 662 | %{systemdunitdir}/zabbix_java.service |
cd323295 | 663 | %endif |