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