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