Fix webroot mask

This commit is contained in:
2023-03-22 12:22:35 -04:00
parent c8c610b3eb
commit 82113fb470
3 changed files with 49 additions and 48 deletions

View File

@@ -23,7 +23,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. "30.0.72" (default: latest version) Build or install a specific MC version, ex. "30.0.83" (default: latest version)
--arch ARCH --arch ARCH
Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture) Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture)
--outputdir PATH --outputdir PATH
@@ -112,9 +112,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 30.0.72` * `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 30.0.83`
Build and install an MC 30.0.72 comptability RPM locally and activate it using the `/path/to/license.mjr` Build and install an MC 30.0.83 comptability 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`

View File

@@ -32,7 +32,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. "30.0.72" Build or install a specific MC version, ex. "30.0.83"
--arch ARCH --arch ARCH
Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture) Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture)
--outputdir PATH --outputdir PATH
@@ -111,8 +111,8 @@ Install the latest version of MC from the best available repository.
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 30.0.72[/code] [code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 30.0.83[/code]
Build and install an MC 30.0.72 comptability RPM locally and activate it using the /path/to/license.mjr Build and install an MC 30.0.83 comptability RPM locally and activate it using the /path/to/license.mjr
[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]

View File

@@ -21,7 +21,7 @@ declare -g SCRIPTDIR=; SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
declare -g OUTPUTDIR="$SCRIPTDIR/output" declare -g OUTPUTDIR="$SCRIPTDIR/output"
declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,76.0.html" # MC30 declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,76.0.html" # MC30
declare -g DEBIANBASE="buster" declare -g DEBIANBASE="buster"
declare -g MCVERSION_HARDCODE="${MCVERSION:-"30.0.72"}" # Hardcoded fallback declare -g MCVERSION_HARDCODE="${MCVERSION:-"30.0.83"}" # Hardcoded fallback
declare -g CREATEREPO_WEBROOT="/var/www/jriver" declare -g CREATEREPO_WEBROOT="/var/www/jriver"
declare -g USER="${SUDO_USER:-$USER}" declare -g USER="${SUDO_USER:-$USER}"
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6) declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
@@ -45,7 +45,7 @@ printHelp() {
--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. "30.0.72" (default: latest version) Specify the MC version, ex. "30.0.83" (default: latest version)
--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)
--outputdir PATH --outputdir PATH
@@ -130,16 +130,17 @@ parseInput() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH TEST_SWITCH declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH TEST_SWITCH
declare -g LOCAL_INSTALL_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH YES_SWITCH declare -g LOCAL_INSTALL_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH
declare -g USER_VERSION_SWITCH USER_ARCH declare -g YES_SWITCH USER_VERSION_SWITCH USER_ARCH
declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE
declare -g VNCPASS USER_DISPLAY CREATEREPO_WEBROOT declare -g VNCPASS USER_DISPLAY
declare -ga SERVICES CONTAINERS declare -ga SERVICES CONTAINERS
declare long_opts short_opts input declare long_opts short_opts input
# Allow some environment variables to override and set sane fallbacks # Set some defaults
declare -g TARGET=${TARGET:-$ID} declare -g REPO_TARGET="$ID"
declare -g CREATEREPO_USER="${CREATEREPO_USER:-$USER}" declare -g BUILD_TARGET="$ID"
declare -g CREATEREPO_USER="$USER"
if [[ $# -eq 0 ]] || if [[ $# -eq 0 ]] ||
[[ $# -eq 1 && " $1 " =~ ^( --debug | -d | -y | --yes )$ ]] && [[ $# -eq 1 && " $1 " =~ ^( --debug | -d | -y | --yes )$ ]] &&
@@ -178,7 +179,7 @@ parseInput() {
;; ;;
--build|-b) --build|-b)
BUILD_SWITCH=1 BUILD_SWITCH=1
shift && TARGET="$1" shift && BUILD_TARGET="$1"
;; ;;
--outputdir) --outputdir)
shift && OUTPUTDIR="$1" shift && OUTPUTDIR="$1"
@@ -207,7 +208,7 @@ parseInput() {
--createrepo) --createrepo)
BUILD_SWITCH=1 BUILD_SWITCH=1
CREATEREPO_SWITCH=1 CREATEREPO_SWITCH=1
shift && TARGET="$1" shift && REPO_TARGET="$1"
;; ;;
--createrepo-webroot) --createrepo-webroot)
shift && CREATEREPO_WEBROOT="$1" shift && CREATEREPO_WEBROOT="$1"
@@ -540,6 +541,32 @@ installPackage() {
} }
#######################################
# Installs mesa-va-drivers-freeworld
#######################################
installMesa() {
debug "Running: ${FUNCNAME[0]}"
# Currently only necessary in Fedora/CentOS
case "$ID" in
fedora|centos)
if ! PKG_QUERY mesa-va-drivers-freeworld &>/dev/null; then
if PKG_QUERY mesa-va-drivers &>/dev/null; then
if ! execute sudo dnf swap -y \
mesa-va-drivers \
mesa-va-drivers-freeworld; then
err "Package swap failed!"
return 1
fi
else
execute "${PKG_INSTALL[@]}" mesa-va-drivers-freeworld
fi
fi
;;
esac
}
####################################### #######################################
# Installs JRiver Media Center from a remote repository # Installs JRiver Media Center from a remote repository
####################################### #######################################
@@ -672,7 +699,7 @@ buildRPM() {
recommends=("${recommends[@]//)/}") recommends=("${recommends[@]//)/}")
# Translate package names # Translate package names
case "$TARGET" in case "$BUILD_TARGET" in
fedora|centos) fedora|centos)
requires=("${requires[@]/libc6/glibc}") requires=("${requires[@]/libc6/glibc}")
requires=("${requires[@]/libasound2/alsa-lib}") requires=("${requires[@]/libasound2/alsa-lib}")
@@ -886,32 +913,6 @@ installMCGENERIC() {
} }
#######################################
# Installs mesa-va-drivers-freeworld
#######################################
installMesa() {
debug "Running: ${FUNCNAME[0]}"
# Currently only necessary in Fedora/CentOS
case "$ID" in
fedora|centos)
if ! PKG_QUERY mesa-va-drivers-freeworld &>/dev/null; then
if PKG_QUERY mesa-va-drivers &>/dev/null; then
if ! execute sudo dnf swap -y \
mesa-va-drivers \
mesa-va-drivers-freeworld; then
err "Package swap failed!"
return 1
fi
else
execute "${PKG_INSTALL[@]}" mesa-va-drivers-freeworld
fi
fi
;;
esac
}
####################################### #######################################
# Installs local Media Center PKGBUILD # Installs local Media Center PKGBUILD
####################################### #######################################
@@ -1158,7 +1159,7 @@ setVNCPass() {
####################################### #######################################
# Set display and port variables # Set display and port variables
####################################### #######################################
setDisplay() { setDisplayVars() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -g DISPLAY DISPLAYNUM NEXT_DISPLAY NEXT_DISPLAYNUM declare -g DISPLAY DISPLAYNUM NEXT_DISPLAY NEXT_DISPLAYNUM
@@ -1295,7 +1296,7 @@ service_jriver-xvnc() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
setServiceVars "${FUNCNAME[0]##*_}" "system" setServiceVars "${FUNCNAME[0]##*_}" "system"
setDisplay setDisplayVars
declare -a start_cmd declare -a start_cmd
declare -g PORT=$(( NEXT_DISPLAYNUM + 5900 )) declare -g PORT=$(( NEXT_DISPLAYNUM + 5900 ))
@@ -1365,7 +1366,7 @@ service_jriver-x11vnc() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
setServiceVars "${FUNCNAME[0]##*_}" "user" setServiceVars "${FUNCNAME[0]##*_}" "user"
setDisplay setDisplayVars
declare -a start_cmd declare -a start_cmd
declare -g PORT=$(( DISPLAYNUM + 5900 )) declare -g PORT=$(( DISPLAYNUM + 5900 ))
@@ -1441,7 +1442,7 @@ service_jriver-createrepo() {
[Service] [Service]
$USER_STRING $USER_STRING
ExecStart=$SCRIPTDIR/installJRMC --outputdir $OUTPUTDIR --createrepo=$TARGET --createrepo-webroot $CREATEREPO_WEBROOT --createrepo-user $CREATEREPO_USER ExecStart=$SCRIPTDIR/installJRMC --outputdir $OUTPUTDIR --createrepo=$REPO_TARGET --createrepo-webroot $CREATEREPO_WEBROOT --createrepo-user $CREATEREPO_USER
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
@@ -1740,7 +1741,7 @@ main() {
if (( BUILD_SWITCH )) && [[ $ID != "arch" ]]; then if (( BUILD_SWITCH )) && [[ $ID != "arch" ]]; then
installPackage "wget" installPackage "wget"
acquireDeb acquireDeb
if [[ "$TARGET" =~ (centos|fedora|suse) ]]; then if [[ "$BUILD_TARGET" =~ (centos|fedora|suse) ]]; then
installPackage "dpkg" "rpm-build" installPackage "dpkg" "rpm-build"
buildRPM buildRPM
fi fi