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