Compare commits
4 Commits
45c827f27e
...
c7cb45dfa5
| Author | SHA1 | Date | |
|---|---|---|---|
| c7cb45dfa5 | |||
| 3f21dae6e1 | |||
| 07cc841252 | |||
| d94081b7b4 |
@@ -23,6 +23,8 @@ You can always find the latest supported options by running `installJRMC --help`
|
||||
rpm: Build and install MC locally (RPM-based OSes only)
|
||||
--build
|
||||
Build RPM from source DEB (no installation)
|
||||
--build-suse
|
||||
Override OS detection and build SUSE RPM
|
||||
--mcversion VERSION
|
||||
Build or install a specific MC version, ex. "28.0.25"
|
||||
--outputdir PATH
|
||||
@@ -37,7 +39,10 @@ You can always find the latest supported options by running `installJRMC --help`
|
||||
Install systemd services and containers for user USER (Default: executing user)
|
||||
--container, -c CONTAINER (TODO: Under construction)
|
||||
See CONTAINERS section below for a list of containers to deploy
|
||||
--createrepo
|
||||
Build rpm, copy to webroot, and run createrepo
|
||||
--createrepo-suse
|
||||
Override OS detection and run --createrepo with SUSE RPM
|
||||
--createrepo-webroot PATH
|
||||
The webroot directory to install the repo (Default: /srv/jriver/)
|
||||
--createrepo-user USER
|
||||
|
||||
108
installJRMC
108
installJRMC
@@ -20,7 +20,7 @@
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
_scriptversion="1.0b3"
|
||||
_scriptversion="1.0b4"
|
||||
_outputdir="$PWD/output"
|
||||
_createrepo_webroot="/var/www/jriver"
|
||||
_exec_user="$(whoami)"
|
||||
@@ -44,6 +44,8 @@ printHelp() {
|
||||
rpm: Build and install RPM locally (RPM-based distros only)
|
||||
--build
|
||||
Build RPM from source DEB (but don't install it)
|
||||
--build-suse
|
||||
Override OS detection and build SUSE RPM
|
||||
--mcversion VERSION
|
||||
Specify the MC version, ex. "28.0.25" (Default: latest version)
|
||||
--outputdir PATH
|
||||
@@ -64,6 +66,8 @@ printHelp() {
|
||||
The webroot directory to install the repo (Default: /var/www/jriver)
|
||||
--createrepo-user USER
|
||||
The web server user (Default: current user)
|
||||
--createrepo-suse
|
||||
Override OS detection and run --createrepo with SUSE RPM
|
||||
--version, -v
|
||||
Print this script version and exit
|
||||
--debug, -d
|
||||
@@ -136,7 +140,6 @@ init() {
|
||||
pkg_query(){ ifSudo dpkg -s "$@"; }
|
||||
firewall_cmd(){ ifSudo ufw "$@"; }
|
||||
elif [[ "$ID" =~ ^opensuse.* ]]; then
|
||||
echo "SUSE support is experimental!"
|
||||
pkg_install(){ ifSudo zypper --non-interactive -q install --force --no-confirm "$@"; }
|
||||
pkg_remove(){ ifSudo zypper --non-interactive -q remove --clean-deps "$@"; }
|
||||
pkg_update(){ ifSudo zypper --non-interactive -q refresh jriver; }
|
||||
@@ -233,7 +236,7 @@ parseInput() {
|
||||
_install="repo"
|
||||
fi
|
||||
|
||||
if _input=$(getopt -o +i:vdhus:c: -l install:,build,outputdir:,mcversion:,restorefile:,betapass:,service-user:,service:,version,debug,help,uninstall,createrepo,createrepo-webroot:,createrepo-user:,vncpass:,display:,container:,tests -- "$@"); then
|
||||
if _input=$(getopt -o +i:vdhus:c: -l install:,build,build-suse,outputdir:,mcversion:,restorefile:,betapass:,service-user:,service:,version,debug,help,uninstall,createrepo,createrepo-suse,createrepo-webroot:,createrepo-user:,vncpass:,display:,container:,tests -- "$@"); then
|
||||
eval set -- "$_input"
|
||||
while true; do
|
||||
case "$1" in
|
||||
@@ -251,6 +254,10 @@ parseInput() {
|
||||
--build)
|
||||
_build=true
|
||||
;;
|
||||
--build-suse)
|
||||
_build=true
|
||||
_build_suse=true
|
||||
;;
|
||||
--outputdir)
|
||||
shift && _outputdir="$1"
|
||||
;;
|
||||
@@ -273,6 +280,11 @@ parseInput() {
|
||||
_build=true
|
||||
_createrepo=true
|
||||
;;
|
||||
--createrepo-suse)
|
||||
_build=true
|
||||
_build_suse=true
|
||||
_createrepo=true
|
||||
;;
|
||||
--createrepo-webroot)
|
||||
shift && _createrepo_webroot="$1"
|
||||
;;
|
||||
@@ -341,7 +353,7 @@ getLatestVersion() {
|
||||
# This can be overriden w/ --mcversion
|
||||
# TODO need user input here
|
||||
# disable version checks for createrepo or rpmbuild (servers)
|
||||
if [[ ! -v _createrepo ]] || ! [[ -v _build && ! -v _install ]]; then
|
||||
if [[ -v _build && ! -v _install ]]; then
|
||||
if [[ "$ID" == "ubuntu" ]]; then
|
||||
# [[ "$VERSION_CODENAME" =~ ^(focal|groovy|hirsute|impish)$ ]] && \
|
||||
# _base="bullseye"
|
||||
@@ -585,7 +597,7 @@ acquireDeb() {
|
||||
buildRPM() {
|
||||
debug "Running: ${FUNCNAME[0]}"
|
||||
|
||||
local _build_requires _requires _ec
|
||||
local _build_requires _global_requires _custom_requires _ec
|
||||
|
||||
declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm"
|
||||
|
||||
@@ -606,15 +618,63 @@ buildRPM() {
|
||||
_build_requires=$'BuildRequires: rpm >= 4.11.0\nBuildRequires: dpkg'
|
||||
fi
|
||||
|
||||
# If you are building on SUSE, I assume you want SUSE RPMs
|
||||
# i.e. cross-building not an option but could be added
|
||||
if [[ "$ID" =~ ^opensuse.*$ ]]; then
|
||||
_requires=$'Requires: Mesa-libVulkan-devel\nRequires: freetype >= 1.3.1\nRequires: libharfbuzz0 >= 2.3.1\nRequires: libX11-6 >= 1.6\nRequires: libX11-data >= 1.6\nRequires: libXdmcp6 >= 1.1\nRequires: libXext6 >= 1.3\nRequires: libepoxy0 >= 1.5.3\nRequires: libgomp1 >= 7.4\nRequires: libstdc++6 >= 7.4\nRequires: libuuid1 >= 2.33\nRequires: libva2 >= 2.4.0\nRequires: libxcb1 >= 1.1\nRequires: libgbm1 >= 18.3.6\nRequires: mozilla-nspr >= 4.20\nRequires: mozilla-nss >= 3.42'
|
||||
read -r -d '' _global_requires <<- 'EOF'
|
||||
Requires: glibc >= 2.28
|
||||
Requires: alsa-lib >= 1.1.8
|
||||
Requires: gtk3 >= 3.24
|
||||
Requires: pango >= 1.42
|
||||
Requires: python3
|
||||
Requires: xdg-utils
|
||||
Requires: fribidi >= 1.0.5
|
||||
Requires: fontconfig >= 2.13
|
||||
Requires: lcms2 >= 2.9
|
||||
Requires: vulkan-headers >= 1.1
|
||||
Requires: ca-certificates
|
||||
Requires: libXScrnSaver
|
||||
EOF
|
||||
|
||||
# SUSE dependency name variations
|
||||
if [[ "$ID" =~ ^opensuse.*$ || -v _build_suse ]]; then
|
||||
read -r -d '' _custom_requires <<- 'EOF'
|
||||
Requires: Mesa-libVulkan-devel
|
||||
Requires: freetype >= 1.3.1
|
||||
Requires: libharfbuzz0 >= 2.3.1
|
||||
Requires: libX11-6 >= 1.6
|
||||
Requires: libX11-data >= 1.6
|
||||
Requires: libXdmcp6 >= 1.1
|
||||
Requires: libXext6 >= 1.3
|
||||
Requires: libepoxy0 >= 1.5.3
|
||||
Requires: libgomp1 >= 7.4
|
||||
Requires: libstdc++6 >= 7.4
|
||||
Requires: libuuid1 >= 2.33
|
||||
Requires: libva2 >= 2.4.0
|
||||
Requires: libxcb1 >= 1.1
|
||||
Requires: libgbm1 >= 18.3.6
|
||||
Requires: mozilla-nspr >= 4.20
|
||||
Requires: mozilla-nss >= 3.42
|
||||
EOF
|
||||
else
|
||||
_requires=$'Requires: mesa-vulkan-drivers\nRequires: freetype >= 2.9.1\nRequires: harfbuzz >= 2.3.1\nRequires: libX11 >= 1.6\nRequires: libX11-common >= 1.6\nRequires: libXdmcp >= 1.1\nRequires: libXext >= 1.3\nRequires: libepoxy >= 1.5.3\nRequires: libgomp >= 7.4\nRequires: libstdc++ >= 7.4\nRequires: libuuid >= 2.33\nRequires: libva >= 2.4.0\nRequires: libxcb >= 1.1\nRequires: mesa-libgbm >= 18.3.6\nRequires: nspr >= 4.20\nRequires: nss >= 3.42'
|
||||
read -r -d '' _custom_requires <<- 'EOF'
|
||||
Requires: mesa-vulkan-drivers
|
||||
Requires: freetype >= 2.9.1
|
||||
Requires: harfbuzz >= 2.3.1
|
||||
Requires: libX11 >= 1.6
|
||||
Requires: libX11-common >= 1.6
|
||||
Requires: libXdmcp >= 1.1
|
||||
Requires: libXext >= 1.3
|
||||
Requires: libepoxy >= 1.5.3
|
||||
Requires: libgomp >= 7.4
|
||||
Requires: libstdc++ >= 7.4
|
||||
Requires: libuuid >= 2.33
|
||||
Requires: libva >= 2.4.0
|
||||
Requires: libxcb >= 1.1
|
||||
Requires: mesa-libgbm >= 18.3.6
|
||||
Requires: nspr >= 4.20
|
||||
Requires: nss >= 3.42
|
||||
EOF
|
||||
fi
|
||||
|
||||
debug "Requires: $_requires"
|
||||
#debug "Requires: $_requires"
|
||||
|
||||
# Create spec file
|
||||
cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec"
|
||||
@@ -629,26 +689,16 @@ buildRPM() {
|
||||
%define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}.%%{ARCH}.rpm
|
||||
|
||||
AutoReq: 0
|
||||
Requires: glibc >= 2.28
|
||||
Requires: alsa-lib >= 1.1.8
|
||||
Requires: gtk3 >= 3.24
|
||||
Requires: pango >= 1.42
|
||||
Requires: python3
|
||||
Requires: xdg-utils
|
||||
Requires: fribidi >= 1.0.5
|
||||
Requires: fontconfig >= 2.13
|
||||
Requires: lcms2 >= 2.9
|
||||
Requires: vulkan-headers >= 1.1
|
||||
Requires: ca-certificates
|
||||
Requires: libXScrnSaver
|
||||
${_requires:-}
|
||||
|
||||
${_global_requires:-}
|
||||
${_custom_requires:-}
|
||||
|
||||
Recommends: vorbis-tools >= 1.4.0
|
||||
Recommends: lame >= 3.0
|
||||
|
||||
Provides: mediacenter$_mversion
|
||||
|
||||
License: Copyright 1998-2021, JRiver, Inc. All rights reserved. Protected by U.S. patents #7076468 and #7062468
|
||||
License: Copyright 1998-2022, JRiver, Inc. All rights reserved. Protected by U.S. patents #7076468 and #7062468
|
||||
URL: http://www.jriver.com/
|
||||
|
||||
%define __provides_exclude_from ^%{_libdir}/jriver/.*/.*\\.so.*$
|
||||
@@ -1287,6 +1337,11 @@ main() {
|
||||
|
||||
# Install MC using package manager
|
||||
if [[ -v _install && "$_install" == "repo" ]]; then
|
||||
if [[ "$ID" =~ ^opensuse.*$ ]]; then
|
||||
echo "A SUSE repository is not yet available."
|
||||
echo "Use --install rpm to build and install a SUSE RPM instead."
|
||||
exit 1
|
||||
fi
|
||||
if installMCFromRepo; then
|
||||
echo "JRiver Media Center installed successfully"
|
||||
else
|
||||
@@ -1303,8 +1358,7 @@ main() {
|
||||
acquireDeb
|
||||
if ! buildRPM; then
|
||||
err "Build failed."
|
||||
# In case this is automated, let's remove the source DEB and reaquire
|
||||
# it on next run in case it is corrupted or buggy
|
||||
# For automation, let's remove the source DEB and reaquire it on next run in case it is corrupted or buggy
|
||||
[[ -f "$DEBFILENAME" ]] && echo "Removing source DEB" && rm -f "$DEBFILENAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user