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