2 Commits

Author SHA1 Message Date
95695fc7b0 Add --arch for cross-compile 2023-02-14 14:03:44 -05:00
29e94c7488 Prep for rc5 2023-01-31 14:15:47 -05:00
2 changed files with 40 additions and 22 deletions

View File

@@ -6,9 +6,7 @@ This program will install [JRiver Media Center](https://www.jriver.com/) (JRMC)
`installJRMC [--option [ARGUMENT]]` `installJRMC [--option [ARGUMENT]]`
Running `installJRMC` without any options will install the latest version of JRiver Media Center from the official JRiver repository (Ubuntu/Debian) or my [unofficial repository](https://repos.bryanroessler.com/jriver/) (Fedora/CentOS) using the system package manager (`--install repo`). If any other option is specified, then the default install method (i.e. `--install repo` or `--install local`) will need to be explicitly specified. This makes it possible to install services and containers independent of MC. Running `installJRMC` without any options will install the latest version of JRiver Media Center (MC) from the official JRiver repository (Ubuntu/Debian) or my [unofficial repository](https://repos.bryanroessler.com/jriver/) (Fedora/CentOS) using the system package manager (`--install repo`). If any other option is specified, then the default install method (i.e. `--install repo` or `--install local`) will need to be explicitly specified. This makes it possible to install services and containers independent of MC.
**Note**: As of v1.0b14 major version library migrations are performed if the destination config directory `$HOME/.jriver/Media Center XX` is missing for major release `XX`. However, it is still a good idea to create a manual library backup before migrating major versions.
## Options ## Options
@@ -23,7 +21,9 @@ $ 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.51" (default: latest version) Build or install a specific MC version, ex. "30.0.55" (default: latest version)
--arch ARCH
Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture)
--outputdir PATH --outputdir PATH
Generate rpmbuild output in this PATH (default: ./output) Generate rpmbuild output in this PATH (default: ./output)
--restorefile RESTOREFILE --restorefile RESTOREFILE
@@ -110,9 +110,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.51` * `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 30.0.55`
Build and install an MC 30.0.51 comptability RPM locally and activate it using the `/path/to/license.mjr` Build and install an MC 30.0.55 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`
@@ -136,6 +136,6 @@ Multiple services (but not `--service-types`) can be installed at one time using
## Additional Info ## Additional Info
Did you find `installJRMC` useful? [Buy me a coffee!](https://paypal.me/bryanroessler?locale.x=en_US) Did you find `installJRMC` useful? [Buy me a coffee!](https://paypal.me/bryanroessler)
Did you find a bug? Let me know on [Interact!](https://yabb.jriver.com/interact/index.php/topic,134152.0.html) Did you find a bug? Let me know on [Interact!](https://yabb.jriver.com/interact/index.php/topic,134152.0.html)

View File

@@ -46,7 +46,9 @@ 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.51" (default: latest version) Specify the MC version, ex. "30.0.55" (default: latest version)
--arch VERSION
Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture)
--outputdir PATH --outputdir PATH
Generate rpmbuild output in this directory (default: ./output) Generate rpmbuild output in this directory (default: ./output)
--restorefile RESTOREFILE --restorefile RESTOREFILE
@@ -123,9 +125,11 @@ execute() {
parseInput() { parseInput() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH TEST_SWITCH USER_VERSION_SWITCH declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH TEST_SWITCH
declare -g LOCAL_INSTALL_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH declare -g LOCAL_INSTALL_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH
declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE VNCPASS USER_DISPLAY CREATEREPO_WEBROOT declare -g USER_VERSION_SWITCH
declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE
declare -g VNCPASS USER_DISPLAY CREATEREPO_WEBROOT
declare -ga SERVICES CONTAINERS declare -ga SERVICES CONTAINERS
declare long_opts short_opts input declare long_opts short_opts input
@@ -140,9 +144,10 @@ parseInput() {
LOCAL_INSTALL_SWITCH=1 LOCAL_INSTALL_SWITCH=1
fi fi
long_opts="install:,build::,outputdir:,mcversion:,restorefile:,betapass:," long_opts="install:,build::,outputdir:,mcversion:,restorefile:,betapass:,arch:,"
long_opts+="service-type:,service:,services:,version,debug,help,uninstall,createrepo::," long_opts+="service-type:,service:,services:,version,debug,help,uninstall,"
long_opts+="createrepo-webroot:,createrepo-user:,vncpass:,display:,container:,tests,compat" long_opts+="createrepo::,createrepo-webroot:,createrepo-user:,"
long_opts+="vncpass:,display:,container:,tests,compat"
short_opts="+i:vb::dhus:c:" short_opts="+i:vb::dhus:c:"
if input=$(getopt -o $short_opts -l $long_opts -- "$@"); then if input=$(getopt -o $short_opts -l $long_opts -- "$@"); then
@@ -173,6 +178,10 @@ parseInput() {
MCVERSION="$1" MCVERSION="$1"
USER_VERSION_SWITCH=1 USER_VERSION_SWITCH=1
;; ;;
--arch)
shift
ARCH="$1"
;;
--restorefile) --restorefile)
shift && RESTOREFILE="$1" shift && RESTOREFILE="$1"
;; ;;
@@ -246,7 +255,7 @@ parseInput() {
init() { init() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -g ID RPM_MGR declare -g ID RPM_MGR ARCH
echo "Starting installJRMC" echo "Starting installJRMC"
debug || echo "To enable debugging output, use --debug or -d" debug || echo "To enable debugging output, use --debug or -d"
@@ -260,7 +269,16 @@ init() {
exit 1 exit 1
fi fi
debug "Detected host platform: $ID $VERSION_ID" # Detect architecture and translate to MC convention
# Also catch user input in getopt
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
ARCH="amd64"
;;
esac
debug "Detected host platform: $ID $VERSION_ID $ARCH"
# normalize ID and set distro-specific vars # normalize ID and set distro-specific vars
case "$ID" in case "$ID" in
@@ -561,7 +579,7 @@ installMCFromRepo() {
acquireDeb() { acquireDeb() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -g MCDEB="$OUTPUTDIR/SOURCES/MediaCenter-$MCVERSION-amd64.deb" declare -g MCDEB="$OUTPUTDIR/SOURCES/MediaCenter-$MCVERSION-$ARCH.deb"
# If necessary, create SOURCES dir # If necessary, create SOURCES dir
[[ -d "$OUTPUTDIR/SOURCES" ]] || execute "mkdir -p $OUTPUTDIR/SOURCES" [[ -d "$OUTPUTDIR/SOURCES" ]] || execute "mkdir -p $OUTPUTDIR/SOURCES"
@@ -574,13 +592,13 @@ acquireDeb() {
if [[ -v BETAPASS ]] && if [[ -v BETAPASS ]] &&
echo "Checking beta repo for DEB package" && wget -q -O "$MCDEB" \ echo "Checking beta repo for DEB package" && 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-$ARCH.deb"; then
echo "Found!" echo "Found!"
elif echo "Checking latest repo for DEB package" && wget -q -O "$MCDEB" \ elif echo "Checking latest repo for DEB package" && 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-$ARCH.deb"; then
echo "Found!" echo "Found!"
elif echo "Checking test repo for DEB package" && wget -q -O "$MCDEB" \ elif echo "Checking test repo for DEB package" && wget -q -O "$MCDEB" \
"https://files.jriver.com/mediacenter/test/MediaCenter-$MCVERSION-amd64.deb"; then "https://files.jriver.com/mediacenter/test/MediaCenter-$MCVERSION-$ARCH.deb"; then
echo "Found!" echo "Found!"
else else
err "Cannot find DEB file" err "Cannot find DEB file"
@@ -709,7 +727,7 @@ buildRPM() {
Release: 1 Release: 1
Summary: JRiver Media Center Summary: JRiver Media Center
Group: Applications/Media Group: Applications/Media
Source0: http://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-amd64.deb Source0: http://files.jriver.com/mediacenter/channels/v$MVERSION/latest/MediaCenter-$MCVERSION-$ARCH.deb
BuildArch: x86_64 BuildArch: x86_64
%define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}.%%{ARCH}.rpm %define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}.%%{ARCH}.rpm
@@ -874,7 +892,7 @@ installMCARCH() {
'vorbis-tools: ogg vorbis support' 'vorbis-tools: ogg vorbis support'
'musepack-tools: musepack support' 'musepack-tools: musepack support'
) )
source=("http://files.jriver.com/mediacenter/channels/v30/latest/MediaCenter-$MCVERSION-amd64.deb") source=("http://files.jriver.com/mediacenter/channels/v30/latest/MediaCenter-$MCVERSION-$ARCH.deb")
package() { package() {
cd "\$srcdir" cd "\$srcdir"