140 lines
3.9 KiB
Diff
140 lines
3.9 KiB
Diff
--- zabbix.spec.orig 2022-12-09 19:48:39.002443430 +0100
|
|
+++ zabbix.spec 2022-12-10 00:24:50.399717359 +0100
|
|
@@ -77,6 +77,22 @@
|
|
%{!?build_selinux_policy: %global build_selinux_policy 1}
|
|
%endif
|
|
|
|
+# overwrites:
|
|
+%global build_frontend 1
|
|
+%global build_agent2 1
|
|
+%global build_agent 1
|
|
+%global build_web_service 1
|
|
+%global build_java_gateway 1
|
|
+%global build_with_mysql 1
|
|
+%global build_with_pgsql 1
|
|
+%global build_with_sqlite 1
|
|
+%global build_server 1
|
|
+%global build_proxy 1
|
|
+%global build_selinux_policy 1
|
|
+BuildRequires: mysql-connector-odbc postgresql-odbc unixODBC unixODBC-devel
|
|
+BuildRequires: libssh2-devel net-snmp-devel postgresql-server-devel gnutls-devel
|
|
+# end owerwrite
|
|
+
|
|
# FIXME: Building debuginfo is broken on RHEL 5 & 8. Disabled for now.
|
|
%if 0%{?rhel} <= 5 || 0%{?rhel} >= 8
|
|
%define debug_package %{nil}
|
|
@@ -90,7 +106,7 @@
|
|
BuildRequires: make
|
|
%if 0%{?rhel} >= 8
|
|
BuildRequires: mariadb-connector-c-devel
|
|
-BuildRequires: postgresql-devel >= 12.0
|
|
+BuildRequires: postgresql-server-devel >= 13.0
|
|
BuildRequires: sqlite-devel
|
|
BuildRequires: net-snmp-devel
|
|
BuildRequires: openldap-devel
|
|
@@ -499,21 +515,11 @@
|
|
--with-libcurl
|
|
--with-openipmi
|
|
--with-unixodbc
|
|
-%if 0%{?rhel} >= 8
|
|
+ --with-openssl
|
|
--with-ssh
|
|
-%else
|
|
- --with-ssh2
|
|
-%endif
|
|
--with-libxml2
|
|
--with-libevent
|
|
-%if 0%{?rhel} >= 7
|
|
--with-libpcre2
|
|
-%else
|
|
- --with-libpcre
|
|
-%endif
|
|
-%if 0%{?rhel} >= 6
|
|
- --with-openssl
|
|
-%endif
|
|
"
|
|
|
|
# setup pass 3
|
|
@@ -661,14 +667,9 @@
|
|
cat %{SOURCE3} | sed \
|
|
-e 's|COMPONENT|agentd|g' \
|
|
> $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent
|
|
-%if 0%{?rhel} >= 7
|
|
install -Dm 0644 -p %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}/zabbix-agent.service
|
|
install -Dm 0644 -p %{SOURCE15} $RPM_BUILD_ROOT%{_tmpfilesdir}/zabbix-agent.conf
|
|
%else
|
|
-install -Dm 0755 -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-agent
|
|
-install -Dm 0644 -p %{SOURCE20} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/zabbix-agent
|
|
-%endif
|
|
-%else
|
|
%if 0%{?build_agent2}
|
|
rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_agentd
|
|
rm $RPM_BUILD_ROOT%{_sysconfdir}/zabbix/zabbix_agentd.conf
|
|
@@ -681,13 +682,8 @@
|
|
-e 's|COMPONENT|agent2|g' \
|
|
> $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent2
|
|
cp man/zabbix_agent2.man $RPM_BUILD_ROOT%{_mandir}/man8/zabbix_agent2.8
|
|
-%if 0%{?rhel} >= 7
|
|
install -Dm 0644 -p %{SOURCE19} $RPM_BUILD_ROOT%{_unitdir}/zabbix-agent2.service
|
|
install -Dm 0644 -p %{SOURCE15} $RPM_BUILD_ROOT%{_tmpfilesdir}/zabbix_agent2.conf
|
|
-%else
|
|
-install -Dm 0755 -p %{SOURCE21} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-agent2
|
|
-install -Dm 0644 -p %{SOURCE22} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/zabbix-agent2
|
|
-%endif
|
|
%endif
|
|
|
|
|
|
@@ -819,13 +815,8 @@
|
|
%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/zabbix
|
|
%{_sbindir}/zabbix_agentd
|
|
%{_mandir}/man8/zabbix_agentd.8*
|
|
-%if 0%{?rhel} >= 7
|
|
%{_unitdir}/zabbix-agent.service
|
|
%{_tmpfilesdir}/zabbix-agent.conf
|
|
-%else
|
|
-%{_sysconfdir}/init.d/zabbix-agent
|
|
-%config(noreplace) %{_sysconfdir}/sysconfig/zabbix-agent
|
|
-%endif
|
|
|
|
%files get
|
|
%defattr(-,root,root,-)
|
|
@@ -903,13 +894,8 @@
|
|
%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/zabbix
|
|
%{_sbindir}/zabbix_agent2
|
|
%{_mandir}/man8/zabbix_agent2.8*
|
|
-%if 0%{?rhel} >= 7
|
|
%{_unitdir}/zabbix-agent2.service
|
|
%{_tmpfilesdir}/zabbix_agent2.conf
|
|
-%else
|
|
-%{_sysconfdir}/init.d/zabbix-agent2
|
|
-%config(noreplace) %{_sysconfdir}/sysconfig/zabbix-agent2
|
|
-%endif
|
|
|
|
%pre agent2
|
|
getent group zabbix > /dev/null || groupadd -r zabbix
|
|
@@ -919,9 +905,7 @@
|
|
:
|
|
|
|
%post agent2
|
|
-%if 0%{?rhel} >= 7
|
|
%systemd_post zabbix-agent2.service
|
|
-%endif
|
|
# make sure that agent2 log file is create with proper attributes (ZBX-18243)
|
|
if [ $1 == 1 ] && [ ! -f %{_localstatedir}/log/zabbix/zabbix_agent2.log ]; then
|
|
touch %{_localstatedir}/log/zabbix/zabbix_agent2.log
|
|
@@ -929,14 +913,10 @@
|
|
fi
|
|
:
|
|
|
|
-%if 0%{?rhel} >= 7
|
|
%preun agent2
|
|
%systemd_preun zabbix-agent2.service
|
|
:
|
|
|
|
-%postun agent2
|
|
-%systemd_postun_with_restart zabbix-agent2.service
|
|
-%endif
|
|
%endif
|
|
|
|
|