From 98dffe0c2335be961bca9ce595865a710f42173a Mon Sep 17 00:00:00 2001 From: Leonardo Quiceno Date: Wed, 13 Mar 2024 12:53:23 -0500 Subject: [PATCH] Rename the file with debuginfo --- rpms/SPECS/wazuh-agent.spec | 19 +++++++++---------- rpms/SPECS/wazuh-manager.spec | 17 +++++++++-------- rpms/build.sh | 4 ++-- rpms/generate_rpm_package.sh | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rpms/SPECS/wazuh-agent.spec b/rpms/SPECS/wazuh-agent.spec index 5845f4f17f..b519f2f240 100644 --- a/rpms/SPECS/wazuh-agent.spec +++ b/rpms/SPECS/wazuh-agent.spec @@ -1,9 +1,4 @@ -%if %{_debugenabled} == yes - %global _enable_debug_package 1 - %global debug_package %{_rpmfilename debuginfo} - %global __os_install_post %{nil} - %define __strip /bin/true -%endif +%define _debugenabled yes Summary: 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 Name: wazuh-agent @@ -35,10 +30,12 @@ Wazuh helps you to gain security visibility into your infrastructure by monitori 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 debuginfo -Summary: Debug information for package %{name} -%description debuginfo -This package provides debug information for package %{name} +# Build debuginfo package +%debug_package +%package wazuh-agent-debuginfo +Summary: Debug information for package %{name}. +%description wazuh-agent-debuginfo +his package provides debug information for package %{name}. %prep %setup -q @@ -194,6 +191,8 @@ install -m 0640 src/init/*.sh ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/ cp src/VERSION ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/src/ cp src/REVISION ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/src/ +%{_rpmconfigdir}/find-debuginfo.sh + exit 0 %pre diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 59df5a2d48..4b8d33ec4b 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -1,7 +1,4 @@ -%global _enable_debug_package 1 -%global debug_package %{_rpmfilename debuginfo} -%global __os_install_post %{nil} -%define __strip /bin/true +%define _debugenabled yes Summary: 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 Name: wazuh-manager @@ -37,10 +34,12 @@ log analysis, file integrity monitoring, intrusions detection and policy and com # packages. %global _build_id_links none -%package debuginfo -Summary: Debug information for package %{name} -%description debuginfo -This package provides debug information for package %{name} +# Build debuginfo package +%debug_package +%package wazuh-manager-debuginfo +Summary: Debug information for package %{name}. +%description wazuh-agent-debuginfo +his package provides debug information for package %{name}. %prep %setup -q @@ -192,6 +191,8 @@ install -m 0640 src/init/*.sh ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/ cp src/VERSION ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/manager_installation_scripts/src/ cp src/REVISION ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/manager_installation_scripts/src/ +%{_rpmconfigdir}/find-debuginfo.sh + exit 0 %pre diff --git a/rpms/build.sh b/rpms/build.sh index 9164a2b5bf..9615bbccd5 100755 --- a/rpms/build.sh +++ b/rpms/build.sh @@ -47,7 +47,7 @@ fi build_dir=/build_wazuh rpm_build_dir=${build_dir}/rpmbuild file_name="wazuh-${build_target}-${wazuh_version}-${package_release}" -symbols_file_name="wazuh-${build_target}-${wazuh_version}-${package_release}-debuginfo" +symbols_file_name="wazuh-${build_target}-debuginfo-${wazuh_version}-${package_release}" rpm_file="${file_name}.${architecture_target}.rpm" symbols_rpm_file="${symbols_file_name}.${architecture_target}.rpm" src_file="${file_name}.src.rpm" @@ -136,4 +136,4 @@ if [[ "${src}" == "yes" ]]; then fi find ${extract_path} -maxdepth 3 -type f -name "${file_name}*" -exec mv {} /var/local/wazuh \; -find ${extract_path} -type f -name "*-debuginfo*" -exec mv {} /var/local/wazuh \; +find ${extract_path} -maxdepth 3 -type f -name "${symbols_file_name}*" -exec mv {} /var/local/wazuh \; diff --git a/rpms/generate_rpm_package.sh b/rpms/generate_rpm_package.sh index b2c3ee8f36..677fb4467c 100755 --- a/rpms/generate_rpm_package.sh +++ b/rpms/generate_rpm_package.sh @@ -112,7 +112,7 @@ build_rpm() { ${CHECKSUM} ${PACKAGES_BRANCH} ${USE_LOCAL_SPECS} ${SRC} \ ${LEGACY} ${USE_LOCAL_SOURCE_CODE} ${FUTURE}|| return 1 - echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." + echo "Package $(ls -Art ${OUTDIR} | tail -n 2 | tr '\n' ' ') added to ${OUTDIR}." return 0 }