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