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