Merge pull request #952 from rafalste/debug_packages

Force creating debug symbols RPMs on SLES
This commit is contained in:
Robert Baldyga 2021-09-09 15:33:17 +02:00 committed by GitHub
commit 340931cebe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,6 @@ CAS_LICENSE_NAME="BSD-3-Clause-Clear"
SUPPORTED_FROM_VERSION="20.03" SUPPORTED_FROM_VERSION="20.03"
THIS=$(basename "$0") THIS=$(basename "$0")
ARCH="$(uname -i)" ARCH="$(uname -i)"
SYS_INFO="/etc/os-release"
SCRIPT_BASE_DIR=$(dirname $(realpath "$0")) SCRIPT_BASE_DIR=$(dirname $(realpath "$0"))
RPM_SPEC_FILE="$SCRIPT_BASE_DIR/$THIS.d/rpm/CAS_NAME.spec" RPM_SPEC_FILE="$SCRIPT_BASE_DIR/$THIS.d/rpm/CAS_NAME.spec"
DEB_CONTROL_FILES_DIR="$SCRIPT_BASE_DIR/$THIS.d/deb/debian" DEB_CONTROL_FILES_DIR="$SCRIPT_BASE_DIR/$THIS.d/deb/debian"
@ -114,6 +113,12 @@ clean_all() {
fi fi
} }
check_os() {
source "/etc/os-release"
echo "$ID_LIKE"
}
check_options() { check_options() {
if [ ! "$SOURCES_DIR" ]; then if [ ! "$SOURCES_DIR" ]; then
invalid_usage "no mandatory SOURCES_PATH provided" invalid_usage "no mandatory SOURCES_PATH provided"
@ -298,6 +303,9 @@ rpm_spec_prepare() {
if [ "$DEBUG" ]; then if [ "$DEBUG" ]; then
echo "--- Debug RPMs will be built as well" echo "--- Debug RPMs will be built as well"
sed -i "s/%define debug_package %{nil}//g" "$RPM_SPECS_DIR/$CAS_NAME.spec" sed -i "s/%define debug_package %{nil}//g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
if [[ $(check_os) =~ suse|sles ]]; then
sed -i "s/%prep/%debug_package\n\n\n%prep/g" "$RPM_SPECS_DIR/$CAS_NAME.spec"
fi
fi fi
if [ ! -f "$RPM_SPECS_DIR/$CAS_NAME.spec" ]; then if [ ! -f "$RPM_SPECS_DIR/$CAS_NAME.spec" ]; then
@ -349,8 +357,7 @@ generate_rpm() {
rpm_obtain_sources rpm_obtain_sources
rpm_spec_prepare rpm_spec_prepare
. $SYS_INFO if [[ $(check_os) =~ suse|sles ]] && [ -d /usr/src/packages ]; then
if [[ "$ID_LIKE" =~ suse|sles ]] && [ -d /usr/src/packages ]; then
info "INFO: It appears that you are using SUSE Linux."\ info "INFO: It appears that you are using SUSE Linux."\
"In case of encountering error during building of RPM package,"\ "In case of encountering error during building of RPM package,"\
"about missing files or directories in /usr/src/packages/,"\ "about missing files or directories in /usr/src/packages/,"\