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