]> git.pld-linux.org Git - packages/zabbix.git/blame - zabbix.spec
Re-enable agent2, builds on builders
[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
710f2b0f 18%define php_min_version 7.2.5
06317756
JK
19Summary: Zabbix - network monitoring software
20Summary(pl.UTF-8): Zabbix - oprogramowanie do monitorowania sieci
10a854a6 21Name: zabbix
98ab823a 22Version: 5.4.3
e56a6d2d 23Release: 0.6
10a854a6 24License: GPL v2+
d0e25550 25Group: Networking/Utilities
98ab823a
ER
26# https://www.zabbix.com/download_sources
27Source0: https://cdn.zabbix.com/zabbix/sources/stable/5.4/%{name}-%{version}.tar.gz
28# Source0-md5: 5dccb536c164e45c7d5c1a5a9d64be43
cd323295 29Source1: %{name}-apache.conf
0196d0f6
ER
30Source2: %{name}_server.service
31Source3: %{name}_agentd.service
32Source4: %{name}_proxy.service
33Source5: %{name}_java.service
34Source6: %{name}.tmpfiles
d93a02f8 35Source7: %{name}_agentd.init
e56a6d2d
ER
36%if 0
37cd src/go/
38go mod vendor
39tar -caf ~/go-vendor.tar.xz -C ../../ src/go/vendor
40%endif
41Source8: go-vendor.tar.xz
42# Source8-md5: 61f2ee9647280765b622a5e1e8cdfbba
06317756 43Patch0: config.patch
7efbcfc2 44Patch1: sqlite3_dbname.patch
c4cfaa95 45Patch2: always_compile_ipc.patch
219bbb7e 46Patch3: go-destdir.patch
e56a6d2d 47Patch4: go-vendor.patch
98ab823a 48URL: https://www.zabbix.com/
d93a02f8 49BuildRequires: OpenIPMI-devel
e27bce28
JK
50BuildRequires: autoconf
51BuildRequires: automake >= 1:1.15
73af344b 52BuildRequires: curl-devel
53BuildRequires: 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 57BuildRequires: libevent-devel
cd323295 58BuildRequires: libssh2-devel
d93a02f8 59BuildRequires: libtool
0196d0f6 60BuildRequires: libxml2-devel
cd323295 61%{?with_mysql:BuildRequires: mysql-devel}
39709426 62BuildRequires: net-snmp-devel
246efd79 63BuildRequires: openldap-devel >= 2.4.6
2886d983 64BuildRequires: openssl-devel >= 0.9.7d
4ffaba52 65BuildRequires: pcre-devel
9ffbc0d2 66%{?with_pgsql:BuildRequires: postgresql-devel}
0196d0f6 67BuildRequires: rpmbuild(macros) >= 1.671
cd323295
JK
68%{?with_sqlite3:BuildRequires: sqlite3-devel}
69BuildRequires: unixODBC-devel
9e6cf723 70BuildRequires: zlib-devel
0196d0f6
ER
71Requires: %{name}-agentd = %{version}-%{release}
72Requires: %{name}-frontend-php = %{version}-%{release}
73Requires: %{name}-server = %{version}-%{release}
10a854a6
TO
74BuildRoot: %{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 82Zabbix is software that monitors numerous parameters of a network and
0196d0f6
ER
83the servers on that network. It is a useful tool for monitoring the
84health and integrity of servers. Zabbix uses a flexible notification
85mechanism that allows users to configure email based alerts for
86virtually any event. All monitored parameters are stored in a
87database. Zabbix offers excellent reporting and data visualisation
06317756
JK
88features based on the stored data. Zabbix supports both polling and
89trapping. All Zabbix reports and statistics, as well as configuration
7f4b6a83 90parameters, are accessed through a web-based front end.
91
ff14176a 92%description -l pl.UTF-8
06317756 93Zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
1266ba50
TP
94serwerów sieciowych. Jest przydatny przy monitorowaniu działania
95serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który
96pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną
97dla praktycznie wszelkich zdarzeń. Monitorowane parametry są
06317756 98przechowywane w bazie danych. W oparciu o przechowywane dane Zabbix
1266ba50
TP
99oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno
100odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i
06317756
JK
101statystyk Zabbiksa jest możliwy poprzez interfejs oparty o WWW.
102
103%package common
104Summary: Common files for Zabbix monitoring software
105Summary(pl.UTF-8): Wspólne pliki dla oprogramowania monitorującego Zabbix
106Group: Networking/Utilities
107Requires(postun): /usr/sbin/groupdel
108Requires(postun): /usr/sbin/userdel
109Requires(pre): /bin/id
110Requires(pre): /usr/bin/getgid
111Requires(pre): /usr/sbin/groupadd
112Requires(pre): /usr/sbin/useradd
113Provides: group(zabbix)
114Provides: user(zabbix)
115
116%description common
117Common files for Zabbix monitoring software.
118
119%description common -l pl.UTF-8
120Wspólne pliki dla oprogramowania monitorującego Zabbix.
10a854a6 121
cd323295 122%package agentd
06317756
JK
123Summary: Zabbix Agent
124Summary(pl.UTF-8): Agenta Zabbiksa
d0e25550 125Group: Networking/Utilities
06317756 126Requires: %{name}-common = %{version}-%{release}
0196d0f6 127Requires: systemd-units >= 38
96b8972f 128Obsoletes: zabbix-agent-inetd
cd323295 129Obsoletes: zabbix-agent-standalone
d93a02f8
ER
130Requires(post,preun): /sbin/chkconfig
131Requires: rc-scripts
10a854a6 132
cd323295 133%description agentd
06317756 134Zabbix agent collects data from the local system for a Zabbix server.
90e6d4b1 135
cd323295 136%description agentd -l pl.UTF-8
06317756 137Agent zbiera dane z lokalnej maszyny dla serwera Zabbix.
7dcff817 138
b711b6e8
ER
139%package agent2
140Summary: Zabbix Agent 2
141Group: Networking/Utilities
142URL: https://www.zabbix.com/documentation/current/manual/concepts/agent2
143Requires: %{name}-common = %{version}-%{release}
144
145%description agent2
146Zabbix agent 2 is a new generation of Zabbix agent and may be used in
147place of Zabbix agent.
148
149Zabbix 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
154A 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
161Passive checks work similarly to Zabbix agent. Active checks support
162scheduled/flexible intervals and check concurrency within one active
163server.
164
7dcff817 165%package frontend-php
06317756
JK
166Summary: PHP frontend for Zabbix
167Summary(pl.UTF-8): Interfejs PHP dla Zabbiksa
d0e25550 168Group: Applications/WWW
cd323295 169Requires: php(bcmath)
1d07384b 170Requires: php(core) >= %{php_min_version}
cd323295 171Requires: php(ctype)
1d07384b
JK
172Requires: php(gd)
173Requires: php(gettext)
8cc30dbd 174Requires: php(json)
cd323295
JK
175Requires: php(mbstring)
176Requires: php(pcre)
cd323295 177Requires: php(session)
1d07384b
JK
178Requires: php(sockets)
179Requires: php(xml)
180Requires: php(xmlreader)
181Requires: php(xmlwriter)
7dcff817 182Requires: webapps
cb5654b1 183Requires: webserver(alias)
66fbc8af 184Requires: webserver(indexfile)
7dcff817 185Requires: webserver(php)
7efbcfc2
JK
186Suggests: php(mysql)
187Suggests: php(pgsql)
188Suggests: php(sqlite3)
b8568b0f
AM
189# used with sqlite3
190Suggests: php(sysvsem)
ae9a7f61 191BuildArch: noarch
7dcff817
TP
192
193%description frontend-php
06317756 194This package provides web based (PHP) frontend for Zabbix.
7dcff817
TP
195
196%description frontend-php -l pl.UTF-8
06317756 197Ten pakiet dostarcza napisany w PHP frontend dla Zabbiksa.
7dcff817
TP
198
199%package get
06317756
JK
200Summary: Program retrieving data from Zabbix agent
201Summary(pl.UTF-8): Program odpytujÄcy agenta Zabbiksa
d0e25550 202Group: Networking/Utilities
7dcff817
TP
203
204%description get
06317756 205This package provides a program retrieving data from Zabbix agent.
7dcff817
TP
206
207%description get -l pl.UTF-8
06317756 208Ten pakiet zawiera program odpytujÄcy agenta Zabbiksa.
10a854a6 209
1b6bdd87 210%package proxy
211Summary: Zabbix proxy
06317756 212Summary(pl.UTF-8): Proxy do Zabbiksa
1b6bdd87 213Group: Networking/Utilities
06317756 214Requires: %{name}-common = %{version}-%{release}
0196d0f6 215Requires: systemd-units >= 38
9a6ace5d 216Requires: zabbix-proxy(db) = %{version}-%{release}
1b6bdd87 217
218%description proxy
06317756 219This package provides the Zabbix proxy.
1b6bdd87 220
221%description proxy -l pl.UTF-8
06317756 222Ten pakiet zawiera proxy Zabbix.
1b6bdd87 223
7efbcfc2
JK
224%package proxy-mysql
225Summary: MySQL support for Zabbix proxy
226Summary(pl.UTF-8): Obsługa MySQL dla proxy do Zabbiksa
227Group: Networking/Utilities
228Provides: %{name}-proxy(db) = %{version}-%{release}
9a6ace5d
ER
229Obsoletes: zabbix-proxy-postgresql
230Obsoletes: zabbix-proxy-sqlite3
7efbcfc2
JK
231
232%description proxy-mysql
233This package provides the Zabbix proxy binary with MySQL support.
234
235%description proxy-mysql -l pl.UTF-8
236Ten pakiet zawiera proxy Zabbix z obsługą MySQL.
237
238%package proxy-postgresql
239Summary: PostgreSQL support for Zabbix proxy
240Summary(pl.UTF-8): Obsługa PostgreSQL dla proxy do Zabbiksa
241Group: Networking/Utilities
242Provides: %{name}-proxy(db) = %{version}-%{release}
9a6ace5d
ER
243Obsoletes: zabbix-proxy-mysql
244Obsoletes: zabbix-proxy-sqlite3
7efbcfc2
JK
245
246%description proxy-postgresql
247This package provides the Zabbix proxy binary with PostgreSQL support.
248
249%description proxy-postgresql -l pl.UTF-8
250Ten pakiet zawiera proxy Zabbix z obsługą PostgreSQL.
251
252%package proxy-sqlite3
253Summary: SQLite 3 support for Zabbix proxy
254Summary(pl.UTF-8): Obsługa SQLite 3 dla proxy do Zabbiksa
255Group: Networking/Utilities
256Provides: %{name}-proxy(db) = %{version}-%{release}
9a6ace5d
ER
257Obsoletes: zabbix-proxy-mysql
258Obsoletes: zabbix-proxy-postgresql
7efbcfc2
JK
259
260%description proxy-sqlite3
261This package provides the Zabbix proxy binary with SQLite 3 support.
262
263%description proxy-sqlite3 -l pl.UTF-8
264Ten pakiet zawiera proxy Zabbix z obsługą SQLite 3.
265
10a854a6 266%package sender
7dcff817 267Summary: Zabbix sender
06317756 268Summary(pl.UTF-8): Program zawiadamiający Zabbiksa
d0e25550 269Group: Networking/Utilities
10a854a6
TO
270
271%description sender
06317756 272This package provides the Zabbix sender.
10a854a6 273
ff14176a 274%description sender -l pl.UTF-8
06317756 275Ten pakiet zawiera program zawiadamiający Zabbiksa.
a5bb35f6 276
a7e2963d 277%package server
7dcff817 278Summary: Zabbix server
06317756 279Summary(pl.UTF-8): Serwer Zabbiksa
d0e25550 280Group: Networking/Utilities
06317756 281Requires: %{name}-common = %{version}-%{release}
7efbcfc2 282Requires: %{name}-server(db) = %{version}-%{release}
0196d0f6
ER
283Requires: systemd-units >= 38
284Obsoletes: zabbix-suckerd
285Obsoletes: zabbix-trapper-inetd
286Obsoletes: zabbix-trapper-standalone
a7e2963d 287
288%description server
06317756 289This package provides the Zabbix server.
a7e2963d 290
291%description server -l pl.UTF-8
06317756 292Ten pakiet zawiera serwer Zabbiksa.
a7e2963d 293
7efbcfc2
JK
294%package server-mysql
295Summary: MySQL support for Zabbix server
296Summary(pl.UTF-8): Obsługa MySQL sla serwera Zabbiksa
297Group: Networking/Utilities
298Provides: %{name}-server(db) = %{version}-%{release}
9a6ace5d
ER
299Obsoletes: zabbix-server-postgresql
300Obsoletes: zabbix-server-sqlite3
7efbcfc2
JK
301
302%description server-mysql
9a6ace5d
ER
303This package provides the Zabbix server binary for use with MySQL
304database.
7efbcfc2
JK
305
306%description server-mysql -l pl.UTF-8
307Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych MySQL.
308
309%package server-postgresql
310Summary: PostgreSQL support for Zabbix server
311Summary(pl.UTF-8): Obsługa PostgreSQL sla serwera Zabbiksa
312Group: Networking/Utilities
313Provides: %{name}-server(db) = %{version}-%{release}
9a6ace5d
ER
314Obsoletes: zabbix-server-mysql
315Obsoletes: zabbix-server-sqlite3
7efbcfc2
JK
316
317%description server-postgresql
9a6ace5d
ER
318This package provides the Zabbix server binary for use with PostgreSQL
319database.
7efbcfc2
JK
320
321%description server-postgresql -l pl.UTF-8
322Ten pakiet zawiera serwer Zabbiksa z obsługą bazy danych PostgreSQL.
323
cd323295
JK
324%package java
325Summary: Zabbix Java Gateway
326Group: Networking/Utilities
06317756 327Requires: %{name}-common = %{version}-%{release}
0196d0f6 328Requires: systemd-units >= 38
cd323295
JK
329
330%description java
331This 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
348configure() {
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
368configure \
369 --disable-server \
9a6ace5d 370 --disable-proxy
10a854a6
TO
371
372%{__make}
373
7efbcfc2 374for 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
396done
397
10a854a6
TO
398%install
399rm -rf $RPM_BUILD_ROOT
710f2b0f 400install -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 407for 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
414done
415
416if [ -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
419fi
420
421%if %{with sqlite3}
422install -d $RPM_BUILD_ROOT/var/lib/zabbix
423touch $RPM_BUILD_ROOT/var/lib/zabbix/zabbix.db
424%endif
425
710f2b0f 426cp -r ui/* $RPM_BUILD_ROOT%{_appdir}/frontends/php
06317756 427
0196d0f6
ER
428cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
429cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
cd323295 430
06317756
JK
431install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_server.service
432install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_agentd.service
d93a02f8 433install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agentd
06317756
JK
434install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_proxy.service
435install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_java.service
436
6594aa3f 437cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/zabbix.conf
06317756
JK
438
439mv $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf $RPM_BUILD_ROOT%{_sysconfdir}/frontend
c89ae9ca 440ln -s --relative $RPM_BUILD_ROOT{%{_sysconfdir}/frontend,%{_appdir}/frontends/php/conf}
06317756
JK
441touch $RPM_BUILD_ROOT%{_sysconfdir}/frontend/zabbix.conf.php
442
cd323295
JK
443%if %{with java}
444mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf
c89ae9ca 445ln -s --relative $RPM_BUILD_ROOT{%{_sysconfdir}/zabbix_java.conf,%{_datadir}/zabbix_java/settings.sh}
06317756 446mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback.xml
c89ae9ca 447ln -s --relative $RPM_BUILD_ROOT{%{_sysconfdir}/java-logback.xml,%{_datadir}/zabbix_java/lib/logback.xml}
06317756 448mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback-console.xml
c89ae9ca 449ln -s --relative $RPM_BUILD_ROOT{%{_sysconfdir}/java-logback-console.xml,%{_datadir}/zabbix_java/lib/logback-console.xml}
cd323295
JK
450
451cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF'
452#!/bin/sh
453
454exec %{_datadir}/zabbix_java/startup.sh "$@"
455EOF
456
457cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF'
458#!/bin/sh
459
460exec %{_datadir}/zabbix_java/shutdown.sh "$@"
461EOF
462%endif
10a854a6
TO
463
464%clean
465rm -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
485if [ "$1" = "0" ]; then
486 %userremove zabbix
487 %groupremove zabbix
488fi
489
7efbcfc2 490%post server-mysql
96b8972f 491if [ "$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
500EOF
501fi
c89ae9ca 502ln -sf zabbix_server-mysql %{_sbindir}/zabbix_server || :
7efbcfc2
JK
503
504%post server-postgresql
505if [ "$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
516EOF
517fi
c89ae9ca 518ln -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
527if [ "$1" = "0" ]; then
528 if [ -L %{_sbindir}/zabbix_server ] ; then
529 rm -f %{_sbindir}/zabbix_server || :
530 fi
531fi
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
540if [ "$1" = "0" ]; then
541 %service -q zabbix_agentd stop
542 /sbin/chkconfig --del zabbix_agentd
543fi
06317756
JK
544%systemd_preun zabbix_agentd.service
545
546%postun agentd
547%systemd_reload
548
7efbcfc2 549%post proxy-mysql
c89ae9ca 550ln -sf zabbix_proxy-mysql %{_sbindir}/zabbix_proxy || :
7efbcfc2
JK
551
552%post proxy-postgresql
c89ae9ca 553ln -sf zabbix_proxy-postgresql %{_sbindir}/zabbix_proxy || :
7efbcfc2
JK
554
555%post proxy-sqlite3
c89ae9ca 556ln -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
This page took 0.158952 seconds and 4 git commands to generate.