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