]> TLD Linux GIT Repositories - packages/zabbix.git/blobdiff - zabbix.spec
- updated to 6.0.29
[packages/zabbix.git] / zabbix.spec
index fcbbe4c9c1c821ea5f0ef3a13ac702a0aecf34bf..2f4fe8c36ccbd660faf41401cc5e4e4cc5a9c9e3 100644 (file)
@@ -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
 
 %define                _noautoreq 'pear(.*\.php)'
 
-%define                php_min_version 5.4.0
+%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:       6.0.19
+Version:       6.0.29
 Release:       1
 License:       GPL v2+
 Group:         Networking/Utilities
 Source0:       https://cdn.zabbix.com/zabbix/sources/stable/6.0/%{name}-%{version}.tar.gz
-# Source0-md5: a57192d6bb17f9ca80a75f87d5462987
+# 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: golang
-%{?with_java:BuildRequires:    jdk}
+%{?with_agent2:BuildRequires:  golang >= 1.13}
+%{?with_java:%buildrequires_jdk}
 BuildRequires: libevent-devel
 BuildRequires: libssh2-devel
 BuildRequires: libtool
@@ -48,6 +59,7 @@ 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
@@ -125,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)
@@ -267,6 +281,8 @@ This package provides the Zabbix Java Gateway.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 %{__libtoolize}
@@ -277,13 +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-agent2 \
+       %{__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 \
@@ -325,12 +344,11 @@ 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 \
        DESTDIR=$RPM_BUILD_ROOT \
-       GOBIN=$RPM_BUILD_ROOT%{_sbindir} \
        ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java
 
 for database in %{databases} ; do
@@ -356,6 +374,7 @@ 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
@@ -410,9 +429,9 @@ if [ "$1" = 1 ]; then
        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 || :
@@ -426,9 +445,9 @@ if [ "$1" = 1 ]; then
 
        createuser -U postgres zabbix
        createdb -U postgres -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
+       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 || :
@@ -515,11 +534,13 @@ fi
 %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
@@ -530,8 +551,10 @@ fi
 %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)