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