8 Commits

Author SHA1 Message Date
b814d99a20 Fix decalres 2021-12-03 17:37:00 -05:00
8427c43c4f Try to fix rpm dependencies on suse 2021-12-03 17:33:01 -05:00
1c41b1ad38 Try to fix rpm dependencies on suse 2021-12-03 16:12:42 -05:00
c708274773 Try to fix rpm dependencies on suse 2021-12-03 16:11:17 -05:00
b23b62a01b Get rpm package overrides going for suse 2021-12-03 16:00:34 -05:00
885ca37a92 Get rpm package overrides going for suse 2021-12-03 15:56:43 -05:00
0b47aec349 Force install MC RPM on SUSE 2021-12-03 15:32:23 -05:00
d772aa3b6d Do we need this 2021-12-03 15:19:46 -05:00

View File

@@ -125,22 +125,19 @@ init() {
# OS-specific commands # OS-specific commands
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
pkg_install(){ ifSudo dnf install -y "$@"; } pkg_install(){ ifSudo dnf install -y "$@"; }
pkg_reinstall(){ ifSudo dnf reinstall -y "$@"; }
pkg_remove(){ ifSudo dnf remove -y "$@"; } pkg_remove(){ ifSudo dnf remove -y "$@"; }
pkg_update(){ ifSudo dnf makecache; } pkg_update(){ ifSudo dnf makecache; }
pkg_query(){ ifSudo rpm -q "$@"; } pkg_query(){ ifSudo rpm -q "$@"; }
firewall_cmd(){ ifSudo firewall-cmd "$@"; } firewall_cmd(){ ifSudo firewall-cmd "$@"; }
elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint)$ ]]; then elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint)$ ]]; then
pkg_install(){ ifSudo apt-get install -y -q0 "$@"; } pkg_install(){ ifSudo apt-get install -y -q0 "$@"; }
pkg_reinstall(){ ifSudo apt-get reinstall -y -q0 "$@"; }
pkg_remove(){ ifSudo apt-get remove --auto-remove -y -q0 "$@"; } pkg_remove(){ ifSudo apt-get remove --auto-remove -y -q0 "$@"; }
pkg_update(){ ifSudo apt-get update -y -q0; } pkg_update(){ ifSudo apt-get update -y -q0; }
pkg_query(){ ifSudo dpkg -s "$@"; } pkg_query(){ ifSudo dpkg -s "$@"; }
firewall_cmd(){ ifSudo ufw "$@"; } firewall_cmd(){ ifSudo ufw "$@"; }
elif [[ "$ID" =~ ^opensuse.* ]]; then elif [[ "$ID" =~ ^opensuse.* ]]; then
echo "SUSE support is experimental!" echo "SUSE support is experimental!"
pkg_install(){ ifSudo zypper --non-interactive -q install "$@"; } pkg_install(){ ifSudo zypper --non-interactive -q install --force --no-confirm "$@"; }
pkg_reinstall(){ ifSudo zypper --non-interactive -q install -f "$@"; }
pkg_remove(){ ifSudo zypper --non-interactive -q remove --clean-deps "$@"; } pkg_remove(){ ifSudo zypper --non-interactive -q remove --clean-deps "$@"; }
pkg_update(){ ifSudo zypper --non-interactive -q refresh; } pkg_update(){ ifSudo zypper --non-interactive -q refresh; }
pkg_query(){ ifSudo rpm -q "$@"; } pkg_query(){ ifSudo rpm -q "$@"; }
@@ -212,7 +209,7 @@ getOS() {
debug "Platform: $ID $VERSION_ID" debug "Platform: $ID $VERSION_ID"
} }
ifSudo() { ifSudo() {
declare -l _user="root" local _user="root"
if [[ $# == 0 ]]; then if [[ $# == 0 ]]; then
[[ "$_exec_user" == "root" ]]; return $? [[ "$_exec_user" == "root" ]]; return $?
elif [[ $# -eq 2 && "$1" == "-u" ]]; then elif [[ $# -eq 2 && "$1" == "-u" ]]; then
@@ -588,7 +585,7 @@ acquireDeb() {
buildRPM() { buildRPM() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -l _build_requires _requires local _build_requires _requires _ec
declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm" declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm"
@@ -609,18 +606,15 @@ buildRPM() {
_build_requires=$'BuildRequires: rpm >= 4.11.0\nBuildRequires: dpkg' _build_requires=$'BuildRequires: rpm >= 4.11.0\nBuildRequires: dpkg'
fi fi
# ALIASES (for SUSE)
# If you are building on SUSE, I assume you want SUSE RPMs # If you are building on SUSE, I assume you want SUSE RPMs
# i.e. cross-building not an option but could be added # i.e. cross-building not an option but could be added
if [[ "$ID" =~ ^opensuse.*$ ]]; then if [[ "$ID" =~ ^opensuse.*$ ]]; then
_requires=$'Requires: libglvnd \nBuildRequires: dpkg' _requires=$'Requires: Mesa-libVulkan-devel\n'
else else
_requires=$'Requires: libglvnd \nBuildRequires: dpkg' _requires=$'Requires: mesa-vulkan-drivers\n'
fi fi
debug "Requires: $_requires"
# Create spec file # Create spec file
cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec" cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec"
@@ -645,7 +639,6 @@ buildRPM() {
Requires: libXdmcp >= 1.1 Requires: libXdmcp >= 1.1
Requires: libstdc++ >= 7.4 Requires: libstdc++ >= 7.4
Requires: gtk3 >= 3.24 Requires: gtk3 >= 3.24
Requires: mesa-libGL
Requires: pango >= 1.42 Requires: pango >= 1.42
Requires: nss >= 3.42 Requires: nss >= 3.42
Requires: nspr >= 4.20 Requires: nspr >= 4.20
@@ -664,6 +657,7 @@ buildRPM() {
Requires: mesa-vulkan-drivers Requires: mesa-vulkan-drivers
Requires: ca-certificates Requires: ca-certificates
Requires: libXScrnSaver Requires: libXScrnSaver
${_requires:-}
Recommends: vorbis-tools >= 1.4.0 Recommends: vorbis-tools >= 1.4.0
Recommends: lame >= 3.0 Recommends: lame >= 3.0
@@ -705,7 +699,7 @@ 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
declare -l _ec=$? _ec=$?
[[ "$_ec" == 0 ]] && echo "Build successful. The RPM file is located at: $_mcrpm" [[ "$_ec" == 0 ]] && echo "Build successful. The RPM file is located at: $_mcrpm"
return $_ec return $_ec
} }