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