From 55541faa29dd89961ce695d1915696fb1cff0481 Mon Sep 17 00:00:00 2001 From: Silvan Date: Sun, 29 Dec 2024 20:26:02 +0100 Subject: [PATCH] libspec.lib: no longer check for %debug_package macro since rpm 4.20 automatically manages the debug package --- conf/02-specfile-rpm-macros-debug.conf | 1 - lib/libspec.lib.in | 21 ++++++++++++++------- plugins/pck-update.in | 2 +- plugins/spec-create.in | 1 - 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/conf/02-specfile-rpm-macros-debug.conf b/conf/02-specfile-rpm-macros-debug.conf index 7cde4a6..3d5d61b 100644 --- a/conf/02-specfile-rpm-macros-debug.conf +++ b/conf/02-specfile-rpm-macros-debug.conf @@ -1,3 +1,2 @@ ## macros used to automatically build debug packages -------------------------- -rpm_macro_debug_package="%debug_package" rpm_macro_debug_package_suffix="debug" diff --git a/lib/libspec.lib.in b/lib/libspec.lib.in index f294f54..1a5aefc 100644 --- a/lib/libspec.lib.in +++ b/lib/libspec.lib.in @@ -1132,15 +1132,22 @@ rpmvars.solve "$filesname" "$specfile")" ) esac notify.debug "$FUNCNAME: $var = ( ${SPEC_TARGET[*]} )" ;; - *) if [[ -n "$rpm_macro_debug_package" && \ - "${tok[0]}" = "$rpm_macro_debug_package" ]]; then - # rpm macro for creating debug packages - SPEC_TARGET=( ${SPEC_TARGET[@]} \ - "${SPEC_NAME}-${rpm_macro_debug_package_suffix}" ) - fi - ;; esac done < $specfile + # Add debug package to SPEC_TARGET list if found + if [ "${SPEC_BUILDARCH:-$BUILD_ARCH}" == "noarch" ]; then + dbg_filename="$(package.generate_name -p -a noarch -t rpm \ + -n ${SPEC_NAME}-${rpm_macro_debug_package_suffix} -v ${SPEC_VERSION} -r ${SPEC_RELEASE%%[^0-9\.]*})" + else + dbg_filename="$(package.generate_name -p -a ${SPEC_BUILDARCH:-$BUILD_ARCH} -t rpm \ + -n ${SPEC_NAME}-${rpm_macro_debug_package_suffix} -v ${SPEC_VERSION} -r ${SPEC_RELEASE%%[^0-9\.]*})" + fi + notify.warning "debugpkg: ${SPEC_BUILDARCH:-$BUILD_ARCH} $dbg_filename" + if [[ -e "$dbg_filename" ]]; then + # rpm macro for creating debug packages + SPEC_TARGET=( ${SPEC_TARGET[@]} \ + "${SPEC_NAME}-${rpm_macro_debug_package_suffix}" ) + fi #notify.debug "$FUNCNAME: $var = ( ${SPEC_TARGET[*]} )" ;; SPEC_OBSOLETES) diff --git a/plugins/pck-update.in b/plugins/pck-update.in index da287b8..b99ef10 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -544,9 +544,9 @@ done)" [ "$SPEC_PATCH" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_PATCH [ "$SPEC_SOURCE" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_SOURCE [ "$SPEC_LICENSE" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_LICENSE + [ "$SPEC_BUILDARCH" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_BUILDARCH [ "$SPEC_TARGET" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_TARGET [ "$SPEC_OBSOLETES" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_OBSOLETES - [ "$SPEC_BUILDARCH" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_BUILDARCH [ "$SPEC_BUILDREQUIRES" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_BUILDREQUIRES [ "$SPEC_BUILDROOT" ] || specfile.getvars -s $SPECFILE_PREPROCESSED SPEC_BUILDROOT diff --git a/plugins/spec-create.in b/plugins/spec-create.in index 729ab65..221cf46 100644 --- a/plugins/spec-create.in +++ b/plugins/spec-create.in @@ -959,7 +959,6 @@ $spec_cmd_configure_autotools --enable-gtk-doc" # 12. debug package local debug_package="0" - [ -n "$rpm_macro_debug_package" ] && debug_package="1" # FIXME: missing support for: # pkgconfig files