Vertaa committeja
48 Commitit
98a10f2539
...
dev
| Tekijä | SHA1 | Päivämäärä | |
|---|---|---|---|
| e360bacd23 | |||
| b62ba38c49 | |||
| 37d3f643a5 | |||
| be9f594b25 | |||
| 5bcbc9a935 | |||
| 1f61ec4888 | |||
| 3c8ed002bb | |||
| 7ef9669dec | |||
| eb62392da7 | |||
| 60961f8415 | |||
| e087248165 | |||
| 90ea1e0fa4 | |||
| bafd812074 | |||
| 75881d5ac1 | |||
| fd6d4d872f | |||
| c96ff1ed4b | |||
| a37ae0b5f5 | |||
| b8f64b3f0c | |||
| bcde2c252b | |||
| 1f8f276258 | |||
| ce46f50cd1 | |||
| 07878d97ce | |||
| d015f70ec2 | |||
| b4a80f5ba1 | |||
| 6dcf224b8e | |||
| 5fb8e0e75f | |||
| 20e09ea15c | |||
| 2ac055e827 | |||
| 0ee91075fb | |||
| 3c7ef14aac | |||
| 71ce48626f | |||
| f564980ec6 | |||
| e040a94504 | |||
| e913d57e17 | |||
| 61d9e2f98c | |||
| 148e821fa9 | |||
| 622e5d9295 | |||
| 71defe9672 | |||
| 60cfe6a19c | |||
| c6eed2a89a | |||
| f2c8865216 | |||
| fc1956dc04 | |||
| 533106cbd7 | |||
| 89499ddac8 | |||
| e19422257d | |||
| 4683ed4c0e | |||
| 8a38cbef41 | |||
| d86b454be4 |
@@ -5,12 +5,12 @@ This program installs [url=https://www.jriver.com/]JRiver Media Center[/url] and
|
|||||||
You can find the latest version of installJRMC, changelog, and documentation in [url=https://git.bryanroessler.com/bryan/installJRMC]my repository[/url].
|
You can find the latest version of installJRMC, changelog, and documentation in [url=https://git.bryanroessler.com/bryan/installJRMC]my repository[/url].
|
||||||
|
|
||||||
[size=18pt]tl;dr (One-line MC install)[/size]
|
[size=18pt]tl;dr (One-line MC install)[/size]
|
||||||
[code]curl https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC|bash[/code]
|
[code]curl https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC|bash[/code]
|
||||||
|
|
||||||
[size=18pt]Instructions[/size]
|
[size=18pt]Instructions[/size]
|
||||||
|
|
||||||
Download and unzip installJRMC from the attachment below or grab the latest stable version directly:
|
Download and unzip installJRMC from the attachment below or grab the latest stable version directly:
|
||||||
[code]curl -O https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC &&
|
[code]curl -O https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC &&
|
||||||
chmod +x ./installJRMC &&
|
chmod +x ./installJRMC &&
|
||||||
./installJRMC [--option [ARGUMENT]]
|
./installJRMC [--option [ARGUMENT]]
|
||||||
[/code]
|
[/code]
|
||||||
@@ -31,7 +31,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
|
||||||
Specify the MC version, ex. "33", "34.0.71", or "34.0.71-1" (default: latest).
|
Specify the MC version, ex. "33", "35.0.24", or "35.0.24-1" (default: latest).
|
||||||
--arch ARCH
|
--arch ARCH
|
||||||
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture).
|
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture).
|
||||||
--mcrepo REPO
|
--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.
|
Install a more widely-compatible version of the latest MC version.
|
||||||
[code]installJRMC --install repo --service jriver-mediacenter --service-type user[/code]
|
[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.
|
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 34.0.71[/code]
|
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.24[/code]
|
||||||
Build and install an MC 34.0.71 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
|
Build and install an MC 35.0.24 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]
|
[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.
|
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]
|
[code]installJRMC --service jriver-createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -1,6 +1,6 @@
|
|||||||
# installJRMC
|
# installJRMC
|
||||||
|
|
||||||
Install [JRiver Media Center](https://www.jriver.com/) and associated services on most Linux distributions.
|
Installs [JRiver Media Center](https://www.jriver.com/) and associated services on most Linux distributions.
|
||||||
|
|
||||||
You can find the latest version of installJRMC, changelog, and documentation in [my repository](https://git.bryanroessler.com/bryan/installJRMC).
|
You can find the latest version of installJRMC, changelog, and documentation in [my repository](https://git.bryanroessler.com/bryan/installJRMC).
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ Specifying `--build`, `--createrepo`, `--service`, or `--uninstall` disables the
|
|||||||
|
|
||||||
### tl;dr
|
### tl;dr
|
||||||
|
|
||||||
`curl https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC|bash`
|
`curl https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC|bash`
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
@@ -28,7 +28,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. "34.0.71" or "33" (default: latest).
|
Build or install a specific MC version, ex. "35.0.24" 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
|
||||||
@@ -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.
|
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 34.0.71`
|
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.24`
|
||||||
|
|
||||||
Build and install an MC 34.0.71 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
|
Build and install an MC 35.0.24 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
|
||||||
|
|
||||||
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
||||||
|
|
||||||
|
|||||||
175
installJRMC
175
installJRMC
@@ -21,12 +21,12 @@
|
|||||||
# shellcheck disable=SC2329
|
# shellcheck disable=SC2329
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
|
|
||||||
declare -g SCRIPT_VERSION="1.34.9"
|
declare -g SCRIPT_VERSION="1.35.6-dev"
|
||||||
declare -g MC_VERSION_HARDCODE="34.0.71" # do find all replace
|
declare -g MC_VERSION_HARDCODE="35.0.24" # do find all replace
|
||||||
declare -g MC_REPO_HARDCODE="bookworm" # should match the MC_VERSION_HARDCODE
|
declare -g MC_REPO_HARDCODE="bookworm" # should match the MC_VERSION_HARDCODE
|
||||||
declare -g BOARD_ID="89.0" # MC34 board ID for automatic version detection
|
declare -g BOARD_ID="92.0" # MC35 board ID for legacy latest version detection
|
||||||
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
||||||
declare -g SCRIPT_URL="https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC" # self-update URL
|
declare -g SCRIPT_URL="https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC" # self-update URL
|
||||||
# declare -g SCRIPT_URL="https://raw.githubusercontent.com/cryobry/installJRMC/refs/heads/master/installJRMC" # backup URL
|
# declare -g SCRIPT_URL="https://raw.githubusercontent.com/cryobry/installJRMC/refs/heads/master/installJRMC" # backup URL
|
||||||
declare -gi DEBUG=${DEBUG:-0} # set default debug and allow DEBUG env override (default: disabled)
|
declare -gi DEBUG=${DEBUG:-0} # set default debug and allow DEBUG env override (default: disabled)
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ parse_input() {
|
|||||||
--install|-i) shift;
|
--install|-i) shift;
|
||||||
case $1 in
|
case $1 in
|
||||||
local|rpm|deb) BUILD_SWITCH=1 LOCAL_INSTALL_SWITCH=1 ;;
|
local|rpm|deb) BUILD_SWITCH=1 LOCAL_INSTALL_SWITCH=1 ;;
|
||||||
repo|remote) REPO_INSTALL_SWITCH=1 ;;
|
repo|remote|""|-*) REPO_INSTALL_SWITCH=1 ;;
|
||||||
container) CONTAINER_INSTALL_SWITCH=1 ;;
|
container) CONTAINER_INSTALL_SWITCH=1 ;;
|
||||||
snap) SNAP_INSTALL_SWITCH=1 ;;
|
snap) SNAP_INSTALL_SWITCH=1 ;;
|
||||||
appimage) APPIMAGE_INSTALL_SWITCH=1 ;;
|
appimage) APPIMAGE_INSTALL_SWITCH=1 ;;
|
||||||
@@ -159,7 +159,8 @@ parse_input() {
|
|||||||
|
|
||||||
# Set major version defaults
|
# Set major version defaults
|
||||||
case "$MC_MVERSION_USER" in
|
case "$MC_MVERSION_USER" in
|
||||||
34) MC_REPO_HARDCODE="bookworm" BOARD_ID="89.0" ;; # fallback to hardcoded version if full version not provided
|
35) MC_REPO_HARDCODE="bookworm" BOARD_ID="92.0" ;; # fallback to hardcoded version if full version not provided
|
||||||
|
34) MC_VERSION_USER="${MC_VERSION_USER:-34.0.75}" MC_REPO_HARDCODE="bookworm" BOARD_ID="89.0" ;;
|
||||||
33) MC_VERSION_USER="${MC_VERSION_USER:-33.0.72}" MC_REPO_HARDCODE="bullseye" BOARD_ID="86.0" ;;
|
33) MC_VERSION_USER="${MC_VERSION_USER:-33.0.72}" MC_REPO_HARDCODE="bullseye" BOARD_ID="86.0" ;;
|
||||||
32) MC_VERSION_USER="${MC_VERSION_USER:-32.0.58}" MC_REPO_HARDCODE="bullseye" BOARD_ID="83.0" ;;
|
32) MC_VERSION_USER="${MC_VERSION_USER:-32.0.58}" MC_REPO_HARDCODE="bullseye" BOARD_ID="83.0" ;;
|
||||||
31) MC_VERSION_USER="${MC_VERSION_USER:-31.0.83}" MC_REPO_HARDCODE="bullseye" BOARD_ID="80.0" ;;
|
31) MC_VERSION_USER="${MC_VERSION_USER:-31.0.83}" MC_REPO_HARDCODE="bullseye" BOARD_ID="80.0" ;;
|
||||||
@@ -173,8 +174,14 @@ parse_input() {
|
|||||||
23) MC_VERSION_USER="${MC_VERSION_USER:-23.0.104}" MC_REPO_HARDCODE="jessie" BOARD_ID="54.0" ;;
|
23) MC_VERSION_USER="${MC_VERSION_USER:-23.0.104}" MC_REPO_HARDCODE="jessie" BOARD_ID="54.0" ;;
|
||||||
22) MC_VERSION_USER="${MC_VERSION_USER:-22.0.102}" MC_REPO_HARDCODE="jessie" BOARD_ID="51.0" ;;
|
22) MC_VERSION_USER="${MC_VERSION_USER:-22.0.102}" MC_REPO_HARDCODE="jessie" BOARD_ID="51.0" ;;
|
||||||
21) MC_VERSION_USER="${MC_VERSION_USER:-21.0.90}" MC_REPO_HARDCODE="jessie" BOARD_ID="44.0" ;;
|
21) MC_VERSION_USER="${MC_VERSION_USER:-21.0.90}" MC_REPO_HARDCODE="jessie" BOARD_ID="44.0" ;;
|
||||||
20) MC_VERSION_USER="${MC_VERSION_USER:-20.0.131}" MC_REPO_HARDCODE="jessie" BOARD_ID="35.0";;
|
20) MC_VERSION_USER="${MC_VERSION_USER:-20.0.131}" MC_REPO_HARDCODE="jessie" BOARD_ID="35.0" ;;
|
||||||
*) err "Bad --mcversion"; print_help; exit 1 ;;
|
*)
|
||||||
|
# Warn for future major beta versions
|
||||||
|
if [[ $MC_MVERSION_USER -gt ${MC_VERSION_HARDCODE%%.*} ]] && [[ -z $MC_VERSION_USER ]]; then
|
||||||
|
echo "For future major versions, supply full version (and --betapass if necessary)."
|
||||||
|
err "Bad --mcversion"; print_help; exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
err "Bad --mcversion"; print_help; exit 1
|
err "Bad --mcversion"; print_help; exit 1
|
||||||
@@ -290,21 +297,21 @@ init() {
|
|||||||
raspbian) ID="debian" ;;
|
raspbian) ID="debian" ;;
|
||||||
*mandriva*) ID="mandriva"
|
*mandriva*) ID="mandriva"
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
debug "Automatically using --install=local for Mandriva"
|
debug "Automatically using --install=local for Mandriva."
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
LOCAL_INSTALL_SWITCH=1
|
LOCAL_INSTALL_SWITCH=1
|
||||||
fi ;;
|
fi ;;
|
||||||
manjaro|arch|cachyos) ID="arch"
|
manjaro|arch|cachyos) ID="arch"
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
debug "Automatically using --install=local for Arch"
|
debug "Automatically using --install=local for Arch."
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
LOCAL_INSTALL_SWITCH=1
|
LOCAL_INSTALL_SWITCH=1
|
||||||
fi ;;
|
fi ;;
|
||||||
*suse*) ID="suse"
|
*suse*) ID="suse"
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
debug "Automatically using --install=local for SUSE"
|
debug "Automatically using --install=local for SUSE."
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
LOCAL_INSTALL_SWITCH=1
|
LOCAL_INSTALL_SWITCH=1
|
||||||
@@ -341,31 +348,31 @@ init() {
|
|||||||
fedora|centos|mandriva)
|
fedora|centos|mandriva)
|
||||||
local rpm_mgr
|
local rpm_mgr
|
||||||
rpm_mgr=$(command -v dnf &>/dev/null && echo "dnf" || echo "yum")
|
rpm_mgr=$(command -v dnf &>/dev/null && echo "dnf" || echo "yum")
|
||||||
PKG_INSTALL=(sudo "$rpm_mgr" install -y)
|
PKG_INSTALL=(sudo "$rpm_mgr" install --assumeyes)
|
||||||
PKG_REMOVE=(sudo "$rpm_mgr" remove -y)
|
PKG_REMOVE=(sudo "$rpm_mgr" remove --assumeyes)
|
||||||
PKG_UPDATE=(sudo "$rpm_mgr" makecache)
|
PKG_UPDATE=(sudo "$rpm_mgr" makecache --assumeyes)
|
||||||
PKG_QUERY=(rpm -q)
|
PKG_QUERY=(rpm -q)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
||||||
;;
|
;;
|
||||||
debian|ubuntu)
|
debian|ubuntu)
|
||||||
PKG_INSTALL=(sudo apt-get -f install --install-recommends -y -q0)
|
PKG_INSTALL=(sudo apt-get install --fix-broken --install-recommends --assume-yes)
|
||||||
PKG_REMOVE=(sudo apt-get remove --auto-remove -y -q0)
|
PKG_REMOVE=(sudo apt-get remove --auto-remove --assume-yes)
|
||||||
PKG_UPDATE=(sudo apt-get update -y -q0)
|
PKG_UPDATE=(sudo apt-get update --assume-yes)
|
||||||
PKG_QUERY=(dpkg -s)
|
PKG_QUERY=(dpkg -s)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_deb "$@"; }
|
PKG_INSTALL_LOCAL() { install_mc_deb "$@"; }
|
||||||
;;
|
;;
|
||||||
suse)
|
suse)
|
||||||
PKG_INSTALL=(sudo zypper --gpg-auto-import-keys --non-interactive --quiet install --force --force-resolution --replacefiles --no-confirm)
|
PKG_INSTALL=(sudo zypper --gpg-auto-import-keys --non-interactive install --force --force-resolution --replacefiles --no-confirm)
|
||||||
PKG_REMOVE=(sudo zypper --non-interactive --quiet remove --clean-deps)
|
PKG_REMOVE=(sudo zypper --non-interactive remove --clean-deps)
|
||||||
PKG_UPDATE=(sudo zypper --non-interactive --quiet refresh jriver)
|
PKG_UPDATE=(sudo zypper --non-interactive refresh jriver)
|
||||||
PKG_QUERY=(rpm -q)
|
PKG_QUERY=(rpm --query)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
||||||
;;
|
;;
|
||||||
arch)
|
arch)
|
||||||
PKG_INSTALL=(sudo pacman -Sy --noconfirm)
|
PKG_INSTALL=(sudo pacman --sync --refresh --noconfirm)
|
||||||
PKG_REMOVE=(sudo pacman -Rs --noconfirm)
|
PKG_REMOVE=(sudo pacman --remove --recursive --noconfirm)
|
||||||
PKG_UPDATE=(sudo pacman -Syy)
|
PKG_UPDATE=(sudo pacman --sync --refresh --refresh)
|
||||||
PKG_QUERY=(sudo pacman -Qs)
|
PKG_QUERY=(sudo pacman --query --search)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_arch; }
|
PKG_INSTALL_LOCAL() { install_mc_arch; }
|
||||||
;;
|
;;
|
||||||
unknown)
|
unknown)
|
||||||
@@ -434,8 +441,8 @@ set_mc_version() {
|
|||||||
# Determine latest version
|
# Determine latest version
|
||||||
# Containerized package manager
|
# Containerized package manager
|
||||||
if create_mc_apt_container &&
|
if create_mc_apt_container &&
|
||||||
MC_VERSION=$(sudo buildah run "$CNT" -- apt-cache policy "mediacenter${MC_MVERSION_USER:-${MC_VERSION_HARDCODE%%.*}}" | awk '/Candidate:/ {sub(/-.*/, "", $2); print $2}' | sort -V | tail -n1) &&
|
MC_VERSION=$(buildah run "$CNT" -- apt-cache policy "mediacenter${MC_MVERSION_USER:-${MC_VERSION_HARDCODE%%.*}}" | awk '/Candidate:/ {sub(/-.*/, "", $2); print $2}' | sort -V | tail -n1) &&
|
||||||
execute sudo buildah rm "$CNT" &&
|
buildah rm "$CNT" &>/dev/null &&
|
||||||
[[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
[[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
MC_VERSION_SOURCE="containerized package manager"
|
MC_VERSION_SOURCE="containerized package manager"
|
||||||
# Fallback to webscrape
|
# Fallback to webscrape
|
||||||
@@ -522,15 +529,13 @@ install_package() {
|
|||||||
((allow_downgrades)) && install_flags+=(--allowerasing)
|
((allow_downgrades)) && install_flags+=(--allowerasing)
|
||||||
((no_gpg_check)) && install_flags+=(--nogpgcheck)
|
((no_gpg_check)) && install_flags+=(--nogpgcheck)
|
||||||
((refresh)) && install_flags+=(--refresh)
|
((refresh)) && install_flags+=(--refresh)
|
||||||
# Only add reinstall flag for mediacenter package
|
|
||||||
if ((reinstall)) && [[ ${#pkg_array[@]} -eq 1 ]] && "${PKG_QUERY[@]}" "mediacenter$MC_MVERSION" &>/dev/null; then
|
|
||||||
pkg_install=("${pkg_install[@]/install/reinstall}")
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
suse)
|
suse)
|
||||||
((no_gpg_check)) && install_flags+=(--allow-unsigned-rpm) ;;
|
((no_gpg_check)) && install_flags+=(--allow-unsigned-rpm) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
((silent)) && install_flags+=(--quiet)
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
if [[ ${#pkg_array[@]} -gt 0 ]]; then
|
if [[ ${#pkg_array[@]} -gt 0 ]]; then
|
||||||
if ! execute "${pkg_install[@]}" "${install_flags[@]}" "${pkg_array[@]}"; then
|
if ! execute "${pkg_install[@]}" "${install_flags[@]}" "${pkg_array[@]}"; then
|
||||||
@@ -626,9 +631,10 @@ install_mc_repo() {
|
|||||||
repo_file="/etc/yum.repos.d/jriver.repo"
|
repo_file="/etc/yum.repos.d/jriver.repo"
|
||||||
read -r -d '' repo_text <<-EOF
|
read -r -d '' repo_text <<-EOF
|
||||||
[jriver]
|
[jriver]
|
||||||
name=JRiver Media Center by BryanC
|
baseurl = https://repos.bryanroessler.com/jriver
|
||||||
baseurl=https://repos.bryanroessler.com/jriver
|
enabled = 1
|
||||||
gpgcheck=0
|
gpgcheck = 0
|
||||||
|
name = JRiver Media Center by BryanC
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
debian|ubuntu)
|
debian|ubuntu)
|
||||||
@@ -698,7 +704,16 @@ install_mc_repo() {
|
|||||||
err "Failed to add temporary repository"
|
err "Failed to add temporary repository"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; }
|
|
||||||
|
# Update 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"
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Installing $MC_PKG package"
|
echo "Installing $MC_PKG package"
|
||||||
if ! install_package \
|
if ! install_package \
|
||||||
@@ -725,7 +740,7 @@ install_mc_repo() {
|
|||||||
acquire_deb() {
|
acquire_deb() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
declare -g MC_DEB MC_SOURCE
|
declare -g MC_DEB MC_SOURCE
|
||||||
local fname mnt
|
local fname
|
||||||
|
|
||||||
[[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES"
|
[[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES"
|
||||||
|
|
||||||
@@ -740,10 +755,10 @@ acquire_deb() {
|
|||||||
MC_DEB="$OUTPUT_DIR/SOURCES/$fname"
|
MC_DEB="$OUTPUT_DIR/SOURCES/$fname"
|
||||||
MC_SOURCE="https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname"
|
MC_SOURCE="https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname"
|
||||||
|
|
||||||
# If deb file already exists, skip download
|
# If deb file already exists and is >30MB, skip download
|
||||||
if [[ -f $MC_DEB ]]; then
|
if [[ -f $MC_DEB ]]; then
|
||||||
if [[ $(stat -c%s "$MC_DEB") -lt 10000000 ]]; then
|
if [[ $(stat -c%s "$MC_DEB") -lt 30000000 ]]; then
|
||||||
echo "Removing existing DEB under 10MB: $MC_DEB"
|
echo "Removing existing DEB under 30MB: $MC_DEB"
|
||||||
execute rm -f "$MC_DEB"
|
execute rm -f "$MC_DEB"
|
||||||
else
|
else
|
||||||
echo "Using existing DEB: $MC_DEB"
|
echo "Using existing DEB: $MC_DEB"
|
||||||
@@ -752,12 +767,18 @@ acquire_deb() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Download the deb file using the containerized package manager
|
# Download the deb file using the containerized package manager
|
||||||
if ! { create_mc_apt_container "apt-get download --allow-unauthenticated mediacenter$MC_MVERSION &>/dev/null" &&
|
# shellcheck disable=SC2016
|
||||||
mnt="$(sudo buildah mount "$CNT")" &&
|
if ! {
|
||||||
execute sudo find "$mnt" -maxdepth 1 -type f -name "*.deb" -exec cp {} "$MC_DEB" \; &&
|
# Download to /tmp to silence _apt permission warnings
|
||||||
[[ -f $MC_DEB ]] &&
|
create_mc_apt_container "cd /tmp && apt-get download --allow-unauthenticated mediacenter$MC_MVERSION -qq" &&
|
||||||
execute sudo buildah umount "$CNT" &&
|
env CNT="$CNT" MC_DEB="$MC_DEB" buildah unshare -- bash -eu -o pipefail -c '
|
||||||
execute sudo buildah rm "$CNT"; }; then
|
mnt="$(buildah mount "$CNT")"
|
||||||
|
deb="$(find "$mnt/tmp" -maxdepth 1 -type f -name "*.deb" | head -n1)"
|
||||||
|
[[ -n "$deb" ]] && cp -f "$deb" "$MC_DEB"
|
||||||
|
buildah umount "$CNT"' &&
|
||||||
|
[[ -f $MC_DEB ]] &&
|
||||||
|
buildah rm "$CNT" &>/dev/null;
|
||||||
|
}; then
|
||||||
debug "Failed to download DEB using containerized package manager"
|
debug "Failed to download DEB using containerized package manager"
|
||||||
echo "Using legacy download method"
|
echo "Using legacy download method"
|
||||||
# Define the repository search order
|
# Define the repository search order
|
||||||
@@ -925,8 +946,7 @@ translate_packages() {
|
|||||||
recommends_arr=('mesa-libgl' 'nvidia-libgl' 'nvidia-utils' 'vulkan-intel'
|
recommends_arr=('mesa-libgl' 'nvidia-libgl' 'nvidia-utils' 'vulkan-intel'
|
||||||
'vulkan-radeon' 'vorbis-tools' 'musepack-tools')
|
'vulkan-radeon' 'vorbis-tools' 'musepack-tools')
|
||||||
;;
|
;;
|
||||||
*)
|
*) echo "Skipping package translations for $ID" ;;
|
||||||
echo "Skipping package translations for $ID"
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -973,32 +993,31 @@ build_rpm() {
|
|||||||
|
|
||||||
# Create spec file
|
# Create spec file
|
||||||
cat <<-EOF > "$spec_file"
|
cat <<-EOF > "$spec_file"
|
||||||
Name: mediacenter$MC_MVERSION
|
Name: mediacenter$MC_MVERSION
|
||||||
Version: $MC_VERSION
|
Version: $MC_VERSION
|
||||||
Release: $MC_RELEASE
|
Release: $MC_RELEASE
|
||||||
Summary: JRiver Media Center
|
Summary: JRiver Media Center
|
||||||
Group: Applications/Media
|
Group: Applications/Media
|
||||||
|
License: LicenseRef-JRiver-Proprietary
|
||||||
|
URL: https://www.jriver.com/
|
||||||
Source0: $MC_SOURCE
|
Source0: $MC_SOURCE
|
||||||
%define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}-%%{release}.%%{ARCH}.rpm
|
|
||||||
|
|
||||||
AutoReq: 0
|
BuildArch: $ARCH
|
||||||
|
|
||||||
|
%global _rpmfilename %%{ARCH}/%%{NAME}-%%{version}-%%{release}.%%{ARCH}.rpm
|
||||||
|
|
||||||
|
AutoReqProv: no
|
||||||
|
|
||||||
$requires_str
|
$requires_str
|
||||||
$recommends_str
|
$recommends_str
|
||||||
|
|
||||||
Conflicts: MediaCenter
|
|
||||||
|
|
||||||
Provides: mediacenter$MC_MVERSION
|
Provides: mediacenter$MC_MVERSION
|
||||||
|
|
||||||
License: Copyright 1998-$(date +%Y), JRiver, Inc. All rights reserved. Protected by U.S. patents #7076468 and #7062468
|
|
||||||
URL: https://www.jriver.com/
|
|
||||||
|
|
||||||
%define __provides_exclude_from ^%{_libdir}/jriver/.*/.*\\.so.*$
|
%define __provides_exclude_from ^%{_libdir}/jriver/.*/.*\\.so.*$
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Media Center is more than a world class player.
|
Media Center is more than a world class player.
|
||||||
|
|
||||||
%global __os_install_post %{nil}
|
|
||||||
%prep
|
%prep
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@@ -1006,9 +1025,6 @@ build_rpm() {
|
|||||||
%install
|
%install
|
||||||
dpkg -x %{S:0} %{buildroot}
|
dpkg -x %{S:0} %{buildroot}
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
|
||||||
%postun -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_bindir}/mediacenter$MC_MVERSION
|
%{_bindir}/mediacenter$MC_MVERSION
|
||||||
$stub
|
$stub
|
||||||
@@ -1028,6 +1044,8 @@ build_rpm() {
|
|||||||
-bb
|
-bb
|
||||||
"$spec_file"
|
"$spec_file"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Run rpmbuild and verify output RPM exists
|
||||||
execute "${rpmbuild_cmd[@]}" && [[ -f $MC_RPM ]]
|
execute "${rpmbuild_cmd[@]}" && [[ -f $MC_RPM ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1115,7 +1133,7 @@ install_mc_deb() {
|
|||||||
--reinstall \
|
--reinstall \
|
||||||
"$temp_deb"; then
|
"$temp_deb"; then
|
||||||
err "Local MC DEB installation failed"
|
err "Local MC DEB installation failed"
|
||||||
if ask_ok "Remove source DEB and retry"; then
|
if ask_ok "Remove source DEB and retry?"; then
|
||||||
execute sudo rm -f "$MC_DEB" "$temp_deb"
|
execute sudo rm -f "$MC_DEB" "$temp_deb"
|
||||||
exec "$SCRIPT_PATH" "$@" "--no-update"
|
exec "$SCRIPT_PATH" "$@" "--no-update"
|
||||||
fi
|
fi
|
||||||
@@ -1131,7 +1149,7 @@ install_mc_deb() {
|
|||||||
# @description Installs MC via RPM package
|
# @description Installs MC via RPM package
|
||||||
install_mc_rpm() {
|
install_mc_rpm() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
install_package --no-install-check --no-gpg-check --allow-downgrades --reinstall "$MC_RPM"
|
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Installs Media Center generically for unsupported OSes
|
# @description Installs Media Center generically for unsupported OSes
|
||||||
@@ -1212,10 +1230,10 @@ run_createrepo() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run createrepo
|
# Run createrepo
|
||||||
local -a cr_opts=(-q "$CREATEREPO_WEBROOT")
|
local -a cr_opts=(--update)
|
||||||
# [[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_opts+=(--update) # TODO temporarily disabled for legacy createrepo
|
# [[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_opts+=(--update) # TODO temporarily disabled for legacy createrepo
|
||||||
if ! execute sudo -u "$CREATEREPO_USER" createrepo "${cr_opts[@]}"; then
|
if ! execute sudo -u "$CREATEREPO_USER" createrepo "${cr_opts[@]}" "$CREATEREPO_WEBROOT"; then
|
||||||
if ! (execute sudo createrepo "${cr_opts[@]}" && execute sudo chown -R "$CREATEREPO_USER:$CREATEREPO_USER" "$CREATEREPO_WEBROOT"); then
|
if ! (execute sudo createrepo "${cr_opts[@]}" "$CREATEREPO_WEBROOT" && execute sudo chown -R "$CREATEREPO_USER:$CREATEREPO_USER" "$CREATEREPO_WEBROOT"); then
|
||||||
err "createrepo failed"
|
err "createrepo failed"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -1651,7 +1669,7 @@ uninstall() {
|
|||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
local service type unit f
|
local service type unit f
|
||||||
|
|
||||||
if ! ask_ok "Do you really want to uninstall JRiver Media Center?"; then
|
if ! ask_ok "Uninstall JRiver Media Center, services, and firewall rules?"; then
|
||||||
echo "Uninstall cancelled"
|
echo "Uninstall cancelled"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -1856,7 +1874,7 @@ main() {
|
|||||||
|
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
echo "Installing JRiver Media Center from remote repository"
|
echo "Installing JRiver Media Center from remote repository"
|
||||||
if install_mc_repo; then
|
if install_mc_repo "$@"; then
|
||||||
echo "JRiver Media Center installed successfully from remote repository"
|
echo "JRiver Media Center installed successfully from remote repository"
|
||||||
install_mesa_freeworld
|
install_mesa_freeworld
|
||||||
link_ssl_certs
|
link_ssl_certs
|
||||||
@@ -1973,14 +1991,14 @@ download() {
|
|||||||
local url="$1"
|
local url="$1"
|
||||||
local output="${2:-}"
|
local output="${2:-}"
|
||||||
local -a cmd
|
local -a cmd
|
||||||
if command -v curl &>/dev/null || install_package --silent curl; then
|
if command -v curl &>/dev/null || install_package curl; then
|
||||||
cmd=(curl --silent --fail --location)
|
cmd=(curl --silent --fail --location)
|
||||||
if [[ -n "$output" ]]; then
|
if [[ -n "$output" ]]; then
|
||||||
cmd+=(--output "$output")
|
cmd+=(--output "$output")
|
||||||
else
|
else
|
||||||
cmd+=(--remote-name)
|
cmd+=(--remote-name)
|
||||||
fi
|
fi
|
||||||
elif command -v wget &>/dev/null || install_package --silent wget; then
|
elif command -v wget &>/dev/null || install_package wget; then
|
||||||
cmd=(wget --quiet)
|
cmd=(wget --quiet)
|
||||||
[[ -n "$output" ]] && cmd+=("--output-document=$output")
|
[[ -n "$output" ]] && cmd+=("--output-document=$output")
|
||||||
else
|
else
|
||||||
@@ -1994,23 +2012,24 @@ create_mc_apt_container() {
|
|||||||
debug "${FUNCNAME[0]}()" "$@"
|
debug "${FUNCNAME[0]}()" "$@"
|
||||||
declare -g CNT
|
declare -g CNT
|
||||||
local -a cmds=("$@")
|
local -a cmds=("$@")
|
||||||
{ command -v buildah &>/dev/null || install_package buildah &>/dev/null; } &&
|
# shellcheck disable=SC2016
|
||||||
CNT=$(sudo buildah from --quiet alpine:edge) &&
|
{ command -v buildah &>/dev/null || install_package buildah; } &&
|
||||||
sudo buildah run "$CNT" -- sh -c '
|
CNT=$(buildah from --quiet alpine:edge) &&
|
||||||
apk add --no-cache apt curl gnupg &>/dev/null
|
buildah run --env MC_REPO="$MC_REPO" --env MC_ARCH="$MC_ARCH" "$CNT" -- sh -c '
|
||||||
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.key | gpg --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg &>/dev/null
|
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
|
||||||
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
|
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://dist.jriver.com/latest/mediacenter/
|
URIs: https://dist.jriver.com/latest/mediacenter/
|
||||||
Signed-By: /usr/share/keyrings/jriver-com-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/jriver-com-archive-keyring.gpg
|
||||||
Suites: '"$MC_REPO"'
|
Suites: $MC_REPO
|
||||||
Components: main
|
Components: main
|
||||||
Architectures: '"$MC_ARCH"'
|
Architectures: $MC_ARCH
|
||||||
EOF
|
EOF
|
||||||
apt-get update &>/dev/null' &&
|
apt-get update -qq' &&
|
||||||
# If user passes command strings run them in the container
|
# If user passes command strings run them in the container
|
||||||
for cmd in "${cmds[@]}"; do
|
for cmd in "${cmds[@]}"; do
|
||||||
sudo buildah run "$CNT" -- sh -c "$cmd" || { err "$cmd failed"; return 1; }
|
buildah run "$CNT" -- sh -c "$cmd" || { err "$cmd failed"; return 1; }
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
add_temp_repo() {
|
add_temp_repo() {
|
||||||
|
|||||||
Viittaa uudesa ongelmassa
Block a user