Compare commits
11 Commits
3aa6fe8028
...
60603c087d
| Author | SHA1 | Date | |
|---|---|---|---|
| 60603c087d | |||
| dc15e79942 | |||
| 239668490e | |||
| fcd270c916 | |||
| 0d7c2d0949 | |||
| 024581fd55 | |||
| d961b4027f | |||
| f54273a745 | |||
| 952560310a | |||
| 9dd5c94c6f | |||
| 5b35399e1c |
13
.gitignore
vendored
13
.gitignore
vendored
@@ -1,10 +1,3 @@
|
||||
**/
|
||||
*.zip
|
||||
testing.sh
|
||||
.lock
|
||||
tests
|
||||
mwe*
|
||||
test*
|
||||
container*
|
||||
Containerfile
|
||||
README.bbcode
|
||||
.old/
|
||||
.vscode/
|
||||
README.bbcode
|
||||
|
||||
@@ -27,7 +27,7 @@ $ installJRMC --help
|
||||
--compat
|
||||
Build/install MC without minimum dependency version requirements
|
||||
--mcversion VERSION
|
||||
Build or install a specific MC version, ex. "33.0.15" (default: latest version)
|
||||
Build or install a specific MC version, ex. "33.0.20" (default: latest version)
|
||||
--mcrepo REPO
|
||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
|
||||
--arch ARCH
|
||||
@@ -118,9 +118,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 33.0.15`
|
||||
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 33.0.20`
|
||||
|
||||
Build and install an MC 33.0.15 comptability RPM locally and activate it using the `/path/to/license.mjr`
|
||||
Build and install an MC 33.0.20 comptability RPM locally and activate it using the `/path/to/license.mjr`
|
||||
|
||||
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
||||
|
||||
|
||||
66
installJRMC
66
installJRMC
@@ -16,9 +16,9 @@
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
declare -g SCRIPT_VERSION="1.3.2"
|
||||
declare -g SCRIPT_VERSION="1.3.3"
|
||||
declare -g BOARD_URL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33
|
||||
declare -g MC_VERSION="33.0.15" # Do find all replace
|
||||
declare -g MC_VERSION="33.0.20" # Do find all replace
|
||||
declare -g MC_DEFAULT_REPO="bullseye" # should match the MC_VERSION
|
||||
declare -ig SELF_UPDATE=1
|
||||
|
||||
@@ -139,7 +139,7 @@ init() {
|
||||
(( EUID == 0 )) && err "Running as root user"
|
||||
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
source "/etc/os-release"
|
||||
source /etc/os-release
|
||||
else
|
||||
err "/etc/os-release not found"
|
||||
err "Your OS is unsupported"
|
||||
@@ -156,6 +156,10 @@ init() {
|
||||
|
||||
debug "Detected host platform: $ID $VERSION_ID $ARCH"
|
||||
|
||||
# Set defaults
|
||||
BUILD_TARGET="${BUILD_TARGET:-$ID}"
|
||||
REPO_TARGET="${REPO_TARGET:-$ID}"
|
||||
|
||||
# Normalize ID and set distro-specific vars
|
||||
case $ID in
|
||||
debian|arch) ;;
|
||||
@@ -228,7 +232,7 @@ init() {
|
||||
PKG_REMOVE=(execute sudo zypper --non-interactive --quiet remove --clean-deps)
|
||||
PKG_UPDATE=(execute sudo zypper --non-interactive --quiet refresh jriver)
|
||||
PKG_QUERY=(rpm -q)
|
||||
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
||||
PKG_INSTALL_LOCAL() { install_mc_suse; }
|
||||
;;
|
||||
arch)
|
||||
PKG_INSTALL=(execute sudo pacman -Sy --noconfirm)
|
||||
@@ -256,21 +260,15 @@ parse_input() {
|
||||
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH LOCAL_INSTALL_SWITCH \
|
||||
COMPAT_SWITCH TEST_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH \
|
||||
YES_SWITCH USER_MC_VERSION MJR_RESTORE_FILE BETAPASS SERVICE_TYPE \
|
||||
VNCPASS USER_DISPLAY MC_REPO
|
||||
VNCPASS USER_DISPLAY MC_REPO BUILD_TARGET REPO_TARGET
|
||||
declare -ga SERVICES CONTAINERS
|
||||
local long_opts short_opts input
|
||||
|
||||
# Defaults
|
||||
declare -g \
|
||||
BUILD_TARGET="$ID" \
|
||||
REPO_TARGET="$ID" \
|
||||
CREATEREPO_USER="$USER" \
|
||||
OUTPUT_DIR="$SCRIPT_DIR/output" \
|
||||
CREATEREPO_WEBROOT="/var/www/jriver" \
|
||||
USER="${SUDO_USER:-$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 -g CREATEREPO_USER="$USER"
|
||||
declare -g OUTPUT_DIR="$SCRIPT_DIR/output"
|
||||
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
||||
declare -g USER="${SUDO_USER:-$USER}"
|
||||
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
|
||||
|
||||
# Set some defaults if zero or one arguments are passed
|
||||
@@ -653,27 +651,33 @@ install_mc_repo() {
|
||||
acquire_deb() {
|
||||
debug "Running: ${FUNCNAME[0]}"
|
||||
|
||||
declare -g MC_DEB="$OUTPUT_DIR/SOURCES/MediaCenter-$MC_VERSION-$ARCH.deb"
|
||||
local fname="MediaCenter-$MC_VERSION-$ARCH.deb"
|
||||
declare -g MC_DEB="$OUTPUT_DIR/SOURCES/$fname"
|
||||
|
||||
debug "MC_DEB=$MC_DEB"
|
||||
|
||||
# If deb file already exists, skip download
|
||||
if [[ -f $MC_DEB ]]; then
|
||||
echo "Using existing DEB: $MC_DEB"
|
||||
if [[ $(stat -c%s "$MC_DEB") -lt 10000000 ]]; then
|
||||
echo "Removing existing DEB under 10MB: $MC_DEB"
|
||||
execute rm "$MC_DEB"
|
||||
else
|
||||
echo "Using existing DEB: $MC_DEB"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Define the repositories to check
|
||||
local repos=(
|
||||
"beta/$BETAPASS"
|
||||
"latest"
|
||||
"test"
|
||||
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname"
|
||||
"https://files.jriver-cdn.com/mediacenter/test/$fname"
|
||||
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/beta/$BETAPASS/$fname"
|
||||
)
|
||||
|
||||
# Loop through the repositories and attempt to download
|
||||
for repo in "${repos[@]}"; do
|
||||
echo "Checking $repo repo for DEB package"
|
||||
if execute wget --quiet --output-document "$MC_DEB" \
|
||||
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_VERSION/$repo/MediaCenter-$MC_VERSION-$ARCH.deb"; then
|
||||
echo "Checking $repo for DEB package"
|
||||
if execute wget --quiet --output-document "$MC_DEB" "$repo"; then
|
||||
echo "Found!"
|
||||
break
|
||||
fi
|
||||
@@ -906,6 +910,16 @@ install_mc_rpm() {
|
||||
}
|
||||
|
||||
|
||||
#######################################
|
||||
# Installs Media Center RPM package on SUSE
|
||||
#######################################
|
||||
install_mc_suse() {
|
||||
debug "Running: ${FUNCNAME[0]}"
|
||||
|
||||
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
|
||||
}
|
||||
|
||||
|
||||
#######################################
|
||||
# Installs Media Center manually
|
||||
#######################################
|
||||
@@ -914,7 +928,7 @@ install_mc_generic() {
|
||||
|
||||
local -a raw_files
|
||||
|
||||
echo "Using generic installation method!"
|
||||
echo "Using generic installation method"
|
||||
|
||||
declare extract_dir && extract_dir="$(mktemp -d)"
|
||||
pushd "$extract_dir" &>/dev/null || return
|
||||
@@ -1728,8 +1742,8 @@ main() {
|
||||
install_package "wget"
|
||||
[[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES"
|
||||
acquire_deb || { err "Could not download Media Center DEB package"; return 1; }
|
||||
if [[ $BUILD_TARGET =~ (centos|fedora|suse) \
|
||||
|| $REPO_TARGET =~ (centos|fedora|suse) ]]; then
|
||||
|
||||
if [[ $BUILD_TARGET =~ (centos|fedora|suse) || $REPO_TARGET =~ (centos|fedora|suse) ]]; then
|
||||
install_package "dpkg" "rpm-build"
|
||||
[[ -d $OUTPUT_DIR/SPECS ]] || execute mkdir -p "$OUTPUT_DIR/SPECS"
|
||||
build_rpm
|
||||
|
||||
Reference in New Issue
Block a user