From 3c6e9d693bda9f24e0aca11b7c602075ba93ed27 Mon Sep 17 00:00:00 2001 From: Daniel Sappa Date: Wed, 6 Mar 2024 18:07:20 +0000 Subject: [PATCH] * make a debug DEB package with striped debug symbols. --- debs/SPECS/wazuh-agent/debian/control | 7 +++++++ debs/SPECS/wazuh-agent/debian/rules | 2 +- debs/SPECS/wazuh-manager/debian/control | 7 +++++++ debs/SPECS/wazuh-manager/debian/rules | 2 +- debs/build.sh | 5 +++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/debs/SPECS/wazuh-agent/debian/control b/debs/SPECS/wazuh-agent/debian/control index c6c6cb0b1d..f706c0b4a3 100644 --- a/debs/SPECS/wazuh-agent/debian/control +++ b/debs/SPECS/wazuh-agent/debian/control @@ -12,3 +12,10 @@ Depends: ${shlibs:Depends}, libc6 (>= 2.7), lsb-release, debconf, adduser Conflicts: ossec-hids-agent, wazuh-manager, ossec-hids, wazuh-api Breaks: ossec-hids-agent, wazuh-manager, ossec-hids Description: Wazuh helps you to gain security visibility into your infrastructure by monitoring hosts at an operating system and application level. It provides the following capabilities: log analysis, file integrity monitoring, intrusions detection and policy and compliance monitoring + +Package: wazuh-agent-dbg +Section: debug +Priority: optional +Architecture: any +Depends: wazuh-agent +Description: Debug symbols for wazuh-agent, this package contains debug symbols for debugging wazuh-agent. diff --git a/debs/SPECS/wazuh-agent/debian/rules b/debs/SPECS/wazuh-agent/debian/rules index b79b4ce99f..8dee8cc8e8 100644 --- a/debs/SPECS/wazuh-agent/debian/rules +++ b/debs/SPECS/wazuh-agent/debian/rules @@ -156,6 +156,6 @@ override_dh_auto_clean: override_dh_strip: - dh_strip --no-automatic-dbgsym + dh_strip --dbg-package=wazuh-agent-dbg .PHONY: override_dh_install override_dh_strip override_dh_auto_clean override_dh_auto_build override_dh_auto_configure diff --git a/debs/SPECS/wazuh-manager/debian/control b/debs/SPECS/wazuh-manager/debian/control index bbdeb2a7c6..14789a2efb 100644 --- a/debs/SPECS/wazuh-manager/debian/control +++ b/debs/SPECS/wazuh-manager/debian/control @@ -13,3 +13,10 @@ Suggests: expect Conflicts: ossec-hids-agent, wazuh-agent, ossec-hids, wazuh-api Replaces: wazuh-api Description: Wazuh helps you to gain security visibility into your infrastructure by monitoring hosts at an operating system and application level. It provides the following capabilities: log analysis, file integrity monitoring, intrusions detection and policy and compliance monitoring + +Package: wazuh-manager-dbg +Section: debug +Priority: optional +Architecture: any +Depends: wazuh-manager +Description: Debug symbols for wazuh-manager, this package contains debug symbols for debugging wazuh-manager. diff --git a/debs/SPECS/wazuh-manager/debian/rules b/debs/SPECS/wazuh-manager/debian/rules index f07e01f938..7f302f1b33 100644 --- a/debs/SPECS/wazuh-manager/debian/rules +++ b/debs/SPECS/wazuh-manager/debian/rules @@ -240,6 +240,6 @@ override_dh_auto_clean: $(MAKE) -C src clean override_dh_strip: - dh_strip --no-automatic-dbgsym --exclude=dh_strip --no-automatic-dbgsym --exclude=${PKG_DIR}${INSTALLATION_DIR}/framework/python + dh_strip --dbg-package=wazuh-manager-dbg --exclude=dh_strip --exclude=${PKG_DIR}${INSTALLATION_DIR}/framework/python .PHONY: override_dh_install override_dh_strip override_dh_auto_clean override_dh_auto_build override_dh_auto_configure override_dh_fixperms diff --git a/debs/build.sh b/debs/build.sh index 7896c49081..fd085076a6 100755 --- a/debs/build.sh +++ b/debs/build.sh @@ -117,14 +117,19 @@ else fi deb_file="wazuh-${build_target}_${wazuh_version}-${package_release}" +symbols_deb_file="wazuh-${build_target}-dbg_${wazuh_version}-${package_release}" if [[ "${architecture_target}" == "ppc64le" ]]; then deb_file="${deb_file}_ppc64el.deb" + symbols_deb_file="${symbols_deb_file}_ppc64el.deb" else deb_file="${deb_file}_${architecture_target}.deb" + symbols_deb_file="${symbols_deb_file}_${architecture_target}.deb" fi pkg_path="${build_dir}/${build_target}" if [[ "${checksum}" == "yes" ]]; then cd ${pkg_path} && sha512sum ${deb_file} > /var/local/checksum/${deb_file}.sha512 + cd ${pkg_path} && sha512sum ${symbols_deb_file} > /var/local/checksum/${symbols_deb_file}.sha512 fi mv ${pkg_path}/${deb_file} /var/local/wazuh +mv ${pkg_path}/${symbols_deb_file} /var/local/wazuh