Compare commits
2 Commits
c503fd994e
...
4e0f3cfc8f
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e0f3cfc8f | |||
| 207d09e689 |
@@ -22,9 +22,9 @@ You can always find the latest supported options by running `installJRMC --help`
|
|||||||
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 official MC package locally (useful with --compat flag for older distros)
|
deb: Download and install official MC package locally (useful with --compat flag for older distros)
|
||||||
--build=[opensuse|fedora|centos]
|
--build=[suse|fedora|centos]
|
||||||
Build RPM from source DEB but do not install
|
Build RPM from source DEB but do not install
|
||||||
Specify cross-build target with optional argument, note '=' (ex. --build=opensuse)
|
Specify cross-build target with optional argument, note '=' (ex. --build=suse)
|
||||||
--compat
|
--compat
|
||||||
Build/install MC without minimum library specifiers
|
Build/install MC without minimum library specifiers
|
||||||
--mcversion VERSION
|
--mcversion VERSION
|
||||||
|
|||||||
122
installJRMC
122
installJRMC
@@ -38,9 +38,9 @@ printHelp() {
|
|||||||
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)
|
deb: Download and install offcial MC package locally (useful with --compat flag for older distros)
|
||||||
--build=[opensuse|fedora|centos]
|
--build=[suse|fedora|centos]
|
||||||
Build RPM from source DEB but do not install
|
Build RPM from source DEB but do not install
|
||||||
Specify cross-build target with optional argument, note '=' (ex. --build=opensuse)
|
Specify cross-build target with optional argument, note '=' (ex. --build=suse)
|
||||||
--compat
|
--compat
|
||||||
Build/install MC without minimum library specifiers
|
Build/install MC without minimum library specifiers
|
||||||
--mcversion VERSION
|
--mcversion VERSION
|
||||||
@@ -105,9 +105,18 @@ askOk() {
|
|||||||
declare response
|
declare response
|
||||||
read -r -p "$* [y/N]: " response
|
read -r -p "$* [y/N]: " response
|
||||||
[[ "${response,,}" =~ ^(yes|y)$ ]]
|
[[ "${response,,}" =~ ^(yes|y)$ ]]
|
||||||
return $?
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Parse /etc/os-release and provide a compatability layer for unrecognzied distros
|
||||||
|
#######################################
|
||||||
getOS() {
|
getOS() {
|
||||||
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
|
declare -g ID
|
||||||
|
|
||||||
if [[ -e "/etc/os-release" ]]; then
|
if [[ -e "/etc/os-release" ]]; then
|
||||||
source "/etc/os-release"
|
source "/etc/os-release"
|
||||||
else
|
else
|
||||||
@@ -115,24 +124,55 @@ getOS() {
|
|||||||
err "Your OS is unsupported"
|
err "Your OS is unsupported"
|
||||||
printHelp && exit 1
|
printHelp && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
debug "Platform: $ID $VERSION_ID"
|
debug "Platform: $ID $VERSION_ID"
|
||||||
|
|
||||||
|
case "$ID" in
|
||||||
|
centos|fedora|debian|ubuntu)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
linuxmint|neon)
|
||||||
|
ID="ubuntu"
|
||||||
|
;;
|
||||||
|
*suse*)
|
||||||
|
ID="suse"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Attempting to autodetect RPM/DEB distro, this may be unreliable"
|
||||||
|
if hash dnf &>/dev/null || hash yum &>/dev/null; then
|
||||||
|
ID="fedora"
|
||||||
|
elif hash apt &>/dev/null; then
|
||||||
|
ID="ubuntu"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
debug "Using compatability platform: $ID"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
parseInput() {
|
parseInput() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
|
declare -g TARGET=${TARGET:-$ID}
|
||||||
|
declare -g CREATEREPO_USER="${CREATEREPO_USER:$USER}"
|
||||||
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH
|
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH
|
||||||
declare -g CREATEREPO_SWITCH UNINSTALL_SWITCH DEB_INSTALL_SWITCH
|
declare -g CREATEREPO_SWITCH UNINSTALL_SWITCH DEB_INSTALL_SWITCH
|
||||||
declare -g TARGET OUTPUTDIR MCVERSION RESTOREFILE BETAPASS SERVICE_TYPE
|
declare -g OUTPUTDIR MCVERSION RESTOREFILE BETAPASS SERVICE_TYPE
|
||||||
declare -g VNCPASS USER_DISPLAY CREATEREPO_WEBROOT CREATEREPO_USER
|
declare -g VNCPASS USER_DISPLAY CREATEREPO_WEBROOT
|
||||||
declare -ga SERVICES CONTAINERS
|
declare -ga SERVICES CONTAINERS
|
||||||
declare long_opts short_opts
|
declare long_opts short_opts
|
||||||
|
|
||||||
if [[ $# -eq 0 ]] || [[ $# -eq 1 && "$1" =~ ^(--debug|-d)$ ]]; then
|
if [[ $# -eq 0 ]] || [[ $# -eq 1 && "$1" =~ ^(--debug|-d)$ ]]; then
|
||||||
REPO_INSTALL_SWITCH=1
|
REPO_INSTALL_SWITCH=1
|
||||||
elif [[ $# -eq 1 && "$1" =~ ^(--compat)$ ]]; then
|
elif [[ $# -eq 1 && "$1" =~ ^(--compat)$ ]]; then
|
||||||
TARGET="$ID"
|
BUILD_SWITCH=1
|
||||||
|
# separate ordering is probably more reliable
|
||||||
|
if [[ "$ID" =~ (ubuntu|debian) ]]; then
|
||||||
|
DEB_INSTALL_SWITCH=1
|
||||||
|
elif [[ "$ID" =~ (fedora|centos|suse) ]]; then
|
||||||
|
RPM_INSTALL_SWITCH=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
long_opts="install:,build::,outputdir:,mcversion:,restorefile:,betapass:,"
|
long_opts="install:,build::,outputdir:,mcversion:,restorefile:,betapass:,"
|
||||||
@@ -296,12 +336,12 @@ installPackage() {
|
|||||||
skip_check_installed=1
|
skip_check_installed=1
|
||||||
;;
|
;;
|
||||||
--allow-downgrades)
|
--allow-downgrades)
|
||||||
[[ "$ID" =~ (debian|ubuntu|linuxmint|neon) ]] && install_flags+=(--allow-downgrades)
|
[[ "$ID" =~ (debian|ubuntu) ]] && install_flags+=(--allow-downgrades)
|
||||||
;;
|
;;
|
||||||
--nogpgcheck)
|
--nogpgcheck)
|
||||||
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
||||||
install_flags+=(--nogpgcheck)
|
install_flags+=(--nogpgcheck)
|
||||||
elif [[ "$ID" =~ ^opensuse.* ]]; then
|
elif [[ "$ID" == "suse" ]]; then
|
||||||
install_flags+=(--allow-unsigned-rpm)
|
install_flags+=(--allow-unsigned-rpm)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -321,7 +361,7 @@ installPackage() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
if [[ "$ID" =~ ^(debian|ubuntu|linuxmint|neon)$ ]]; then
|
if [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
||||||
declare -A PKG_ALIASES
|
declare -A PKG_ALIASES
|
||||||
PKG_ALIASES["xorg-x11-utils"]="xorg-x11"
|
PKG_ALIASES["xorg-x11-utils"]="xorg-x11"
|
||||||
PKG_ALIASES["rpm-build"]="rpm"
|
PKG_ALIASES["rpm-build"]="rpm"
|
||||||
@@ -372,7 +412,7 @@ installMCDEB() {
|
|||||||
if (( COMPAT_SWITCH )); then
|
if (( COMPAT_SWITCH )); then
|
||||||
declare extract_dir && extract_dir="$(mktemp -d)"
|
declare extract_dir && extract_dir="$(mktemp -d)"
|
||||||
mcdeb="${MCDEB/.deb/.compat.deb}"
|
mcdeb="${MCDEB/.deb/.compat.deb}"
|
||||||
pushd "$extract_dir" &>/dev/null || return $?
|
pushd "$extract_dir" &>/dev/null || return
|
||||||
ar x "$MCDEB"
|
ar x "$MCDEB"
|
||||||
tar -xJf "control.tar.xz"
|
tar -xJf "control.tar.xz"
|
||||||
# Remove minimum version specifiers from control file
|
# Remove minimum version specifiers from control file
|
||||||
@@ -380,7 +420,7 @@ installMCDEB() {
|
|||||||
sed -i 's/([^)]*)//g' "control" # TODO MC DEB package error
|
sed -i 's/([^)]*)//g' "control" # TODO MC DEB package error
|
||||||
tar -cJf "control.tar.xz" "control" "postinst"
|
tar -cJf "control.tar.xz" "control" "postinst"
|
||||||
ar rcs "$mcdeb" "debian-binary" "control.tar.xz" "data.tar.xz"
|
ar rcs "$mcdeb" "debian-binary" "control.tar.xz" "data.tar.xz"
|
||||||
popd &>/dev/null || return $?
|
popd &>/dev/null || return
|
||||||
rm -rf "$extract_dir"
|
rm -rf "$extract_dir"
|
||||||
pkg_install_cmd+=" --allow-downgrades"
|
pkg_install_cmd+=" --allow-downgrades"
|
||||||
fi
|
fi
|
||||||
@@ -405,7 +445,7 @@ addRepo() {
|
|||||||
baseurl=https://repos.bryanroessler.com/jriver
|
baseurl=https://repos.bryanroessler.com/jriver
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
EOF"
|
EOF"
|
||||||
elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint|neon)$ ]]; then
|
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
||||||
installPackage wget
|
installPackage wget
|
||||||
declare sources_dir="/etc/apt/sources.list.d"
|
declare sources_dir="/etc/apt/sources.list.d"
|
||||||
[[ ! -d $sources_dir ]] && sudo mkdir -p "$sources_dir"
|
[[ ! -d $sources_dir ]] && sudo mkdir -p "$sources_dir"
|
||||||
@@ -414,7 +454,7 @@ addRepo() {
|
|||||||
deb [trusted=yes arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $BASE main
|
deb [trusted=yes arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $BASE main
|
||||||
EOF"
|
EOF"
|
||||||
wget -q "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" -O- | sudo apt-key add - &>/dev/null
|
wget -q "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" -O- | sudo apt-key add - &>/dev/null
|
||||||
elif [[ "$ID" =~ ^opensuse.* ]]; then
|
elif [[ "$ID" == "suse" ]]; then
|
||||||
sudo zypper addrepo --no-gpgcheck "https://repos.bryanroessler.com/jriver" jriver &>/dev/null
|
sudo zypper addrepo --no-gpgcheck "https://repos.bryanroessler.com/jriver" jriver &>/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -493,7 +533,7 @@ acquireDeb() {
|
|||||||
buildRPM() {
|
buildRPM() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare id i rpmbuild_cmd
|
declare i rpmbuild_cmd
|
||||||
declare -a requires recommends
|
declare -a requires recommends
|
||||||
declare -A dupes
|
declare -A dupes
|
||||||
|
|
||||||
@@ -504,11 +544,9 @@ buildRPM() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[[ ! -d "$OUTPUTDIR/SPECS" ]] && mkdir -p "$OUTPUTDIR/SPECS"
|
[[ ! -d "$OUTPUTDIR/SPECS" ]] && mkdir -p "$OUTPUTDIR/SPECS"
|
||||||
|
|
||||||
# Use --target parameter override
|
if [[ ! "$TARGET" =~ (fedora|centos|suse) ]]; then
|
||||||
id="${TARGET:-$ID}"
|
err "The current RPM build target $TARGET is not supported, manually specify with --target"
|
||||||
if [[ ! "$id" =~ (fedora|centos|opensuse.*) ]]; then
|
|
||||||
err "The current RPM build target $id is not supported, manually specify with --target"
|
|
||||||
err "The DEB file is located at $MCDEB"
|
err "The DEB file is located at $MCDEB"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -532,7 +570,7 @@ buildRPM() {
|
|||||||
recommends=("${recommends[@]//)/}")
|
recommends=("${recommends[@]//)/}")
|
||||||
|
|
||||||
# Translate package names
|
# Translate package names
|
||||||
case "$id" in
|
case "$TARGET" in
|
||||||
fedora|centos)
|
fedora|centos)
|
||||||
requires=("${requires[@]/libc6/glibc}")
|
requires=("${requires[@]/libc6/glibc}")
|
||||||
requires=("${requires[@]/libasound2/alsa-lib}")
|
requires=("${requires[@]/libasound2/alsa-lib}")
|
||||||
@@ -562,7 +600,7 @@ buildRPM() {
|
|||||||
requires=("${requires[@]/libvulkan1/vulkan-loader}")
|
requires=("${requires[@]/libvulkan1/vulkan-loader}")
|
||||||
requires=("${requires[@]/libepoxy0/libepoxy}")
|
requires=("${requires[@]/libepoxy0/libepoxy}")
|
||||||
;;
|
;;
|
||||||
opensuse*)
|
suse)
|
||||||
requires=("${requires[@]/libc6/glibc}")
|
requires=("${requires[@]/libc6/glibc}")
|
||||||
requires=("${requires[@]/libasound2/alsa-lib}")
|
requires=("${requires[@]/libasound2/alsa-lib}")
|
||||||
requires=("${requires[@]/libx11-6/libX11-6}")
|
requires=("${requires[@]/libx11-6/libX11-6}")
|
||||||
@@ -678,22 +716,21 @@ runCreaterepo() {
|
|||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare cr_cmd cr_cp_cmd cr_mkdir_cmd cr_chown_cmd
|
declare cr_cmd cr_cp_cmd cr_mkdir_cmd cr_chown_cmd
|
||||||
declare cr_user="${CREATEREPO_USER:$USER}"
|
|
||||||
|
|
||||||
installPackage createrepo_c
|
installPackage createrepo_c
|
||||||
|
|
||||||
# If the webroot does not exist, create it
|
# If the webroot does not exist, create it
|
||||||
if [[ ! -d "$CREATEREPO_WEBROOT" ]]; then
|
if [[ ! -d "$CREATEREPO_WEBROOT" ]]; then
|
||||||
cr_mkdir_cmd="sudo -u $cr_user mkdir -p $CREATEREPO_WEBROOT"
|
cr_mkdir_cmd="sudo -u $CREATEREPO_USER mkdir -p $CREATEREPO_WEBROOT"
|
||||||
debug "$cr_mkdir_cmd" || cr_mkdir_cmd+=" &>/dev/null"
|
debug "$cr_mkdir_cmd" || cr_mkdir_cmd+=" &>/dev/null"
|
||||||
if ! eval "$cr_mkdir_cmd"; then
|
if ! eval "$cr_mkdir_cmd"; then
|
||||||
cr_mkdir_cmd="sudo mkdir -p $CREATEREPO_WEBROOT"
|
cr_mkdir_cmd="sudo mkdir -p $CREATEREPO_WEBROOT"
|
||||||
debug "$cr_mkdir_cmd" || cr_mkdir_cmd+=" &>/dev/null"
|
debug "$cr_mkdir_cmd" || cr_mkdir_cmd+=" &>/dev/null"
|
||||||
cr_chown_cmd="sudo chown -R $cr_user:$cr_user $CREATEREPO_WEBROOT"
|
cr_chown_cmd="sudo chown -R $CREATEREPO_USER:$CREATEREPO_USER $CREATEREPO_WEBROOT"
|
||||||
debug "$cr_chown_cmd" || cr_chown_cmd+=" &>/dev/null"
|
debug "$cr_chown_cmd" || cr_chown_cmd+=" &>/dev/null"
|
||||||
if ! ( eval "$cr_mkdir_cmd" && eval "$cr_chown_cmd" ); then
|
if ! ( eval "$cr_mkdir_cmd" && eval "$cr_chown_cmd" ); then
|
||||||
err "Could not create the createrepo-webroot path!"
|
err "Could not create the createrepo-webroot path!"
|
||||||
err "Make sure that the webroot $CREATEREPO_WEBROOT is writeable by user $cr_user"
|
err "Make sure that the webroot $CREATEREPO_WEBROOT is writeable by user $CREATEREPO_USER"
|
||||||
err "Or change the repo ownership with --createrepo-user"
|
err "Or change the repo ownership with --createrepo-user"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -702,7 +739,7 @@ runCreaterepo() {
|
|||||||
|
|
||||||
# Copy built rpms to webroot
|
# Copy built rpms to webroot
|
||||||
cr_cp_cmd="sudo cp -nf $MCRPM $CREATEREPO_WEBROOT"
|
cr_cp_cmd="sudo cp -nf $MCRPM $CREATEREPO_WEBROOT"
|
||||||
cr_chown_cmd="sudo chown -R $cr_user:$cr_user $CREATEREPO_WEBROOT"
|
cr_chown_cmd="sudo chown -R $CREATEREPO_USER:$CREATEREPO_USER $CREATEREPO_WEBROOT"
|
||||||
debug "$cr_cp_cmd" || cr_cp_cmd+=" &>/dev/null"
|
debug "$cr_cp_cmd" || cr_cp_cmd+=" &>/dev/null"
|
||||||
debug "$cr_chown_cmd" || cr_cp_cmd+=" &>/dev/null"
|
debug "$cr_chown_cmd" || cr_cp_cmd+=" &>/dev/null"
|
||||||
if ! ( eval "$cr_cp_cmd" && eval "$cr_chown_cmd" ); then
|
if ! ( eval "$cr_cp_cmd" && eval "$cr_chown_cmd" ); then
|
||||||
@@ -711,13 +748,13 @@ runCreaterepo() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run createrepo
|
# Run createrepo
|
||||||
cr_cmd="sudo -u $cr_user createrepo -q $CREATEREPO_WEBROOT"
|
cr_cmd="sudo -u $CREATEREPO_USER createrepo -q $CREATEREPO_WEBROOT"
|
||||||
[[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_cmd+=" --update"
|
[[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_cmd+=" --update"
|
||||||
debug "$cr_cmd" || cr_cmd+=" &>/dev/null"
|
debug "$cr_cmd" || cr_cmd+=" &>/dev/null"
|
||||||
if ! eval "$cr_cmd"; then
|
if ! eval "$cr_cmd"; then
|
||||||
cr_cmd="sudo createrepo -q $CREATEREPO_WEBROOT"
|
cr_cmd="sudo createrepo -q $CREATEREPO_WEBROOT"
|
||||||
[[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_cmd+=" --update"
|
[[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_cmd+=" --update"
|
||||||
cr_chown_cmd="sudo chown -R $cr_user:$cr_user $CREATEREPO_WEBROOT"
|
cr_chown_cmd="sudo chown -R $CREATEREPO_USER:$CREATEREPO_USER $CREATEREPO_WEBROOT"
|
||||||
debug "$cr_cmd" || cr_cmd+=" &>/dev/null"
|
debug "$cr_cmd" || cr_cmd+=" &>/dev/null"
|
||||||
debug "$cr_chown_cmd" || cr_cp_cmd+=" &>/dev/null"
|
debug "$cr_chown_cmd" || cr_cp_cmd+=" &>/dev/null"
|
||||||
if ! ( eval "$cr_cmd" && eval "$cr_chown_cmd"); then
|
if ! ( eval "$cr_cmd" && eval "$cr_chown_cmd"); then
|
||||||
@@ -794,7 +831,7 @@ openFirewall() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Open the ports
|
# Open the ports
|
||||||
if [[ "$ID" =~ ^(fedora|centos|opensuse.*)$ ]]; then
|
if [[ "$ID" =~ ^(fedora|centos|suse)$ ]]; then
|
||||||
installPackage firewalld
|
installPackage firewalld
|
||||||
if ! firewall_cmd --get-services | grep -q "$1"; then
|
if ! firewall_cmd --get-services | grep -q "$1"; then
|
||||||
firewall_cmd --permanent --new-service="$1" &>/dev/null
|
firewall_cmd --permanent --new-service="$1" &>/dev/null
|
||||||
@@ -806,7 +843,7 @@ openFirewall() {
|
|||||||
firewall_cmd --add-service "$1" --permanent &>/dev/null
|
firewall_cmd --add-service "$1" --permanent &>/dev/null
|
||||||
firewall_cmd --reload &>/dev/null
|
firewall_cmd --reload &>/dev/null
|
||||||
fi
|
fi
|
||||||
elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint|neon)$ ]]; then
|
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
||||||
# Debian ufw package state is broken on fresh installations
|
# Debian ufw package state is broken on fresh installations
|
||||||
installPackage ufw
|
installPackage ufw
|
||||||
if [[ ! -f "/etc/ufw/applications.d/$1" ]]; then
|
if [[ ! -f "/etc/ufw/applications.d/$1" ]]; then
|
||||||
@@ -1116,10 +1153,7 @@ service_jriver-x11vnc() {
|
|||||||
service_jriver-createrepo() {
|
service_jriver-createrepo() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare id="${TARGET:-$ID}"
|
if [[ "$USER" != "$CREATEREPO_USER" ]]; then
|
||||||
declare cr_user="${CREATEREPO_USER:$USER}"
|
|
||||||
|
|
||||||
if [[ "$USER" != "$cr_user" ]]; then
|
|
||||||
USER="root" SERVICE_TYPE="system" setServiceVars "${FUNCNAME[0]##*_}"
|
USER="root" SERVICE_TYPE="system" setServiceVars "${FUNCNAME[0]##*_}"
|
||||||
else
|
else
|
||||||
setServiceVars "${FUNCNAME[0]##*_}"
|
setServiceVars "${FUNCNAME[0]##*_}"
|
||||||
@@ -1131,7 +1165,7 @@ service_jriver-createrepo() {
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
$USER_STRING
|
$USER_STRING
|
||||||
ExecStart=$PWD/installJRMC --target $id --outputdir $OUTPUTDIR --createrepo --createrepo-webroot $CREATEREPO_WEBROOT --createrepo-user $cr_user
|
ExecStart=$PWD/installJRMC --target $TARGET --outputdir $OUTPUTDIR --createrepo --createrepo-webroot $CREATEREPO_WEBROOT --createrepo-user $CREATEREPO_USER
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@@ -1352,7 +1386,7 @@ uninstall() {
|
|||||||
sudo rm -rf \
|
sudo rm -rf \
|
||||||
"/etc/yum.repos.d/jriver.repo" \
|
"/etc/yum.repos.d/jriver.repo" \
|
||||||
/etc/apt/sources.list.d/{jriver,mediacenter}*.list # also remove legacy repo files
|
/etc/apt/sources.list.d/{jriver,mediacenter}*.list # also remove legacy repo files
|
||||||
if [[ "$ID" =~ ^opensuse.* ]]; then
|
if [[ "$ID" == "suse" ]]; then
|
||||||
sudo zypper rr jriver &>/dev/null
|
sudo zypper rr jriver &>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1406,7 +1440,7 @@ main() {
|
|||||||
getOS
|
getOS
|
||||||
|
|
||||||
# Some distros need external repos installed for MC libraries
|
# Some distros need external repos installed for MC libraries
|
||||||
if [[ "$ID" =~ (ubuntu|linuxmint|neon) ]]; then
|
if [[ "$ID" =~ (ubuntu) ]]; then
|
||||||
echo "Adding universe repository"
|
echo "Adding universe repository"
|
||||||
if ! grep ^deb /etc/apt/sources.list|grep -q universe; then
|
if ! grep ^deb /etc/apt/sources.list|grep -q universe; then
|
||||||
sudo add-apt-repository universe
|
sudo add-apt-repository universe
|
||||||
@@ -1423,13 +1457,13 @@ main() {
|
|||||||
pkg_update(){ sudo dnf makecache; }
|
pkg_update(){ sudo dnf makecache; }
|
||||||
pkg_query(){ rpm -q "$@"; }
|
pkg_query(){ rpm -q "$@"; }
|
||||||
firewall_cmd(){ sudo firewall-cmd "$@"; }
|
firewall_cmd(){ sudo firewall-cmd "$@"; }
|
||||||
elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint|neon)$ ]]; then
|
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
||||||
pkg_install(){ sudo apt-get install -y -q0 "$@"; }
|
pkg_install(){ sudo apt-get install -y -q0 "$@"; }
|
||||||
pkg_remove(){ sudo apt-get remove --auto-remove -y -q0 "$@"; }
|
pkg_remove(){ sudo apt-get remove --auto-remove -y -q0 "$@"; }
|
||||||
pkg_update(){ sudo apt-get update -y -q0; }
|
pkg_update(){ sudo apt-get update -y -q0; }
|
||||||
pkg_query(){ dpkg -s "$@"; }
|
pkg_query(){ dpkg -s "$@"; }
|
||||||
firewall_cmd(){ sudo ufw "$@"; }
|
firewall_cmd(){ sudo ufw "$@"; }
|
||||||
elif [[ "$ID" =~ ^opensuse.* ]]; then
|
elif [[ "$ID" == "suse" ]]; then
|
||||||
pkg_install(){ sudo zypper --non-interactive -q install --force --no-confirm "$@"; }
|
pkg_install(){ sudo zypper --non-interactive -q install --force --no-confirm "$@"; }
|
||||||
pkg_remove(){ sudo zypper --non-interactive -q remove --clean-deps "$@"; }
|
pkg_remove(){ sudo zypper --non-interactive -q remove --clean-deps "$@"; }
|
||||||
pkg_update(){ sudo zypper --non-interactive -q refresh jriver; }
|
pkg_update(){ sudo zypper --non-interactive -q refresh jriver; }
|
||||||
@@ -1453,10 +1487,10 @@ main() {
|
|||||||
MVERSION="${MCVERSION%%.*}"
|
MVERSION="${MCVERSION%%.*}"
|
||||||
|
|
||||||
# Set target package name
|
# Set target package name
|
||||||
if [[ "$ID" =~ ^(fedora|centos|opensuse.*)$ ]]; then
|
if [[ "$ID" =~ ^(fedora|centos|suse)$ ]]; then
|
||||||
MCPKG="MediaCenter"
|
MCPKG="MediaCenter"
|
||||||
[[ "$VERSION_SOURCE" == "user input" ]] && MCPKG="$MCPKG-$MCVERSION"
|
[[ "$VERSION_SOURCE" == "user input" ]] && MCPKG="$MCPKG-$MCVERSION"
|
||||||
elif [[ "$ID" =~ ^(debian|ubuntu|linuxmint|neon)$ ]]; then
|
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
||||||
MCPKG="mediacenter$MVERSION"
|
MCPKG="mediacenter$MVERSION"
|
||||||
[[ "$VERSION_SOURCE" == "user input" ]] && MCPKG="$MCPKG=$MCVERSION"
|
[[ "$VERSION_SOURCE" == "user input" ]] && MCPKG="$MCPKG=$MCVERSION"
|
||||||
fi
|
fi
|
||||||
@@ -1469,7 +1503,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if (( REPO_INSTALL_SWITCH )); then
|
if (( REPO_INSTALL_SWITCH )); then
|
||||||
if [[ "$ID" =~ ^opensuse.*$ ]]; then
|
if [[ "$ID" == "suse" ]]; 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"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -1487,9 +1521,7 @@ main() {
|
|||||||
if (( BUILD_SWITCH )); then
|
if (( BUILD_SWITCH )); then
|
||||||
installPackage "wget" "dpkg" "rpm-build"
|
installPackage "wget" "dpkg" "rpm-build"
|
||||||
acquireDeb
|
acquireDeb
|
||||||
if [[ "$TARGET" =~ ^(fedora|centos|opensuse.*) ]]; then
|
buildRPM
|
||||||
buildRPM
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( DEB_INSTALL_SWITCH )); then
|
if (( DEB_INSTALL_SWITCH )); then
|
||||||
|
|||||||
Reference in New Issue
Block a user