Skip to content

Commit

Permalink
* strip debug symbols in to DEBs packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrauncieal committed Mar 7, 2024
1 parent f7c6ad3 commit d0257a8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions debs/SPECS/wazuh-agent/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion debs/SPECS/wazuh-agent/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions debs/SPECS/wazuh-manager/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion debs/SPECS/wazuh-manager/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions debs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d0257a8

Please sign in to comment.