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