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