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