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