Use discrete spec files

This commit is contained in:
2025-04-23 17:52:29 -04:00
parent ac801134ea
commit 1ab930708e

View File

@@ -765,11 +765,12 @@ build_rpm() {
local i rpmbuild_cmd stub local i rpmbuild_cmd stub
local -a requires recommends local -a requires recommends
local spec_file="$OUTPUT_DIR/SPECS/mediacenter$MC_MVERSION-$MC_VERSION-$MC_RELEASE-$BUILD_TARGET-$ARCH.spec"
# skip rebuilding the rpm if it already exists # skip rebuilding the rpm if it already exists
debug "Checking for existing MC RPM: $MC_RPM" debug "Checking for existing MC RPM: $MC_RPM"
if [[ -f $MC_RPM ]]; then if [[ -f $MC_RPM && -f $spec_file ]]; then
echo "$MC_RPM already exists. Skipping build step" echo "Spec file and $MC_RPM already exists. Skipping build step"
return 0 return 0
fi fi
@@ -879,7 +880,7 @@ build_rpm() {
fi fi
# Create spec file # Create spec file
cat <<-EOF > "$OUTPUT_DIR/SPECS/mediacenter.spec" cat <<-EOF > "$spec_file"
Name: mediacenter$MC_MVERSION Name: mediacenter$MC_MVERSION
Version: $MC_VERSION Version: $MC_VERSION
Release: $MC_RELEASE Release: $MC_RELEASE
@@ -933,7 +934,7 @@ build_rpm() {
--define="_libdir /usr/lib" --define="_libdir /usr/lib"
--target="$ARCH" --target="$ARCH"
-bb -bb
"$OUTPUT_DIR/SPECS/mediacenter.spec" "$spec_file"
) )
if execute "${rpmbuild_cmd[@]}" && [[ -f $MC_RPM ]] ; then if execute "${rpmbuild_cmd[@]}" && [[ -f $MC_RPM ]] ; then
echo "Build successful. The RPM file is located at: $MC_RPM" echo "Build successful. The RPM file is located at: $MC_RPM"