--- SPECS/zabbix.spec 2024-06-03 05:57:55.000000000 +0000 +++ SPECS/zabbix.spec 2024-06-11 10:18:08.215116482 +0000 @@ -39,23 +39,26 @@ %{!?build_agent: %global build_agent 1} %ifarch x86_64 aarch64 -%if 0%{?rhel} >= 6 +%if 0%{?rhel} >= 6 || 0%{?amzn} %{!?build_agent2: %global build_agent2 1} %endif -%if 0%{?rhel} >= 8 +%if 0%{?rhel} >= 8 || 0%{?amzn} >= 2023 %{!?build_web_service: %global build_web_service 1} %endif %endif -%if 0%{?rhel} >= 8 +%if 0%{?rhel} >= 8 || 0%{?amzn} >= 2023 %{!?build_proxy: %global build_proxy 1} %endif %if 0%{?rhel} >= 7 %{!?build_java_gateway: %global build_java_gateway 1} %endif -%if 0%{?rhel} >= 8 +%if 0%{?rhel} >= 8 || 0%{?amzn} >= 2023 %{!?build_server: %global build_server 1} +%endif + +%if 0%{?rhel} >= 8 || 0%{?amzn} >= 2 %{!?build_frontend: %global build_frontend 1} %endif @@ -77,17 +80,17 @@ %endif # FIXME: Building debuginfo is broken on RHEL 5 & 8. Disabled for now. -%if 0%{?rhel} <= 5 || 0%{?rhel} >= 8 +%if 0%{?rhel} <= 5 || 0%{?rhel} >= 8 || 0%{?amzn} >= 2023 %define debug_package %{nil} %endif # Enable hardening -%if 0%{?rhel} >= 8 +%if 0%{?rhel} >= 8 || 0%{?amzn} >= 2023 %global _hardened_build 1 %endif BuildRequires: make -%if 0%{?rhel} >= 8 +%if 0%{?rhel} >= 8 || 0%{?amzn} >= 2023 BuildRequires: mariadb-connector-c-devel BuildRequires: postgresql-devel >= 12.0 BuildRequires: sqlite-devel @@ -96,20 +99,26 @@ BuildRequires: gnutls-devel BuildRequires: unixODBC-devel BuildRequires: curl-devel >= 7.13.1 -BuildRequires: OpenIPMI-devel >= 2 BuildRequires: libssh-devel >= 0.9.0 BuildRequires: java-devel >= 1.6.0 BuildRequires: libxml2-devel BuildRequires: libevent-devel %endif -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 8 +BuildRequires: OpenIPMI-devel >= 2 +%endif +%if 0%{?rhel} >= 7 || 0%{?amzn} >= 2023 BuildRequires: pcre2-devel %else BuildRequires: pcre-devel %endif -%if 0%{?rhel} >= 6 +%if 0%{?rhel} >= 6 || 0%{?amzn} >= 2023 +%if 0%{?amzn} <= 2 +BuildRequires: openssl11-devel +%else BuildRequires: openssl-devel >= 1.0.1 %endif +%endif %if 0%{?rhel} >= 7 BuildRequires: systemd %endif @@ -493,21 +502,23 @@ --with-net-snmp --with-ldap --with-libcurl +%if 0%{?amzn} == 0 --with-openipmi +%endif --with-unixodbc -%if 0%{?rhel} >= 8 +%if 0%{?rhel} >= 8 || 0%{?amzn} >= 2023 --with-ssh %else --with-ssh2 %endif --with-libxml2 --with-libevent -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} >= 2023 --with-libpcre2 %else --with-libpcre %endif -%if 0%{?rhel} >= 6 +%if 0%{?rhel} >= 6 || 0%{?amzn} --with-openssl %endif " @@ -657,7 +668,7 @@ cat %{SOURCE3} | sed \ -e 's|COMPONENT|agentd|g' \ > $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} 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 @@ -677,7 +688,7 @@ -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 +%if 0%{?rhel} >= 7 || 0%{?amzn} 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 @@ -813,7 +824,7 @@ %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/zabbix %{_sbindir}/zabbix_agentd %{_mandir}/man8/zabbix_agentd.8* -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} %{_unitdir}/zabbix-agent.service %{_tmpfilesdir}/zabbix-agent.conf %else @@ -841,7 +852,7 @@ : %post agent -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} %systemd_post zabbix-agent.service %else /sbin/chkconfig --add zabbix-agent || : @@ -849,7 +860,7 @@ %preun agent if [ "$1" = 0 ]; then -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} %systemd_preun zabbix-agent.service %else /sbin/service zabbix-agent stop >/dev/null 2>&1 @@ -859,7 +870,7 @@ : %postun agent -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} %systemd_postun_with_restart zabbix-agent.service %else if [ $1 -ge 1 ]; then @@ -897,7 +908,7 @@ %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/zabbix %{_sbindir}/zabbix_agent2 %{_mandir}/man8/zabbix_agent2.8* -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} %{_unitdir}/zabbix-agent2.service %{_tmpfilesdir}/zabbix_agent2.conf %else @@ -913,7 +924,7 @@ : %post agent2 -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} %systemd_post zabbix-agent2.service %endif # make sure that agent2 log file is create with proper attributes (ZBX-18243) @@ -923,7 +934,7 @@ fi : -%if 0%{?rhel} >= 7 +%if 0%{?rhel} >= 7 || 0%{?amzn} %preun agent2 %systemd_preun zabbix-agent2.service : @@ -1248,7 +1259,7 @@ %config(noreplace) %{_sysconfdir}/nginx/conf.d/zabbix.conf %post web -%if 0%{?rhel} >= 9 +%if 0%{?rhel} >= 9 || 0%{?amzn} >= 2023 if [ "$1" = 2 ] && update-alternatives --display zabbix-web-font | grep -q %{_datadir}/fonts/dejavu/DejaVuSans.ttf; then # remove borked web font alternative symlink /usr/sbin/update-alternatives --remove zabbix-web-font \ @@ -1298,7 +1309,7 @@ : %preun web -%if 0%{?rhel} >= 9 +%if 0%{?rhel} >= 9 || 0%{?amzn} >= 2023 if [ "$1" = 0 ]; then /usr/sbin/update-alternatives --remove zabbix-web-font \ %{_datadir}/fonts/dejavu-sans-fonts/DejaVuSans.ttf