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