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