4 Commits

Author SHA1 Message Date
83e7b9200f 1.3.8 release 2024-11-04 00:32:37 -05:00
8bdf184511 Add new Ubuntu sources file format 2024-11-04 00:27:33 -05:00
de547f5d3a Add installJRMC version to default output 2024-11-01 16:55:38 -04:00
a2da04fec1 Allow --mcversion to use major version number 2024-11-01 14:25:34 -04:00
2 changed files with 55 additions and 18 deletions

View File

@@ -27,7 +27,7 @@ $ installJRMC --help
--compat --compat
Build/install MC without minimum dependency version requirements Build/install MC without minimum dependency version requirements
--mcversion VERSION --mcversion VERSION
Build or install a specific MC version, ex. "33.0.30" (default: latest version) Build or install a specific MC version, ex. "33.0.30" or "33" (default: latest)
--mcrepo REPO --mcrepo REPO
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official) Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
--arch ARCH --arch ARCH

View File

@@ -16,7 +16,7 @@
shopt -s extglob shopt -s extglob
declare -g SCRIPT_VERSION="1.3.7" declare -g SCRIPT_VERSION="1.3.8"
declare -g MC_REPO="bullseye" # should match the MC_VERSION declare -g MC_REPO="bullseye" # should match the MC_VERSION
declare -g MC_VERSION="33.0.30" # Do find all replace declare -g MC_VERSION="33.0.30" # Do find all replace
declare -g BOARD_URL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33 declare -g BOARD_URL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33
@@ -42,7 +42,7 @@ print_help() {
--compat --compat
Build/install MC locally without minimum dependency version requirements Build/install MC locally without minimum dependency version requirements
--mcversion VERSION --mcversion VERSION
Specify the MC version, ex. "$MC_VERSION" (default: latest version) Specify the MC version, ex. "$MC_VERSION" or "${MC_VERSION%%.*}" (default: latest)
--arch VERSION --arch VERSION
Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture) Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture)
--mcrepo REPO --mcrepo REPO
@@ -146,6 +146,24 @@ parse_input() {
shift shift
if [[ $1 =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then if [[ $1 =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then
USER_MC_VERSION="$1" USER_MC_VERSION="$1"
elif [[ $1 =~ ([0-9][0-9]) ]]; then
case $1 in
33) ;; # use update check to determine latest version
32) USER_MC_VERSION="32.0.58" ;;
31) USER_MC_VERSION="31.0.83" ;;
30) USER_MC_VERSION="30.0.96" ;;
29) USER_MC_VERSION="29.0.91" ;;
28) USER_MC_VERSION="28.0.110" ;;
27) USER_MC_VERSION="27.0.88" ;;
26) USER_MC_VERSION="26.0.107" ;;
25) USER_MC_VERSION="25.0.114" ;;
24) USER_MC_VERSION="24.0.78" ;;
23) USER_MC_VERSION="23.0.104" ;;
22) USER_MC_VERSION="22.0.102" ;;
21) USER_MC_VERSION="21.0.90" ;;
20) USER_MC_VERSION="20.0.131" ;;
*) err "Bad --mcversion"; print_help; exit 1 ;;
esac
else else
err "Bad --mcversion"; print_help; exit 1 err "Bad --mcversion"; print_help; exit 1
fi fi
@@ -288,8 +306,12 @@ init() {
# Match the MC repo to the system codename # Match the MC repo to the system codename
if [[ -z $USER_MC_REPO && ($ID == debian || $ID == ubuntu) ]]; then if [[ -z $USER_MC_REPO && ($ID == debian || $ID == ubuntu) ]]; then
if [[ $UBUNTU_CODENAME == "oracular" ]]; then
MC_REPO="noble" # TODO temporarily use noble repo for Ubuntu 24.10
else
MC_REPO=${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO}} MC_REPO=${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO}}
fi fi
fi
# Use the correct repo for legacy MC versions # Use the correct repo for legacy MC versions
if [[ -n $USER_MC_VERSION ]]; then if [[ -n $USER_MC_VERSION ]]; then
@@ -299,6 +321,7 @@ init() {
2[7-9]|30) USER_MC_REPO="buster" ;; 2[7-9]|30) USER_MC_REPO="buster" ;;
31) USER_MC_REPO="bullseye" ;; 31) USER_MC_REPO="bullseye" ;;
# After this point, things get messy with multiple repos for the same MC version # After this point, things get messy with multiple repos for the same MC version
# Just use the default repo
esac esac
fi fi
@@ -560,28 +583,40 @@ install_mesa_freeworld() {
install_mc_repo() { install_mc_repo() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
local deb_repo_file="/etc/apt/sources.list.d/jriver.list" local repo_file repo_text
local rpm_repo_file="/etc/yum.repos.d/jriver.repo"
case $ID in case $ID in
fedora|centos) fedora|centos)
sudo bash -c "cat <<-EOF > $rpm_repo_file repo_file="/etc/yum.repos.d/jriver.repo"
read -r -d '' repo_text <<-EOF
[jriver] [jriver]
name=JRiver Media Center by BryanC name=JRiver Media Center by BryanC
baseurl=https://repos.bryanroessler.com/jriver baseurl=https://repos.bryanroessler.com/jriver
gpgcheck=0 gpgcheck=0
EOF" EOF
;; ;;
debian|ubuntu) debian|ubuntu)
install_package wget local major_version="${VERSION_ID%%.*}"
debug "Installing JRiver Media Center RPM key" local minor_version="${VERSION_ID##*.}"
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring.gpg" local keyfile="/usr/share/keyrings/jriver-com-archive-keyring.gpg"
if [[ $ID == "ubuntu" ]] \
&& [[ $major_version -gt 24 || ($major_version -eq 24 && $minor_version -ge 10) ]]; then
repo_file="/etc/apt/sources.list.d/jriver.sources" # TODO new Ubuntu sources file format
read -r -d '' repo_text <<-EOF
Types: deb
URIs: http://dist.jriver.com/latest/mediacenter/
Signed-By: $keyfile
Suites: noble
Components: main
EOF
else
repo_file="/etc/apt/sources.list.d/jriver.list"
repo_text="deb [signed-by=$keyfile arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $MC_REPO main"
fi
install_package wget
echo "Installing JRiver Media Center RPM key"
wget --quiet --output-document=- http://dist.jriver.com/mediacenter@jriver.com.gpg.key | wget --quiet --output-document=- http://dist.jriver.com/mediacenter@jriver.com.gpg.key |
gpg --dearmor | sudo tee "$keyfile" &>/dev/null gpg --dearmor | sudo tee "$keyfile" &>/dev/null
debug "Adding MC repository to $deb_repo_file"
sudo bash -c "cat <<-EOF > $deb_repo_file
deb [signed-by=$keyfile arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $MC_REPO main
EOF"
;; ;;
*) *)
err "An MC repository for $ID is not yet available" err "An MC repository for $ID is not yet available"
@@ -590,6 +625,9 @@ install_mc_repo() {
;; ;;
esac esac
echo "Adding MC repository to $repo_file"
sudo tee "$repo_file" > /dev/null <<< "$repo_text"
if ! "${PKG_UPDATE[@]}"; then if ! "${PKG_UPDATE[@]}"; then
err "Package update failed!" err "Package update failed!"
return 1 return 1
@@ -865,7 +903,7 @@ install_mc_deb() {
install_mc_rhel() { install_mc_rhel() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
# Install mesa-va-freeworld separately from the RPM for dnf swap # Swap in freeworld hardware acceleration separately from the RPM
install_mesa_freeworld install_mesa_freeworld
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM" install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
@@ -957,7 +995,7 @@ install_mc_arch() {
popd &>/dev/null || return popd &>/dev/null || return
} }
# @description Copy the RPM to createrepo-webroot and runs createrepo as the createrepo-user # @description Copy the RPM to createrepo-webroot and run createrepo as the createrepo-user
run_createrepo() { run_createrepo() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
@@ -1576,10 +1614,9 @@ update() {
main() { main() {
debug "Running: ${FUNCNAME[0]} $*" debug "Running: ${FUNCNAME[0]} $*"
echo "Starting installJRMC" echo "Starting installJRMC $SCRIPT_VERSION"
if (( DEBUG )); then if (( DEBUG )); then
echo "Debugging on" echo "Debugging on"
echo "installJRMC version: $SCRIPT_VERSION"
else else
echo "To enable debugging output, use --debug or -d" echo "To enable debugging output, use --debug or -d"
fi fi