Fix up translations
This commit is contained in:
@@ -18,9 +18,10 @@ Running `installJRMC` without any options will install the latest version of JRi
|
|||||||
You can always find the latest supported options by running `installJRMC --help`.
|
You can always find the latest supported options by running `installJRMC --help`.
|
||||||
|
|
||||||
```text
|
```text
|
||||||
--install, -i repo|rpm
|
--install, -i repo|rpm|deb
|
||||||
repo: Install MC from repository, future updates will be handled by the system package manager
|
repo: Install MC from repository, future updates will be handled by the system package manager
|
||||||
rpm: Build and install MC locally (RPM-based OSes only)
|
rpm: Build and install MC locally (RPM-based OSes only)
|
||||||
|
deb: Download and install offcial MC package locally (useful with --compat flag for older distros)
|
||||||
--build
|
--build
|
||||||
Build RPM from source DEB but do not install
|
Build RPM from source DEB but do not install
|
||||||
--target opensuse|fedora|centos
|
--target opensuse|fedora|centos
|
||||||
|
|||||||
78
installJRMC
78
installJRMC
@@ -38,9 +38,10 @@ printHelp() {
|
|||||||
If no options (besides -d) are provided, the script will default to '--install repo'.
|
If no options (besides -d) are provided, the script will default to '--install repo'.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
--install, -i repo|rpm
|
--install, -i repo|rpm|deb
|
||||||
repo: Install MC from repository, updates are handled by the system package manager
|
repo: Install MC from repository, updates are handled by the system package manager
|
||||||
rpm: Build and install RPM locally (RPM-based distros only)
|
rpm: Build and install RPM locally (RPM-based distros only)
|
||||||
|
deb: Download and install offcial MC package locally (useful with --compat flag for older distros)
|
||||||
--build
|
--build
|
||||||
Build RPM from source DEB but do not install. Optional TARGET parameter enables RPM crossbuilding (ex. 'opensuse', 'fedora', 'centos')
|
Build RPM from source DEB but do not install. Optional TARGET parameter enables RPM crossbuilding (ex. 'opensuse', 'fedora', 'centos')
|
||||||
--target opensuse|fedora|centos
|
--target opensuse|fedora|centos
|
||||||
@@ -107,7 +108,7 @@ init() {
|
|||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare version_source
|
declare version_source
|
||||||
declare -g MCVERSION MVERSION MCPKG
|
declare -g MCVERSION MVERSION MCRPM
|
||||||
declare -g CREATEREPO_USER="${CREATEREPO_USER:-$USER}"
|
declare -g CREATEREPO_USER="${CREATEREPO_USER:-$USER}"
|
||||||
|
|
||||||
getOS
|
getOS
|
||||||
@@ -165,11 +166,11 @@ init() {
|
|||||||
|
|
||||||
# Set target package name
|
# Set target package name
|
||||||
if [[ "$ID" =~ ^(fedora|centos|opensuse.*)$ ]]; then
|
if [[ "$ID" =~ ^(fedora|centos|opensuse.*)$ ]]; then
|
||||||
MCPKG="MediaCenter"
|
MCRPM="MediaCenter"
|
||||||
[[ "$version_source" == "user input" ]] && MCPKG="$MCPKG-$MCVERSION"
|
[[ "$version_source" == "user input" ]] && MCRPM="$MCRPM-$MCVERSION"
|
||||||
elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint|neon)$ ]]; then
|
elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint|neon)$ ]]; then
|
||||||
MCPKG="mediacenter$MVERSION"
|
MCRPM="mediacenter$MVERSION"
|
||||||
[[ "$version_source" == "user input" ]] && MCPKG="$MCPKG=$MCVERSION"
|
[[ "$version_source" == "user input" ]] && MCRPM="$MCRPM=$MCVERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Saving this substituion in case it's needed in the future
|
# Saving this substituion in case it's needed in the future
|
||||||
@@ -221,7 +222,7 @@ getOS() {
|
|||||||
parseInput() {
|
parseInput() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare -g BUILD_SWITCH COMPAT_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH
|
declare -g RPM_BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH DEB_INSTALL_SWITCH
|
||||||
declare -g INSTALL_TYPE TARGET OUTPUTDIR MCVERSION RESTOREFILE BETAPASS SERVICE_TYPE VNCPASS USER_DISPLAY CREATEREPO_WEBROOT CREATEREPO_USER
|
declare -g INSTALL_TYPE TARGET OUTPUTDIR MCVERSION RESTOREFILE BETAPASS SERVICE_TYPE VNCPASS USER_DISPLAY CREATEREPO_WEBROOT CREATEREPO_USER
|
||||||
declare -ga SERVICES CONTAINERS
|
declare -ga SERVICES CONTAINERS
|
||||||
|
|
||||||
@@ -237,16 +238,12 @@ parseInput() {
|
|||||||
--install|-i)
|
--install|-i)
|
||||||
shift
|
shift
|
||||||
INSTALL_TYPE="$1"
|
INSTALL_TYPE="$1"
|
||||||
if [[ "$INSTALL_TYPE" == "rpm" ]]; then
|
[[ "$INSTALL_TYPE" == "rpm" ]] && RPM_BUILD_SWITCH=1
|
||||||
if [[ ! "$ID" =~ ^(fedora|centos|opensuse.*)$ ]]; then
|
[[ "$INSTALL_TYPE" == "deb" ]] && DEB_INSTALL_SWITCH=1
|
||||||
err "RPM install method not available on $ID"
|
[[ "$INSTALL_TYPE" == "repo" ]] && REPO_INSTALL_SWITCH=1
|
||||||
printHelp && exit 1
|
|
||||||
fi
|
|
||||||
BUILD_SWITCH=1
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
--build)
|
--build)
|
||||||
BUILD_SWITCH=1
|
RPM_BUILD_SWITCH=1
|
||||||
;;
|
;;
|
||||||
--target)
|
--target)
|
||||||
shift && TARGET="$1"
|
shift && TARGET="$1"
|
||||||
@@ -270,7 +267,7 @@ parseInput() {
|
|||||||
shift && SERVICES+=("$1")
|
shift && SERVICES+=("$1")
|
||||||
;;
|
;;
|
||||||
--createrepo)
|
--createrepo)
|
||||||
BUILD_SWITCH=1
|
RPM_BUILD_SWITCH=1
|
||||||
CREATEREPO_SWITCH=1
|
CREATEREPO_SWITCH=1
|
||||||
;;
|
;;
|
||||||
--createrepo-webroot)
|
--createrepo-webroot)
|
||||||
@@ -531,7 +528,7 @@ installMCFromRepo() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pkg_install_cmd="installPackage --nocheck --nogpgcheck $MCPKG"
|
pkg_install_cmd="installPackage --nocheck --nogpgcheck $MCRPM"
|
||||||
debug "$pkg_install_cmd" || pkg_install_cmd+=" &>/dev/null"
|
debug "$pkg_install_cmd" || pkg_install_cmd+=" &>/dev/null"
|
||||||
eval "$pkg_install_cmd"
|
eval "$pkg_install_cmd"
|
||||||
}
|
}
|
||||||
@@ -543,28 +540,28 @@ installMCFromRepo() {
|
|||||||
acquireDeb() {
|
acquireDeb() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare -g DEBFILENAME="$OUTPUTDIR/SOURCES/MediaCenter-$MCVERSION-amd64.deb"
|
declare -g MCDEB="$OUTPUTDIR/SOURCES/MediaCenter-$MCVERSION-amd64.deb"
|
||||||
|
|
||||||
# If necessary, create SOURCES dir
|
# If necessary, create SOURCES dir
|
||||||
[[ ! -d "$OUTPUTDIR/SOURCES" ]] && mkdir -p "$OUTPUTDIR/SOURCES"
|
[[ ! -d "$OUTPUTDIR/SOURCES" ]] && mkdir -p "$OUTPUTDIR/SOURCES"
|
||||||
|
|
||||||
# If deb file already exists, skip download
|
# If deb file already exists, skip download
|
||||||
if [[ -f "$DEBFILENAME" ]]; then
|
if [[ -f "$MCDEB" ]]; then
|
||||||
echo "Using local DEB file: $DEBFILENAME"
|
echo "Using local DEB file: $MCDEB"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -v BETAPASS ]]; then
|
if [[ -v BETAPASS ]]; then
|
||||||
echo "Checking beta repo..."
|
echo "Checking beta repo..."
|
||||||
if wget -q -O "$DEBFILENAME" \
|
if wget -q -O "$MCDEB" \
|
||||||
"https://files.jriver.com/mediacenter/channels/v$MVERSION/beta/$BETAPASS/MediaCenter-$MCVERSION-amd64.deb"; then
|
"https://files.jriver.com/mediacenter/channels/v$MVERSION/beta/$BETAPASS/MediaCenter-$MCVERSION-amd64.deb"; then
|
||||||
echo "Found!"
|
echo "Found!"
|
||||||
fi
|
fi
|
||||||
elif echo "Checking test repo..." && wget -q -O "$DEBFILENAME" \
|
elif echo "Checking test repo..." && wget -q -O "$MCDEB" \
|
||||||
"https://files.jriver.com/mediacenter/test/MediaCenter-$MCVERSION-amd64.deb"; then
|
"https://files.jriver.com/mediacenter/test/MediaCenter-$MCVERSION-amd64.deb"; then
|
||||||
echo "Found!"
|
echo "Found!"
|
||||||
# Else check latest repo
|
# Else check latest repo
|
||||||
elif echo "Checking latest repo..." && wget -q -O "$DEBFILENAME" \
|
elif echo "Checking latest repo..." && wget -q -O "$MCDEB" \
|
||||||
"https://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-amd64.deb"; then
|
"https://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-amd64.deb"; then
|
||||||
echo "Found!"
|
echo "Found!"
|
||||||
else
|
else
|
||||||
@@ -572,7 +569,7 @@ acquireDeb() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f "$DEBFILENAME" ]]; then
|
if [[ ! -f "$MCDEB" ]]; then
|
||||||
err "Downloaded DEB file missing or corrupted."
|
err "Downloaded DEB file missing or corrupted."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -602,8 +599,11 @@ buildRPM() {
|
|||||||
id="${TARGET:-$ID}"
|
id="${TARGET:-$ID}"
|
||||||
|
|
||||||
# Load deb dependencies into array
|
# Load deb dependencies into array
|
||||||
IFS=',' read -ra requires <<< "$(dpkg-deb -f "$DEBFILENAME" Depends)"
|
IFS=',' read -ra requires <<< "$(dpkg-deb -f "$MCDEB" Depends)"
|
||||||
IFS=',' read -ra recommends <<< "$(dpkg-deb -f "$DEBFILENAME" Recommends)"
|
IFS=',' read -ra recommends <<< "$(dpkg-deb -f "$MCDEB" Recommends)"
|
||||||
|
|
||||||
|
echo "${requires[@]}"
|
||||||
|
echo $id
|
||||||
|
|
||||||
# Clean up formatting
|
# Clean up formatting
|
||||||
requires=("${requires[@]%%|*}")
|
requires=("${requires[@]%%|*}")
|
||||||
@@ -622,6 +622,7 @@ buildRPM() {
|
|||||||
# Translate package names
|
# Translate package names
|
||||||
case "$id" in
|
case "$id" in
|
||||||
fedora|centos)
|
fedora|centos)
|
||||||
|
echo "HERE!""
|
||||||
requires=("${requires[@]/libc6/glibc}")
|
requires=("${requires[@]/libc6/glibc}")
|
||||||
requires=("${requires[@]/libasound2/alsa-lib}")
|
requires=("${requires[@]/libasound2/alsa-lib}")
|
||||||
requires=("${requires[@]/libuuid1/libuuid}")
|
requires=("${requires[@]/libuuid1/libuuid}")
|
||||||
@@ -752,7 +753,7 @@ buildRPM() {
|
|||||||
err "Build failed."
|
err "Build failed."
|
||||||
# For automation, let's remove the source DEB and reaquire it on next run
|
# For automation, let's remove the source DEB and reaquire it on next run
|
||||||
# after failure in case it is corrupted or buggy
|
# after failure in case it is corrupted or buggy
|
||||||
[[ -f "$DEBFILENAME" ]] && echo "Removing source DEB" && rm -f "$DEBFILENAME"
|
[[ -f "$MCDEB" ]] && echo "Removing source DEB" && rm -f "$MCDEB"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1443,7 +1444,7 @@ uninstall() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
debug "Uninstalling Media Center package"
|
debug "Uninstalling Media Center package"
|
||||||
mc_pkg_rm_cmd="pkg_remove $MCPKG"
|
mc_pkg_rm_cmd="pkg_remove $MCRPM"
|
||||||
debug "$mc_pkg_rm_cmd" || mc_pkg_rm_cmd+=" &>/dev/null"
|
debug "$mc_pkg_rm_cmd" || mc_pkg_rm_cmd+=" &>/dev/null"
|
||||||
if eval "$mc_pkg_rm_cmd"; then
|
if eval "$mc_pkg_rm_cmd"; then
|
||||||
echo "JRiver Media Center has been completely uninstalled."
|
echo "JRiver Media Center has been completely uninstalled."
|
||||||
@@ -1479,7 +1480,7 @@ main() {
|
|||||||
[[ "$ID" == "centos" ]] && installPackage epel-release
|
[[ "$ID" == "centos" ]] && installPackage epel-release
|
||||||
|
|
||||||
# Install MC using package manager
|
# Install MC using package manager
|
||||||
if [[ -v INSTALL_TYPE && "$INSTALL_TYPE" == "repo" ]]; then
|
if (( REPO_INSTALL_SWITCH )); then
|
||||||
if [[ "$ID" =~ ^opensuse.*$ ]]; then
|
if [[ "$ID" =~ ^opensuse.*$ ]]; then
|
||||||
echo "A SUSE repository is not yet available."
|
echo "A SUSE repository is not yet available."
|
||||||
echo "Use --install rpm to build and install a SUSE RPM instead."
|
echo "Use --install rpm to build and install a SUSE RPM instead."
|
||||||
@@ -1496,8 +1497,25 @@ main() {
|
|||||||
openFirewall "jriver"
|
openFirewall "jriver"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if (( DEB_INSTALL_SWITCH )); then
|
||||||
|
acquireDeb
|
||||||
|
declare extract_dir && extract_dir="$(mktemp -d)"
|
||||||
|
ar x --output "$extract_dir" "$MCDEB"
|
||||||
|
tar -xJf "$extract_dir/control.tar.xz" -C "$extract_dir"
|
||||||
|
# Remove minimum version specifiers from control file
|
||||||
|
sed -i 's/ ([^)]*)//g' "$extract_dir/control"
|
||||||
|
tar -C "$extract_dir" \
|
||||||
|
--ignore-failed-read \
|
||||||
|
-cvJf "control.tar.xz" "control" "postinst"
|
||||||
|
ar rcs "$MCDEB.compat" "$extract_dir/debian-binary" "$extract_dir/control.tar.xz" "$extract_dir/data.tar.xz"
|
||||||
|
pkg_install_cmd="installPackage --nocheck --nogpgcheck $MCDEB.compat"
|
||||||
|
debug "$pkg_install_cmd" || pkg_install_cmd+=" &>/dev/null"
|
||||||
|
eval "$pkg_install_cmd"
|
||||||
|
rm -rf "$extract_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
# Build RPM from source deb package
|
# Build RPM from source deb package
|
||||||
if (( BUILD_SWITCH )); then
|
if (( RPM_BUILD_SWITCH )); then
|
||||||
installPackage "wget" "dpkg" "rpm-build"
|
installPackage "wget" "dpkg" "rpm-build"
|
||||||
acquireDeb
|
acquireDeb
|
||||||
buildRPM
|
buildRPM
|
||||||
|
|||||||
Reference in New Issue
Block a user