X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=zabbix.spec;h=27e64cc8cafc0ecce5adc8b803d65652da72200b;hb=refs%2Fheads%2Fmaster;hp=9d942f53cbcfa078b96d8df3700a6b979cbb6b22;hpb=5f17e289c4f690f81bd7f780a4750b3a9fec7b10;p=packages%2Fzabbix.git diff --git a/zabbix.spec b/zabbix.spec index 9d942f5..2f4fe8c 100644 --- a/zabbix.spec +++ b/zabbix.spec @@ -2,6 +2,7 @@ # - initscript for zabbix-server, zabbix-proxy and zabbix-java # # Conditional build: +%bcond_without agent2 # build Zabbix Agent 2 %bcond_without pgsql # enable PostgreSQL support %bcond_without sqlite3 # enable sqlite3 support %bcond_without mysql # enable MySQL support @@ -10,28 +11,43 @@ %define databases %{?with_sqlite3:sqlite3} %{?with_pgsql:postgresql} %{?with_mysql:mysql} %define any_database %{with pgsql}%{with mysql}%{with sqlite3} -%define php_min_version 5.4.0 +%define _noautoreq 'pear(.*\.php)' + +%define php_min_version 7.2.5 + +%ifnarch %{go_arches} +%undefine with_agent2 +%endif + +%{?with_java:%{?use_default_jdk}} + Summary: Zabbix - network monitoring software Summary(pl.UTF-8): Zabbix - oprogramowanie do monitorowania sieci Name: zabbix -Version: 5.0.7 -Release: 0.1 +Version: 6.0.29 +Release: 1 License: GPL v2+ Group: Networking/Utilities -Source0: https://cdn.zabbix.com/zabbix/sources/stable/5.0/%{name}-%{version}.tar.gz -# Source0-md5: e0798bb1b53ab7b451556dc34c3b1827 +Source0: https://cdn.zabbix.com/zabbix/sources/stable/6.0/%{name}-%{version}.tar.gz +# Source0-md5: 73314d5d61722baf9236a4755f07a100 Source1: %{name}-apache.conf Source2: %{name}_agentd.init +Source3: %{name}_server.init +Source4: %{name}_proxy.init +Source5: %{name}_agent2.init +Source6: %{name}_agent2.sysconfig Patch0: tld.patch Patch1: sqlite3_dbname.patch Patch2: always_compile_ipc.patch +Patch3: agent2.patch +Patch4: go.patch URL: https://www.zabbix.com/ BuildRequires: OpenIPMI-devel BuildRequires: autoconf BuildRequires: automake >= 1:1.15 BuildRequires: curl-devel -#BuildRequires: iksemel-devel -%{?with_java:BuildRequires: jdk} +%{?with_agent2:BuildRequires: golang >= 1.13} +%{?with_java:%buildrequires_jdk} BuildRequires: libevent-devel BuildRequires: libssh2-devel BuildRequires: libtool @@ -43,12 +59,18 @@ BuildRequires: openssl-devel >= 0.9.7d BuildRequires: pcre-devel %{?with_pgsql:BuildRequires: postgresql-devel} BuildRequires: rpmbuild(macros) >= 1.671 +%{?with_java:BuildRequires: rpm-tld-macros-javaprov} %{?with_sqlite3:BuildRequires: sqlite3-devel} BuildRequires: unixODBC-devel BuildRequires: zlib-devel -Requires: %{name}-agentd = %{version}-%{release} -Requires: %{name}-web = %{version}-%{release} -Requires: %{name}-server = %{version}-%{release} +Requires(postun): /usr/sbin/groupdel +Requires(postun): /usr/sbin/userdel +Requires(pre): /bin/id +Requires(pre): /usr/bin/getgid +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd +Provides: group(zabbix) +Provides: user(zabbix) BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _sysconfdir /etc/%{name} @@ -78,30 +100,11 @@ oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i statystyk Zabbixa jest możliwy poprzez interfejs oparty o WWW. -%package common -Summary: Common files for Zabbix monitoring software -Summary(pl.UTF-8): Wspólne pliki dla oprogramowania monitorującego Zabbix -Group: Networking/Utilities -Requires(postun): /usr/sbin/groupdel -Requires(postun): /usr/sbin/userdel -Requires(pre): /bin/id -Requires(pre): /usr/bin/getgid -Requires(pre): /usr/sbin/groupadd -Requires(pre): /usr/sbin/useradd -Provides: group(zabbix) -Provides: user(zabbix) - -%description common -Common files for Zabbix monitoring software. - -%description common -l pl.UTF-8 -Wspólne pliki dla oprogramowania monitorującego Zabbix. - %package agentd Summary: Zabbix Agent Summary(pl.UTF-8): Agenta Zabbixa Group: Networking/Utilities -Requires: %{name}-common = %{version}-%{release} +Requires: %{name} = %{version}-%{release} Obsoletes: zabbix-agent-inetd Obsoletes: zabbix-agent-standalone Requires(post,preun): /sbin/chkconfig @@ -113,6 +116,20 @@ Zabbix agent collects data from the local system for a Zabbix server. %description agentd -l pl.UTF-8 Agent zbiera dane z lokalnej maszyny dla serwera Zabbix. +%package agent2 +Summary: Zabbix Agent 2 +Summary(pl.UTF-8): Agent 2 Zabbixa +Group: Networking/Utilities +Requires: %{name} = %{version}-%{release} +Requires(post,preun): /sbin/chkconfig +Requires: rc-scripts + +%description agent2 +Zabbix agent collects data from the local system for a Zabbix server. + +%description agent2 -l pl.UTF-8 +Agent zbiera dane z lokalnej maszyny dla serwera Zabbix. + %package web Summary: Web frontend for Zabbix Summary(pl.UTF-8): Interfejs Web dla Zabbixa @@ -120,10 +137,12 @@ Group: Applications/WWW Requires: php(bcmath) Requires: php(core) >= %{php_min_version} Requires: php(ctype) +Requires: php(filter) Requires: php(gd) Requires: php(gettext) Requires: php(json) Requires: php(mbstring) +Requires: php(openssl) Requires: php(pcre) Requires: php(session) Requires: php(sockets) @@ -151,7 +170,7 @@ Ten pakiet dostarcza napisany w PHP frontend dla Zabbixa. Summary: Zabbix proxy Summary(pl.UTF-8): Proxy do Zabbixa Group: Networking/Utilities -Requires: %{name}-common = %{version}-%{release} +Requires: %{name} = %{version}-%{release} Requires: zabbix-proxy(db) = %{version}-%{release} %description proxy @@ -206,7 +225,7 @@ Ten pakiet zawiera proxy Zabbix z obsługą SQLite 3. Summary: Zabbix server Summary(pl.UTF-8): Serwer Zabbixa Group: Networking/Utilities -Requires: %{name}-common = %{version}-%{release} +Requires: %{name} = %{version}-%{release} Requires: %{name}-server(db) = %{version}-%{release} Obsoletes: zabbix-suckerd Obsoletes: zabbix-trapper-inetd @@ -251,7 +270,7 @@ Ten pakiet zawiera serwer Zabbixa z obsługą bazy danych PostgreSQL. %package java Summary: Zabbix Java Gateway Group: Networking/Utilities -Requires: %{name}-common = %{version}-%{release} +Requires: %{name} = %{version}-%{release} %description java This package provides the Zabbix Java Gateway. @@ -262,6 +281,8 @@ This package provides the Zabbix Java Gateway. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build %{__libtoolize} @@ -272,12 +293,16 @@ This package provides the Zabbix Java Gateway. configure() { %configure \ + %{?with_java:ac_cv_prog_JAVAC=%{java_home}/bin/javac} \ + %{?with_java:ac_cv_prog_JAR=%{java_home}/bin/jar} \ --enable-agent \ + %{__enable_disable agent2} \ --enable-ipv6 \ %{__enable_disable java} \ - --with-jabber \ --with-ldap \ --with-libcurl \ + --with-libevent \ + --with-libpcre2 \ --with-libxml2 \ --with-net-snmp \ --with-openipmi \ @@ -319,7 +344,7 @@ done %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/rc.d/init.d,/etc/webapps/%{_webapp},%{_appdir}} \ +install -d $RPM_BUILD_ROOT{%{_sysconfdir}/zabbix_agent2.conf.d,/etc/{rc.d/init.d,sysconfig},/etc/webapps/%{_webapp},%{_appdir}} \ $RPM_BUILD_ROOT{/var/run/zabbix,/var/log/zabbix} %{__make} install \ @@ -346,6 +371,10 @@ cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agentd +install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_server +install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_proxy +install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agent2 +install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/zabbix_agent2 mv $RPM_BUILD_ROOT%{_appdir}/ui/conf $RPM_BUILD_ROOT%{_sysconfdir}/web ln -s %{_sysconfdir}/web $RPM_BUILD_ROOT%{_appdir}/ui/conf @@ -381,12 +410,12 @@ rm -rf $RPM_BUILD_ROOT %triggerun web -- apache < 2.2.0, apache-base %webapp_unregister httpd %{_webapp} -%pre common +%pre %groupadd -g 111 zabbix %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix %addusertogroup -q zabbix proc -%postun common +%postun if [ "$1" = "0" ]; then %userremove zabbix %groupremove zabbix @@ -398,10 +427,11 @@ if [ "$1" = 1 ]; then You should create database for Zabbix. Running these should be fine in most cases: + mysqladmin create zabbix - zcat %{_docdir}/%{name}-server-mysql-%{version}/schema.sql.gz | mysql zabbix - zcat %{_docdir}/%{name}-server-mysql-%{version}/images.sql.gz | mysql zabbix - zcat %{_docdir}/%{name}-server-mysql-%{version}/data.sql.gz | mysql zabbix + cat %{_docdir}/%{name}-server-mysql-%{version}/schema.sql | mysql zabbix + cat %{_docdir}/%{name}-server-mysql-%{version}/images.sql | mysql zabbix + cat %{_docdir}/%{name}-server-mysql-%{version}/data.sql | mysql zabbix EOF fi ln -sf %{_sbindir}/zabbix_server-mysql %{_sbindir}/zabbix_server || : @@ -413,16 +443,24 @@ if [ "$1" = 1 ]; then Running these should be fine in most cases: - createuser zabbix - createdb -O zabbix zabbix - zcat %{_docdir}/%{name}-server-postgresql-%{version}/schema.sql.gz | psql -u zabbix zabbix - zcat %{_docdir}/%{name}-server-postgresql-%{version}/images.sql.gz | psql -u zabbix zabbix - zcat %{_docdir}/%{name}-server-postgresql-%{version}/data.sql.gz | psql -u zabbix zabbix + createuser -U postgres zabbix + createdb -U postgres -O zabbix zabbix + cat %{_docdir}/%{name}-server-postgresql-%{version}/schema.sql | psql -U zabbix zabbix + cat %{_docdir}/%{name}-server-postgresql-%{version}/images.sql | psql -U zabbix zabbix + cat %{_docdir}/%{name}-server-postgresql-%{version}/data.sql | psql -U zabbix zabbix EOF fi ln -sf %{_sbindir}/zabbix_server-postgresql %{_sbindir}/zabbix_server || : +%post server +/sbin/chkconfig --add zabbix_server +%service zabbix_server restart + %postun server +if [ "$1" = "0" ]; then + %service -q zabbix_server stop + /sbin/chkconfig --del zabbix_server +fi if [ "$1" = "0" ]; then if [ -L %{_sbindir}/zabbix_server ] ; then rm -f %{_sbindir}/zabbix_server || : @@ -439,6 +477,16 @@ if [ "$1" = "0" ]; then /sbin/chkconfig --del zabbix_agentd fi +%post agent2 +/sbin/chkconfig --add zabbix_agent2 +%service zabbix_agent2 restart + +%preun agent2 +if [ "$1" = "0" ]; then + %service -q zabbix_agent2 stop + /sbin/chkconfig --del zabbix_agent2 +fi + %post proxy-mysql ln -sf %{_sbindir}/zabbix_proxy-mysql %{_sbindir}/zabbix_proxy || : @@ -448,11 +496,22 @@ ln -sf %{_sbindir}/zabbix_proxy-postgresql %{_sbindir}/zabbix_proxy || : %post proxy-sqlite3 ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : -%files -%defattr(644,root,root,755) -%doc AUTHORS ChangeLog README +%post proxy +/sbin/chkconfig --add zabbix_server +%service zabbix_server restart -%files common +%postun proxy +if [ "$1" = "0" ]; then + %service -q zabbix_proxy stop + /sbin/chkconfig --del zabbix_proxy +fi +if [ "$1" = "0" ]; then + if [ -L %{_sbindir}/zabbix_proxy ] ; then + rm -f %{_sbindir}/zabbix_proxy || : + fi +fi + +%files %defattr(644,root,root,755) %doc AUTHORS ChangeLog README %attr(755,root,root) %{_bindir}/zabbix_get @@ -475,6 +534,28 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : %attr(755,root,root) %{_sbindir}/zabbix_agentd %{_mandir}/man8/zabbix_agentd* +%if %{with agent2} +%files agent2 +%defattr(644,root,root,755) +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.conf +%dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_agent2.d +%dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_agent2.d/plugins.d +%dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_agent2.conf.d +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/ceph.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/docker.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/memcached.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/modbus.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/mqtt.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/mysql.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/oracle.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/redis.conf +%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent2.d/plugins.d/smart.conf +%attr(754,root,root) /etc/rc.d/init.d/zabbix_agent2 +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/zabbix_agent2 +%attr(755,root,root) %{_sbindir}/zabbix_agent2 +%{_mandir}/man8/zabbix_agent2* +%endif + %files web %defattr(644,root,root,755) %attr(750,root,http) %dir %{_webapps}/%{_webapp} @@ -491,6 +572,7 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : %defattr(644,root,root,755) %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_proxy.conf.d +%attr(754,root,root) /etc/rc.d/init.d/zabbix_proxy %ghost %attr(755,root,root) %{_sbindir}/zabbix_proxy %{_mandir}/man8/zabbix_proxy* %endif @@ -519,6 +601,7 @@ ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : %defattr(644,root,root,755) %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf %dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_server.conf.d +%attr(754,root,root) /etc/rc.d/init.d/zabbix_server %ghost %attr(755,root,root) %{_sbindir}/zabbix_server %{_mandir}/man8/zabbix_server* %endif