|
@@ -589,10 +589,17 @@ acquireDeb() {
|
|
buildRPM() {
|
|
buildRPM() {
|
|
debug "Running: ${FUNCNAME[0]}"
|
|
debug "Running: ${FUNCNAME[0]}"
|
|
|
|
|
|
|
|
+ declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm"
|
|
|
|
+
|
|
|
|
+ # skip rebuilding the rpm if it already exists
|
|
|
|
+ if [[ -f "$_mcrpm" ]]; then
|
|
|
|
+ echo "$_mcrpm already exists. Skipping build step."
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
# install build dependencies
|
|
# install build dependencies
|
|
installPackage "wget" "dpkg" "rpm-build"
|
|
installPackage "wget" "dpkg" "rpm-build"
|
|
|
|
|
|
- # If necessary, make build directories
|
|
|
|
[[ ! -d "$_outputdir/SPECS" ]] && mkdir -p "$_outputdir/SPECS"
|
|
[[ ! -d "$_outputdir/SPECS" ]] && mkdir -p "$_outputdir/SPECS"
|
|
|
|
|
|
# rpmbuild uses rpm to check for build dependencies
|
|
# rpmbuild uses rpm to check for build dependencies
|
|
@@ -677,14 +684,6 @@ buildRPM() {
|
|
/etc/security/limits.d/*
|
|
/etc/security/limits.d/*
|
|
EOF
|
|
EOF
|
|
|
|
|
|
- declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm"
|
|
|
|
-
|
|
|
|
- # skip rebuilding the rpm if it already exists
|
|
|
|
- if [[ -f "$_mcrpm" ]]; then
|
|
|
|
- echo "$_mcrpm already exists. Skipping build step."
|
|
|
|
- return 0
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
# Run rpmbuild
|
|
# Run rpmbuild
|
|
echo "Building version $_mcversion, please wait..."
|
|
echo "Building version $_mcversion, please wait..."
|
|
if debug; then
|
|
if debug; then
|
|
@@ -692,8 +691,6 @@ buildRPM() {
|
|
else
|
|
else
|
|
rpmbuild --quiet --define="%_topdir $_outputdir" --define="%_libdir /usr/lib" -bb "$_outputdir/SPECS/mediacenter.spec" > /dev/null 2>&1
|
|
rpmbuild --quiet --define="%_topdir $_outputdir" --define="%_libdir /usr/lib" -bb "$_outputdir/SPECS/mediacenter.spec" > /dev/null 2>&1
|
|
fi
|
|
fi
|
|
-
|
|
|
|
- return $?
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1306,12 +1303,15 @@ main() {
|
|
# Build RPM from source deb package
|
|
# Build RPM from source deb package
|
|
if [[ -v _build ]]; then
|
|
if [[ -v _build ]]; then
|
|
acquireDeb
|
|
acquireDeb
|
|
- if ! buildRPM || [[ ! -f "$_mcrpm" ]] ; then
|
|
|
|
|
|
+ if buildRPM; then
|
|
|
|
+ echo "Build Successful."
|
|
|
|
+ echo "The RPM file is located at: $_mcrpm"
|
|
|
|
+ else
|
|
err "Build failed."
|
|
err "Build failed."
|
|
|
|
+ # In case this is automated, let's remove the source DEB and reaquire
|
|
|
|
+ # it on next run in case it is corrupted or buggy
|
|
[[ -f "$DEBFILENAME" ]] && echo "Removing source DEB" && rm -f "$DEBFILENAME"
|
|
[[ -f "$DEBFILENAME" ]] && echo "Removing source DEB" && rm -f "$DEBFILENAME"
|
|
exit 1
|
|
exit 1
|
|
- else
|
|
|
|
- echo "Build successful. The RPM file is located at: $_mcrpm"
|
|
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
|