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