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