27 Commits

Author SHA1 Message Date
1428c86d83 Update Arch depends 2026-02-06 19:03:00 -05:00
f2aeef29f0 1.35.12 release 2026-02-06 18:55:09 -05:00
ef6fb474b6 Translate pm requires for suse/mandriva 2026-02-06 18:54:13 -05:00
73eaeb24b4 Translate new power manager requires 2026-02-06 18:19:48 -05:00
32e35bfe3a 1.35.11 release 2026-02-03 22:22:56 -05:00
d69d33d51d Use new repo key in apt container 2026-02-03 22:08:47 -05:00
d7d5af3a0b Deploy updated repo signing key 2026-02-03 20:57:13 -05:00
f07dfa9ece 1.35.10 release 2026-02-02 12:23:10 -05:00
3eb19ea96b Fix codename precedence on Mint 2026-02-02 12:12:47 -05:00
9b9af30306 Use codenames on Debian 2026-02-02 12:03:10 -05:00
170902ea0b Add remove_legacy_repo() 2026-01-22 18:07:12 -05:00
260fcaa1c0 Always use deb822 sources format 2026-01-22 17:12:03 -05:00
5104de1b6d 1.35.9 release 2026-01-22 16:52:57 -05:00
7279645438 Use newer apt sources format on jammy 2026-01-22 16:45:57 -05:00
36c52e97a0 1.35.8 release 2026-01-21 18:32:21 -05:00
c671d1ea4f Normalize on Ubuntu codenames, not versions 2026-01-21 18:06:44 -05:00
459185ec9d Add rerun() 2026-01-21 06:47:31 -05:00
869e0995dd Revert use download() for piped re-exec 2026-01-21 06:34:51 -05:00
536123eef9 Use download() for piped re-exec 2026-01-21 06:33:53 -05:00
e170a3ade5 1.35.7 release 2026-01-21 06:25:36 -05:00
c3b5660f2b Redownload script on re-exec if piped 2026-01-21 06:23:09 -05:00
eb1a4c76ba Store piped script to intermediate file 2026-01-21 06:19:17 -05:00
d59ff67d59 Run repo fallback automatically 2026-01-21 06:11:40 -05:00
6184ef7cbd Add more debug 2026-01-21 06:07:47 -05:00
776509f038 Add temp debug 2026-01-21 06:05:09 -05:00
19628c7d18 Don't run trap at all for debug 2026-01-21 06:01:29 -05:00
16b6f1e7cd Don't run trap on ERR 2026-01-21 05:57:48 -05:00
3 changed files with 94 additions and 74 deletions

View File

@@ -31,7 +31,7 @@ $ installJRMC --help
--compat
Build/install MC without minimum dependency version requirements.
--mcversion VERSION
Specify the MC version, ex. "33", "35.0.27", or "35.0.27-1" (default: latest).
Specify the MC version, ex. "33", "35.0.43", or "35.0.43-1" (default: latest).
--arch ARCH
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture).
--mcrepo REPO
@@ -126,8 +126,8 @@ Install the latest version of MC33 from the best available repository with debug
Install a more widely-compatible version of the latest MC version.
[code]installJRMC --install repo --service jriver-mediacenter --service-type user[/code]
Install MC from the repository and start/enable jriver-mediacenter.service as a user service.
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.27[/code]
Build and install an MC 35.0.27 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.43[/code]
Build and install an MC 35.0.43 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
[code]installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
Build an RPM locally for the current distro, move it to the webroot, and run createrepo as www-user.
[code]installJRMC --service jriver-createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]

View File

@@ -28,7 +28,7 @@ $ installJRMC --help
--compat
Build/install MC without minimum dependency version requirements.
--mcversion VERSION
Build or install a specific MC version, ex. "35.0.27" or "33" (default: latest).
Build or install a specific MC version, ex. "35.0.43" or "33" (default: latest).
--mcrepo REPO
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official).
--arch ARCH
@@ -130,9 +130,9 @@ Multiple services (but not `--service-types`) can be installed at one time using
Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service.
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.27`
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.43`
Build and install an MC 35.0.27 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
Build and install an MC 35.0.43 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`

View File

@@ -21,8 +21,8 @@
# shellcheck disable=SC2329
shopt -s extglob
declare -g SCRIPT_VERSION="1.35.6"
declare -g MC_VERSION_HARDCODE="35.0.27" # do find all replace
declare -g SCRIPT_VERSION="1.35.13-dev"
declare -g MC_VERSION_HARDCODE="35.0.43" # do find all replace
declare -g MC_REPO_HARDCODE="bookworm" # should match the MC_VERSION_HARDCODE
declare -g BOARD_ID="92.0" # MC35 board ID for fallback latest version detection
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
@@ -236,10 +236,15 @@ init() {
declare -g USER
declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
declare -g SCRIPT_DIR; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
declare -gi SCRIPT_IS_PIPED=0
# Detect if script is being piped (SCRIPT_PATH won't be a regular file)
[[ ! -f $SCRIPT_PATH ]] && SCRIPT_IS_PIPED=1
declare -g OUTPUT_DIR="$SCRIPT_DIR/output"
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
declare -g CREATEREPO_USER="$USER" # can be root
declare -g ID VERSION_ID ARCH MC_ARCH NAME
declare -g ID VERSION_ID UBUNTU_CODENAME VERSION_CODENAME ARCH MC_ARCH NAME
declare -g MC_MVERSION MC_RELEASE MC_PKG MC_RPM MC_ROOT
declare -ga PKG_INSTALL PKG_REMOVE PKG_UPDATE PKG_QUERY
declare -ga SERVICES CONTAINERS
@@ -257,7 +262,7 @@ init() {
fi
# Run the self-updater if enabled
((SELF_UPDATE_SWITCH)) && update "$@"
((SELF_UPDATE_SWITCH)) && ((! SCRIPT_IS_PIPED)) && update "$@"
# Check that the .jriver directory is owned by the user
((YES_SWITCH)) || fix_permissions "$HOME/.jriver" "$USER"
@@ -382,20 +387,10 @@ init() {
# Set default targets
BUILD_TARGET="${BUILD_TARGET:-$ID}"
CREATEREPO_TARGET="${CREATEREPO_TARGET:-$ID}"
# Repo selection (precedence: user > host (MC31+ debian/ubuntu) > hardcoded)
if [[ -n $MC_REPO_USER ]]; then
MC_REPO="$MC_REPO_USER"
elif [[ $ID =~ debian|ubuntu && "${MC_MVERSION_USER:-${MC_VERSION_HARDCODE%%.*}}" -ge 31 ]]; then
MC_REPO=${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO_HARDCODE}}
else
MC_REPO="$MC_REPO_HARDCODE"
fi
MC_REPO="${MC_REPO_USER:-${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO_HARDCODE}}}" # user>host>hardcoded
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
set_mc_version
echo "Selected MC version $MC_VERSION from the $MC_REPO repo (via $MC_VERSION_SOURCE)"
# Set additional MC version variables
@@ -606,15 +601,13 @@ install_external_repos() {
}
# @description Installs host-specific temporary legacy repo for missing dependencies
install_legacy_repo() {
add_legacy_repo() {
debug "${FUNCNAME[0]}()"
local major_version="${VERSION_ID%%.*}"
local minor_version="${VERSION_ID##*.}"; minor_version="${minor_version#0}" # strip leading zero
local repo_name repo_uri repo_suite repo_key temp_repo_file
case $ID in
ubuntu)
if [[ $major_version -gt 24 || ( $major_version -eq 24 && minor_version -ge 4 ) ]]; then
if [[ $UBUNTU_CODENAME =~ ^[n-z] ]]; then # noble and later
echo "Temporarily adding jammy repository for libwebkit2gtk-4.0-37, etc."
repo_name="ubuntu-jammy-temp"
repo_uri="https://archive.ubuntu.com/ubuntu"
@@ -623,7 +616,7 @@ install_legacy_repo() {
fi
;;
debian)
if [[ $major_version -ge 13 ]]; then
if [[ ${VERSION_ID%%.*} -ge 13 ]]; then
echo "Temporarily adding bookworm repository for libwebkit2gtk-4.0-37, etc."
repo_name="debian-bookworm-temp"
repo_uri="https://deb.debian.org/debian"
@@ -644,12 +637,16 @@ install_legacy_repo() {
Architectures: $MC_ARCH
Signed-By: $repo_key
EOF
# Set a trap to always cleanup legacy repo
# shellcheck disable=SC2064
trap "sudo rm -f $temp_repo_file" EXIT ERR INT
declare -g LEGACY_REPO_FILE="$temp_repo_file"
fi
}
# @description Removes temporary legacy repository if present
remove_legacy_repo() {
debug "${FUNCNAME[0]}()"
[[ -n $LEGACY_REPO_FILE ]] && execute sudo rm -f "$LEGACY_REPO_FILE"
}
# @description Acquires the source DEB package from JRiver
acquire_deb() {
debug "${FUNCNAME[0]}()"
@@ -782,6 +779,8 @@ translate_packages() {
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.0*/webkit2gtk4.0}")
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1*/webkit2gtk4.1}")
requires_arr=("${requires_arr[@]/libsdbus-c++1/sdbus-cpp}")
requires_arr=("${requires_arr[@]/libdbus-1-3/dbus-libs}")
requires_arr=("${requires_arr[@]/libxss1/libXScrnSaver}")
recommends_arr=("${recommends_arr[@]/fdkaac/fdk-aac-free}")
recommends_arr+=("mesa-va-drivers-freeworld|mesa-va-drivers")
recommends_arr+=("mesa-vulkan-drivers-freeworld|mesa-vulkan-drivers")
@@ -807,6 +806,7 @@ translate_packages() {
requires_arr=("${requires_arr[@]/libharfbuzz0b/libharfbuzz0}")
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.0*/libwebkit2gtk-4_0-37}")
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1*/libwebkit2gtk-4_1-0}")
requires_arr=("${requires_arr[@]/libxss1/libXss1}")
for i in "${!requires_arr[@]}"; do
[[ ${requires_arr[$i]} == "mesa-vulkan-drivers" ]] && unset -v 'requires_arr[i]'
[[ ${requires_arr[$i]} == "libsdbus-c++1" ]] && unset -v 'requires_arr[i]'
@@ -848,6 +848,8 @@ translate_packages() {
requires_arr=("${requires_arr[@]/mesa-vulkan-drivers/lib64dri-drivers}")
requires_arr=("${requires_arr[@]/vulkan-icd/vulkan-loader}")
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1-0/lib64webkit2gtk4.1}")
requires_arr=("${requires_arr[@]/libdbus-1-3/libdbus-1_3}")
requires_arr=("${requires_arr[@]/libxss1/libxscrnsaver1}")
recommends_arr=("${recommends_arr[@]/musepack-tools/mppenc}")
for i in "${!recommends_arr[@]}"; do
[[ ${recommends_arr[$i]} == "fdkaac" ]] && unset -v 'recommends_arr[i]'
@@ -855,8 +857,8 @@ translate_packages() {
;;
arch)
# Set these manually for Arch since they are quite different
requires_arr=('alsa-lib' 'ca-certificates' 'gtk3' 'gcc-libs' 'libx11' 'libxext'
'libxcb' 'libxau' 'libxdmcp' 'util-linux' 'mesa-libgl' 'webkit2gtk')
requires_arr=('alsa-lib' 'ca-certificates' 'dbus' 'gtk3' 'gcc-libs' 'libx11' 'libxext'
'libxcb' 'libxau' 'libxdmcp' 'libxss' 'util-linux' 'mesa-libgl' 'webkit2gtk')
recommends_arr=('mesa-libgl' 'nvidia-libgl' 'nvidia-utils' 'vulkan-intel'
'vulkan-radeon' 'vorbis-tools' 'musepack-tools')
;;
@@ -1014,7 +1016,7 @@ install_mc_deb() {
execute sed -E -i 's/,[[:space:]]*libwebkit2gtk[^,]*(,|\?)?//g' control
# TODO workaround for legacy ZorinOS
if [[ $ID == "ubuntu" && ${VERSION_ID%.*} -le 16 ]] &&
if [[ $ID == "ubuntu" && ${VERSION_ID%%.*} -le 16 ]] &&
grep -q zorin /etc/os-release; then
execute sed -i 's/libva2/libva1/g' control
fi
@@ -1027,8 +1029,8 @@ install_mc_deb() {
fi
# Add older repository for libwebkit2gtk-4.0-37, etc, on newer Debian/Ubuntu
install_legacy_repo
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; }
add_legacy_repo
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; remove_legacy_repo; return 1; }
# Copy the DEB to a temporary file so _apt can read it
debug "Creating temporary deb file owned by _apt"
@@ -1045,13 +1047,15 @@ install_mc_deb() {
--reinstall \
"$temp_deb"; then
err "Local MC DEB installation failed"
remove_legacy_repo
execute sudo rm -f "$temp_deb"
if ask_ok "Remove source DEB and retry?"; then
execute sudo rm -f "$MC_DEB"
exec "$SCRIPT_PATH" "$@" "--no-update"
rerun "$@"
fi
return 1
fi
remove_legacy_repo
execute sudo rm -f "$temp_deb"
return 0
}
@@ -1160,7 +1164,7 @@ link_ssl_certs() {
for f in "${source_certs[@]}"; do
if [[ -f $f ]]; then
if execute sudo ln -fs "$f" "$mc_cert_link"; then
debug "Symlinked $mc_cert_link to $f"
echo "Symlinked $mc_cert_link to $f"
return 0
fi
fi
@@ -1208,6 +1212,7 @@ restore_license() {
fi
fi
done
return 1
fi
}
@@ -1596,16 +1601,6 @@ uninstall() {
done
done
# Remove the repository files
for file in "/etc/yum.repos.d/jriver.repo" /etc/apt/sources.list.d/{jriver,mediacenter}*.{list,sources}; do
if [[ -e $file ]]; then
echo "Removing repository file: $file"
execute sudo rm -f "$file"
fi
done
[[ $ID == "suse" ]] && execute sudo zypper --non-interactive removerepo jriver
echo "Removing firewall rules"
for service in jriver-mediacenter jriver-xvnc jriver-x11vnc; do
if command -v firewall-cmd &>/dev/null; then
@@ -1628,6 +1623,16 @@ uninstall() {
err "Could not remove Media Center package"
fi
# Remove the repository files
for file in "/etc/yum.repos.d/jriver.repo" /etc/apt/sources.list.d/{jriver,mediacenter}*.{list,sources}; do
if [[ -e $file ]]; then
echo "Removing repository file: $file"
execute sudo rm -f "$file"
fi
done
[[ $ID == "suse" ]] && execute sudo zypper --non-interactive removerepo jriver
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring.gpg"
if [[ -f $keyfile ]]; then
echo "Removing the JRiver Media Center GPG key"
@@ -1710,7 +1715,7 @@ update() {
# If the commit hash has changed, an update occurred
if [[ "$before_pull_hash" != $(git -C "$SCRIPT_DIR" rev-parse HEAD) ]]; then
echo "Detected installJRMC update, restarting"
exec "$SCRIPT_PATH" "$@" "--no-update"
rerun "$@"
fi
else
debug "Not in the installJRMC repository, checking for installJRMC update via webscrape."
@@ -1741,7 +1746,7 @@ update() {
execute rm -f "$tmp"
echo "Detected installJRMC update, restarting"
exec "$SCRIPT_PATH" "$@" "--no-update"
rerun "$@"
else
debug "Current installJRMC $SCRIPT_VERSION is the latest version"
execute rm -f "$tmp"
@@ -1793,9 +1798,8 @@ main() {
EOF
;;
debian|ubuntu)
local major_version="${VERSION_ID%%.*}"
local minor_version="${VERSION_ID##*.}"; minor_version="${minor_version#0}" # strip leading zero
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring.gpg"
local keyurl="https://dist.jriver.com/mediacenter@jriver.com.gpg.complete"
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring-complete.gpg"
local channel="latest"
[[ -n $BETAPASS ]] && channel="beta"
@@ -1805,9 +1809,11 @@ main() {
repo_file="/etc/apt/sources.list.d/jriver.sources"
fi
echo "Installing JRiver Media Center GPG key"
download "$keyurl" "-" |
gpg --dearmor | sudo tee "$keyfile" &>/dev/null
echo "Installing repository file: $repo_file"
if [[ ($ID == "ubuntu" && $major_version -ge 24) ||
($ID == "debian" && (-z $major_version || $major_version -ge 12)) ]]; then
sudo tee "$repo_file" &>/dev/null <<-EOF
Types: deb
URIs: https://dist.jriver.com/$channel/mediacenter/
@@ -1816,16 +1822,8 @@ main() {
Components: main
Architectures: amd64 armhf arm64
EOF
else
sudo tee "$repo_file" &>/dev/null <<-EOF
deb [signed-by=$keyfile arch=amd64,armhf,arm64] https://dist.jriver.com/$channel/mediacenter/ $MC_REPO main
EOF
fi
echo "Installing JRiver Media Center GPG key"
download "https://dist.jriver.com/mediacenter@jriver.com.gpg.key" "-" |
gpg --dearmor | sudo tee "$keyfile" &>/dev/null
install_legacy_repo
add_legacy_repo
;;
*)
err "An MC repository for $ID is not yet available"
@@ -1837,9 +1835,10 @@ main() {
echo "Updating package lists"
if ! execute "${PKG_UPDATE[@]}"; then
err "Package update failed!"
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]] &&
ask_ok "Re-run installJRMC with --mcrepo=$MC_REPO_HARDCODE?"; then
exec "$SCRIPT_PATH" "$@" "--no-update" "--mcrepo=$MC_REPO_HARDCODE"
remove_legacy_repo
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]]; then
echo "Rerunning installJRMC with --mcrepo=$MC_REPO_HARDCODE"
rerun "$@" "--mcrepo=$MC_REPO_HARDCODE"
fi
return 1
fi
@@ -1847,9 +1846,13 @@ main() {
echo "Installing $MC_PKG package"
if ! install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_PKG"; then
err "MC package install failed!"
remove_legacy_repo
return 1
fi
# Clean up legacy repo after successful install
remove_legacy_repo
link_ssl_certs
restore_license
open_firewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp"
@@ -1896,6 +1899,13 @@ main() {
unknown) install_mc_generic ;;
esac
# shellcheck disable=SC2181
if [[ $? -eq 0 ]]; then
echo "Successfully installed JRiver Media Center"
else
err "MC package install failed!"
fi
link_ssl_certs
restore_license
open_firewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp"
@@ -1998,7 +2008,7 @@ create_mc_apt_container() {
CNT=$(buildah from --quiet alpine:edge) &&
buildah run --env MC_REPO="$repo" --env MC_ARCH="$MC_ARCH" --env CHANNEL="$channel" "$CNT" -- sh -c '
apk add --quiet --no-progress --no-cache apt curl gnupg
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.key | gpg --quiet --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.complete | gpg --quiet --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
Types: deb
URIs: https://dist.jriver.com/$CHANNEL/mediacenter/
@@ -2013,6 +2023,16 @@ create_mc_apt_container() {
buildah run "$CNT" -- sh -c "$cmd" || { err "$cmd failed"; return 1; }
done
}
rerun() {
debug "${FUNCNAME[0]}()" "$@"
if ((SCRIPT_IS_PIPED)); then
# Re-download and execute if script was piped
curl -fsSL "$SCRIPT_URL" | bash -s -- "$@" "--no-update"
exit $?
else
exec bash "$SCRIPT_PATH" "$@" "--no-update"
fi
}
# Roughly turn debugging on for pre-init
# Reset and reparse in parse_input() with getopt