Compare commits
58 Commits
3bbd846a3f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b62ba38c49 | |||
| 37d3f643a5 | |||
| be9f594b25 | |||
| 5bcbc9a935 | |||
| 1f61ec4888 | |||
| 3c8ed002bb | |||
| 7ef9669dec | |||
| eb62392da7 | |||
| 60961f8415 | |||
| e087248165 | |||
| 90ea1e0fa4 | |||
| bafd812074 | |||
| 75881d5ac1 | |||
| fd6d4d872f | |||
| c96ff1ed4b | |||
| a37ae0b5f5 | |||
| b8f64b3f0c | |||
| bcde2c252b | |||
| 1f8f276258 | |||
| ce46f50cd1 | |||
| 07878d97ce | |||
| d015f70ec2 | |||
| b4a80f5ba1 | |||
| 6dcf224b8e | |||
| 5fb8e0e75f | |||
| 20e09ea15c | |||
| 2ac055e827 | |||
| 0ee91075fb | |||
| 3c7ef14aac | |||
| 71ce48626f | |||
| f564980ec6 | |||
| e040a94504 | |||
| e913d57e17 | |||
| 61d9e2f98c | |||
| 148e821fa9 | |||
| 622e5d9295 | |||
| 71defe9672 | |||
| 60cfe6a19c | |||
| c6eed2a89a | |||
| f2c8865216 | |||
| fc1956dc04 | |||
| 533106cbd7 | |||
| 89499ddac8 | |||
| e19422257d | |||
| 4683ed4c0e | |||
| 8a38cbef41 | |||
| d86b454be4 | |||
| 98a10f2539 | |||
| 373ec80694 | |||
| f7ddf6830e | |||
| 29ade7e11c | |||
| c9ac0c94b0 | |||
| eda302ac11 | |||
| a975749b26 | |||
| da199b1278 | |||
| c6429d563c | |||
| a2de08da42 | |||
| 633938eb4d |
@@ -1,16 +1,16 @@
|
|||||||
[size=20pt]installJRMC[/size]
|
[size=20pt]installJRMC[/size]
|
||||||
|
|
||||||
This program will install [url=https://www.jriver.com/]JRiver Media Center[/url] and associated services on most Linux distributions.
|
This program installs [url=https://www.jriver.com/]JRiver Media Center[/url] and associated services on most Linux distributions.
|
||||||
|
|
||||||
You can find the latest version of installJRMC, changelog, and documentation in [url=https://git.bryanroessler.com/bryan/installJRMC]my repository[/url].
|
You can find the latest version of installJRMC, changelog, and documentation in [url=https://git.bryanroessler.com/bryan/installJRMC]my repository[/url].
|
||||||
|
|
||||||
[size=18pt]tl;dr One-line MC install[/size]
|
[size=18pt]tl;dr (One-line MC install)[/size]
|
||||||
[code]curl https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC|bash[/code]
|
[code]curl https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC|bash[/code]
|
||||||
|
|
||||||
[size=18pt]Instructions[/size]
|
[size=18pt]Instructions[/size]
|
||||||
|
|
||||||
Download and unzip installJRMC from the attachment below or grab the latest stable version directly:
|
Download and unzip installJRMC from the attachment below or grab the latest stable version directly:
|
||||||
[code]curl -O https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC &&
|
[code]curl -O https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC &&
|
||||||
chmod +x ./installJRMC &&
|
chmod +x ./installJRMC &&
|
||||||
./installJRMC [--option [ARGUMENT]]
|
./installJRMC [--option [ARGUMENT]]
|
||||||
[/code]
|
[/code]
|
||||||
@@ -23,48 +23,48 @@ Specifying [tt]--build[/tt], [tt]--createrepo[/tt], [tt]--service[/tt], or [tt]-
|
|||||||
[code]
|
[code]
|
||||||
$ installJRMC --help
|
$ installJRMC --help
|
||||||
--install, -i repo|local
|
--install, -i repo|local
|
||||||
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.
|
||||||
local: Build and install MC package from official source package
|
local: Build and install MC package from official source package.
|
||||||
--build[=suse|fedora|centos]
|
--build[=suse|fedora|centos]
|
||||||
Build RPM from source DEB but do not install
|
Build RPM from source DEB but do not install.
|
||||||
Optionally, specify a target distro for cross-building (ex. --build=suse, note the '=')
|
Optionally, specify a target distro for cross-building (ex. --build=suse, note the '=').
|
||||||
--compat
|
--compat
|
||||||
Build/install MC without minimum dependency version requirements
|
Build/install MC without minimum dependency version requirements.
|
||||||
--mcversion VERSION
|
--mcversion VERSION
|
||||||
Specify the MC version, ex. "33", "34.0.51", or "34.0.51-1" (default: latest)
|
Specify the MC version, ex. "33", "35.0.24", or "35.0.24-1" (default: latest).
|
||||||
--arch ARCH
|
--arch ARCH
|
||||||
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture)
|
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture).
|
||||||
--mcrepo REPO
|
--mcrepo REPO
|
||||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: host or official)
|
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: host or official).
|
||||||
--outputdir PATH
|
--outputdir PATH
|
||||||
Generate reusable installJRMC output in this PATH (default: ./output)
|
Generate reusable installJRMC output in this PATH (default: ./output).
|
||||||
--restorefile RESTOREFILE
|
--restorefile RESTOREFILE
|
||||||
Restore file location for automatic license registration
|
Restore file location for automatic license registration.
|
||||||
--betapass PASSWORD
|
--betapass PASSWORD
|
||||||
Enter beta team password for access to beta builds
|
Enter beta team password for access to beta builds.
|
||||||
--service, -s SERVICE
|
--service, -s SERVICE
|
||||||
See SERVICES section below for the list of services to deploy
|
See SERVICES section below for the list of services to deploy.
|
||||||
--service-type user|system
|
--service-type user|system
|
||||||
Starts services at boot (system) or user login (user) (default: per-service, see SERVICES)
|
Starts services at boot (system) or user login (user) (default: per-service, see SERVICES).
|
||||||
--container, -c CONTAINER (TODO: Under construction)
|
--container, -c CONTAINER (TODO: Under construction)
|
||||||
See CONTAINERS section below for a list of containers to deploy
|
See CONTAINERS section below for a list of containers to deploy.
|
||||||
--createrepo[=suse|fedora|centos]
|
--createrepo[=suse|fedora|centos]
|
||||||
Build rpm, copy to webroot, and run createrepo.
|
Build rpm, copy to webroot, and run createrepo.
|
||||||
Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=')
|
Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=').
|
||||||
--createrepo-webroot PATH
|
--createrepo-webroot PATH
|
||||||
The webroot directory to install the repo (default: /var/www/jriver/)
|
The webroot directory to install the repo (default: /var/www/jriver/).
|
||||||
--createrepo-user USER
|
--createrepo-user USER
|
||||||
The web server user if different from the current user
|
The web server user if different from the current user.
|
||||||
--no-update
|
--no-update
|
||||||
Disable the installJRMC update check
|
Disable the installJRMC update check.
|
||||||
--yes, -y, --auto
|
--yes, -y, --auto
|
||||||
Always assumes yes for questions
|
Always assumes yes for questions.
|
||||||
--version, -v
|
--version, -v
|
||||||
Print installJRMC version and exit
|
Print installJRMC version and exit.
|
||||||
--debug, -d
|
--debug, -d
|
||||||
Print debug output
|
Print debug output.
|
||||||
--help, -h
|
--help, -h
|
||||||
Print help dialog and exit
|
Print help dialog and exit.
|
||||||
--uninstall, -u
|
--uninstall, -u
|
||||||
Uninstall JRiver MC, service files, firewall rules, etc.
|
Uninstall JRiver MC, service files, firewall rules, etc.
|
||||||
[/code]
|
[/code]
|
||||||
@@ -72,20 +72,20 @@ $ installJRMC --help
|
|||||||
[size=18pt]Services[/size]
|
[size=18pt]Services[/size]
|
||||||
|
|
||||||
[code]jriver-mediaserver (user)
|
[code]jriver-mediaserver (user)
|
||||||
Enable and start a mediaserver systemd service (requires an existing X server)
|
Enable and start a mediaserver systemd service (requires an existing X server).
|
||||||
jriver-mediacenter (user)
|
jriver-mediacenter (user)
|
||||||
Enable and start a mediacenter systemd service (requires an existing X server)
|
Enable and start a mediacenter systemd service (requires an existing X server).
|
||||||
jriver-x11vnc (user)
|
jriver-x11vnc (user)
|
||||||
Enable and start x11vnc for the local desktop (requires an existing X server, does NOT support Wayland)
|
Enable and start x11vnc for the local desktop (requires an existing X server, does NOT support Wayland).
|
||||||
--vncpass and --display are also valid options (see below)
|
--vncpass and --display are also valid options (see below).
|
||||||
jriver-xvnc (system)
|
jriver-xvnc (system)
|
||||||
Enable and start a new Xvnc session running JRiver Media Center
|
Enable and start a new Xvnc session running JRiver Media Center.
|
||||||
--vncpass PASSWORD
|
--vncpass PASSWORD
|
||||||
Set vnc password for x11vnc/Xvnc access. If no password is set, the script will either use existing password stored in ~/.vnc/jrmc_passwd or else no password
|
Set vnc password for x11vnc/Xvnc access. If no password is set, the script will either use existing password stored in ~/.vnc/jrmc_passwd or else no password.
|
||||||
--display DISPLAY
|
--display DISPLAY
|
||||||
Manually specify display to use for x11vnc/Xvnc (ex. ':1')
|
Manually specify display to use for x11vnc/Xvnc (ex. ':1').
|
||||||
jriver-createrepo (system)
|
jriver-createrepo (system)
|
||||||
Install hourly service to build latest MC RPM and run createrepo
|
Install hourly service to build latest MC RPM and run createrepo.
|
||||||
[/code]
|
[/code]
|
||||||
|
|
||||||
Services use a sane default [tt]--service-type[/tt] listed next to the service name in the Services description.
|
Services use a sane default [tt]--service-type[/tt] listed next to the service name in the Services description.
|
||||||
@@ -110,11 +110,11 @@ installJRMC automatically creates port forwarding firewall rules for remote acce
|
|||||||
|
|
||||||
[size=18pt]Other Nicities[/size]
|
[size=18pt]Other Nicities[/size]
|
||||||
[list]
|
[list]
|
||||||
[*]Automatically updates [tt]installJRMC[/tt] to the latest release
|
[*]Automatically updates [tt]installJRMC[/tt] to the latest release.
|
||||||
[*]Activates external third-party repositories for improved media playback (hardware decoding, etc.)
|
[*]Activates external third-party repositories for improved media playback (hardware decoding, etc.).
|
||||||
[*]Adds temporary legacy repositories to provide deprecated libraries
|
[*]Adds temporary legacy repositories to provide deprecated libraries.
|
||||||
[*]Links non-standard SSL certs
|
[*]Links non-standard SSL certs.
|
||||||
[*]Activates MC if a valid license file is found in common locations
|
[*]Activates MC if a valid license file is found in common locations.
|
||||||
[/list]
|
[/list]
|
||||||
|
|
||||||
[size=18pt]Examples[/size]
|
[size=18pt]Examples[/size]
|
||||||
@@ -126,8 +126,8 @@ Install the latest version of MC33 from the best available repository with debug
|
|||||||
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 34.0.51[/code]
|
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.24[/code]
|
||||||
Build and install an MC 34.0.51 comptability RPM locally and activate it using the /path/to/license.mjr
|
Build and install an MC 35.0.24 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
|
||||||
[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]
|
||||||
|
|||||||
85
README.md
85
README.md
@@ -1,89 +1,89 @@
|
|||||||
# installJRMC
|
# installJRMC
|
||||||
|
|
||||||
This program will install [JRiver Media Center](https://www.jriver.com/) and associated services on most Linux distributions.
|
Installs [JRiver Media Center](https://www.jriver.com/) and associated services on most Linux distributions.
|
||||||
|
|
||||||
You can find the latest version of installJRMC, changelog, and documentation in [my repository](https://git.bryanroessler.com/bryan/installJRMC).
|
You can find the latest version of installJRMC, changelog, and documentation in [my repository](https://git.bryanroessler.com/bryan/installJRMC).
|
||||||
|
|
||||||
## Executing
|
## Usage
|
||||||
|
|
||||||
`installJRMC [--option [ARGUMENT]]`
|
`installJRMC [--option [ARGUMENT]]`
|
||||||
|
|
||||||
`installJRMC` defaults to `--install=repo` on distros with MC repositories and `--install=local` on all others.
|
`installJRMC` defaults to `--install=repo` on distros with Media Center repositories and `--install=local` on others.
|
||||||
Specifying `--build`, `--createrepo`, `--service`, or `--uninstall` disables the default install method.
|
Specifying `--build`, `--createrepo`, `--service`, or `--uninstall` disables the default install method.
|
||||||
|
|
||||||
### tl;dr
|
### tl;dr
|
||||||
|
|
||||||
`curl https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC|bash`
|
`curl https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC|bash`
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
```text
|
```text
|
||||||
$ installJRMC --help
|
$ installJRMC --help
|
||||||
--install, -i repo|local
|
--install, -i repo|local
|
||||||
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.
|
||||||
local: Build and install MC package locally from official source package
|
local: Build and install MC package locally from official source package.
|
||||||
--build[=suse|fedora|centos|mandriva]
|
--build[=suse|fedora|centos|mandriva]
|
||||||
Build RPM from source DEB but do not install
|
Build RPM from source DEB but do not install.
|
||||||
Optionally, specify a target distro for cross-building (ex. --build=suse, note the '=')
|
Optionally, specify a target distro for cross-building (ex. --build=suse, note the '=').
|
||||||
--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. "34.0.51" or "33" (default: latest)
|
Build or install a specific MC version, ex. "35.0.24" or "33" (default: latest).
|
||||||
--mcrepo REPO
|
--mcrepo REPO
|
||||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
|
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official).
|
||||||
--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
|
||||||
Generate rpmbuild output in this PATH (default: ./output)
|
Generate rpmbuild output in this PATH (default: ./output).
|
||||||
--restorefile RESTOREFILE
|
--restorefile RESTOREFILE
|
||||||
Restore file location for automatic license registration
|
Restore file location for automatic license registration.
|
||||||
--betapass PASSWORD
|
--betapass PASSWORD
|
||||||
Enter beta team password for access to beta builds
|
Enter beta team password for access to beta builds.
|
||||||
--service, -s SERVICE
|
--service, -s SERVICE
|
||||||
See SERVICES section below for the list of services to deploy
|
See SERVICES section below for the list of services to deploy.
|
||||||
--service-type user|system
|
--service-type user|system
|
||||||
Starts services at boot (system) or user login (user) (default: per-service, see SERVICES)
|
Starts services at boot (system) or user login (user) (default: per-service, see SERVICES).
|
||||||
--container, -c CONTAINER (TODO: Under construction)
|
--container, -c CONTAINER (TODO: Under construction)
|
||||||
See CONTAINERS section below for a list of containers to deploy
|
See CONTAINERS section below for a list of containers to deploy.
|
||||||
--createrepo[=suse|fedora|centos|mandriva]
|
--createrepo[=suse|fedora|centos|mandriva]
|
||||||
Build rpm, copy to webroot, and run createrepo.
|
Build rpm, copy to webroot, and run createrepo.
|
||||||
Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=')
|
Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=').
|
||||||
--createrepo-webroot PATH
|
--createrepo-webroot PATH
|
||||||
The webroot directory to install the repo (default: /var/www/jriver/)
|
The webroot directory to install the repo (default: /var/www/jriver/).
|
||||||
--createrepo-user USER
|
--createrepo-user USER
|
||||||
The web server user if different from the current user
|
The web server user if different from the current user.
|
||||||
--no-update
|
--no-update
|
||||||
Disable the installJRMC update check
|
Disable the installJRMC update check.
|
||||||
--yes, -y, --auto
|
--yes, -y, --auto
|
||||||
Always assume yes for questions
|
Always assume yes for questions.
|
||||||
--version, -v
|
--version, -v
|
||||||
Print installJRMC version and exit
|
Print installJRMC version and exit.
|
||||||
--debug, -d
|
--debug, -d
|
||||||
Print debug output
|
Print debug output.
|
||||||
--help, -h
|
--help, -h
|
||||||
Print help dialog and exit
|
Print help dialog and exit.
|
||||||
--uninstall, -u
|
--uninstall, -u
|
||||||
Uninstall JRiver MC, service files, and firewall rules (does not remove library or media files)
|
Uninstall JRiver MC, service files, and firewall rules (does not remove library or media files).
|
||||||
```
|
```
|
||||||
|
|
||||||
### `--service=`
|
### `--service=`
|
||||||
|
|
||||||
```text
|
```text
|
||||||
jriver-mediaserver [--service-type=user]
|
jriver-mediaserver [--service-type=user]
|
||||||
Enable and start a mediaserver systemd service (requires an existing X server)
|
Enable and start a mediaserver systemd service (requires an existing X server).
|
||||||
jriver-mediacenter [--service-type=user]
|
jriver-mediacenter [--service-type=user]
|
||||||
Enable and start a mediacenter systemd service (requires an existing X server)
|
Enable and start a mediacenter systemd service (requires an existing X server).
|
||||||
jriver-x11vnc [--service-type=user]
|
jriver-x11vnc [--service-type=user]
|
||||||
Enable and start x11vnc for the local desktop (requires an existing X server, does NOT support Wayland)
|
Enable and start x11vnc for the local desktop (requires an existing X server, does NOT support Wayland).
|
||||||
--vncpass and --display are also valid options (see below)
|
--vncpass and --display are also valid options (see below).
|
||||||
jriver-xvnc [--service-type=system]
|
jriver-xvnc [--service-type=system]
|
||||||
Enable and start a new Xvnc session running JRiver Media Center
|
Enable and start a new Xvnc session running JRiver Media Center.
|
||||||
--vncpass PASSWORD
|
--vncpass PASSWORD
|
||||||
Set vnc password for x11vnc/Xvnc access. If no password is set, the script will either use existing password stored in ~/.vnc/jrmc_passwd or use no password
|
Set vnc password for x11vnc/Xvnc access. If no password is set, the script will either use existing password stored in ~/.vnc/jrmc_passwd or use no password.
|
||||||
--display DISPLAY
|
--display DISPLAY
|
||||||
Manually specify display to use for x11vnc/Xvnc (ex. ':1')
|
Manually specify display to use for x11vnc/Xvnc (ex. ':1').
|
||||||
jriver-createrepo [--service-type=system]
|
jriver-createrepo [--service-type=system]
|
||||||
Install hourly service to build latest MC RPM and run createrepo
|
Install hourly service to build latest MC RPM and run createrepo.
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `--service-type=`
|
#### `--service-type=`
|
||||||
@@ -104,14 +104,13 @@ Multiple services (but not `--service-types`) can be installed at one time using
|
|||||||
|
|
||||||
`installJRMC` automatically creates port forwarding firewall rules for remote access to Media Network (52100-52200/tcp, 1900/udp DLNA) and Xvnc/x11vnc (if selected), using `firewall-cmd` or `ufw` (if available).
|
`installJRMC` automatically creates port forwarding firewall rules for remote access to Media Network (52100-52200/tcp, 1900/udp DLNA) and Xvnc/x11vnc (if selected), using `firewall-cmd` or `ufw` (if available).
|
||||||
|
|
||||||
|
|
||||||
## Other Nicities
|
## Other Nicities
|
||||||
|
|
||||||
* Automatically updates `installJRMC` to the latest release
|
* Automatically updates `installJRMC` to the latest release.
|
||||||
* Activates external third-party repositories for improved media playback (hardware decoding, etc.)
|
* Activates external third-party repositories for improved media playback (hardware decoding, etc.).
|
||||||
* Adds temporary legacy repositories to provide deprecated libraries
|
* Adds temporary legacy repositories to provide deprecated libraries.
|
||||||
* Links non-standard SSL certs
|
* Links non-standard SSL certs.
|
||||||
* Activates MC if a valid license file is found in common locations
|
* Activates MC if a valid license file is found in common locations.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@@ -131,9 +130,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 34.0.51`
|
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.24`
|
||||||
|
|
||||||
Build and install an MC 34.0.51 compatibility RPM locally and activate it using the `/path/to/license.mjr`
|
Build and install an MC 35.0.24 compatibility 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`
|
||||||
|
|
||||||
|
|||||||
376
installJRMC
376
installJRMC
@@ -18,15 +18,15 @@
|
|||||||
# * Avoid execute() for stdout
|
# * Avoid execute() for stdout
|
||||||
#
|
#
|
||||||
# Allow indirection to match service names to their functions
|
# Allow indirection to match service names to their functions
|
||||||
# shellcheck disable=SC2317
|
# shellcheck disable=SC2329
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
|
|
||||||
declare -g SCRIPT_VERSION="1.34.7"
|
declare -g SCRIPT_VERSION="1.35.5"
|
||||||
declare -g MC_VERSION="34.0.51" # do find all replace (hardcoded fallback)
|
declare -g MC_VERSION_HARDCODE="35.0.24" # do find all replace
|
||||||
declare -g MC_REPO="bookworm" # should match the MC_VERSION
|
declare -g MC_REPO_HARDCODE="bookworm" # should match the MC_VERSION_HARDCODE
|
||||||
declare -g BOARD_ID="89.0" # MC34 board ID for automatic version detection
|
declare -g BOARD_ID="92.0" # MC35 board ID for legacy latest version detection
|
||||||
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
||||||
declare -g SCRIPT_URL="https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC" # self-update URL
|
declare -g SCRIPT_URL="https://git.bryanroessler.com/bryan/installJRMC/raw/branch/master/installJRMC" # self-update URL
|
||||||
# declare -g SCRIPT_URL="https://raw.githubusercontent.com/cryobry/installJRMC/refs/heads/master/installJRMC" # backup URL
|
# declare -g SCRIPT_URL="https://raw.githubusercontent.com/cryobry/installJRMC/refs/heads/master/installJRMC" # backup URL
|
||||||
declare -gi DEBUG=${DEBUG:-0} # set default debug and allow DEBUG env override (default: disabled)
|
declare -gi DEBUG=${DEBUG:-0} # set default debug and allow DEBUG env override (default: disabled)
|
||||||
|
|
||||||
@@ -46,71 +46,71 @@ print_help() {
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
--install, -i repo|local
|
--install, -i repo|local
|
||||||
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.
|
||||||
local: Build and install MC locally from official source package
|
local: Build and install MC locally from official source package.
|
||||||
--build[=suse|fedora|centos|mandriva]
|
--build[=suse|fedora|centos|mandriva]
|
||||||
Build RPM from source DEB but do not install
|
Build RPM from source DEB but do not install.
|
||||||
Optionally, specify a target distro for cross-building (ex. --build=suse, note the '=')
|
Optionally, specify a target distro for cross-building (ex. --build=suse, note the '=').
|
||||||
--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. "$MC_VERSION" or "${MC_VERSION%%.*}" (default: latest release)
|
Specify the MC version, ex. "$MC_VERSION_HARDCODE" or "${MC_VERSION_HARDCODE%%.*}" (default: latest release).
|
||||||
--arch VERSION
|
--arch VERSION
|
||||||
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host)
|
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host).
|
||||||
--mcrepo REPO
|
--mcrepo REPO
|
||||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: auto)
|
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: auto).
|
||||||
--outputdir PATH
|
--outputdir PATH
|
||||||
Generate reusable installJRMC output in this PATH (default: ./output)
|
Generate reusable installJRMC output in this PATH (default: ./output).
|
||||||
--restorefile MJR_FILE
|
--restorefile MJR_FILE
|
||||||
Restore file location for automatic license registration
|
Restore file location for automatic license registration.
|
||||||
--betapass PASSWORD
|
--betapass PASSWORD
|
||||||
Enter beta team password for access to beta builds
|
Enter beta team password for access to beta builds.
|
||||||
--service, -s SERVICE
|
--service, -s SERVICE
|
||||||
See SERVICES section below for a list of possible services to install
|
See SERVICES section below for a list of possible services to install.
|
||||||
--service-type user|system
|
--service-type user|system
|
||||||
Starts services at boot (system) or at user login (user) (default: per service, see SERVICES)
|
Starts services at boot (system) or at user login (user) (default: per service, see SERVICES).
|
||||||
--container, -c CONTAINER (TODO: Under construction)
|
--container, -c CONTAINER (TODO: Under construction)
|
||||||
See CONTAINERS section below for a list of possible services to install
|
See CONTAINERS section below for a list of possible services to install.
|
||||||
--createrepo[=suse|fedora|centos|mandriva]
|
--createrepo[=suse|fedora|centos|mandriva]
|
||||||
Build rpm, copy to webroot, and run createrepo.
|
Build rpm, copy to webroot, and run createrepo.
|
||||||
Use in conjunction with --build=TARGET for crossbuilding repos
|
Use in conjunction with --build=TARGET for crossbuilding repos.
|
||||||
Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=')
|
Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=').
|
||||||
--createrepo-webroot PATH
|
--createrepo-webroot PATH
|
||||||
Specify the webroot directory to install the repo (default: /var/www/jriver)
|
Specify the webroot directory to install the repo (default: /var/www/jriver).
|
||||||
--createrepo-user USER
|
--createrepo-user USER
|
||||||
Specify the web server user if it differs from \$USER
|
Specify the web server user if it differs from \$USER.
|
||||||
--no-update
|
--no-update
|
||||||
Disable automatic installJRMC self-update
|
Disable automatic installJRMC self-update.
|
||||||
--uninstall, -u
|
--uninstall, -u
|
||||||
Uninstall JRiver MC, remove services, containers, and firewall rules (does not remove library files)
|
Uninstall JRiver MC, remove services, containers, and firewall rules (does not remove library files).
|
||||||
--yes, -y, --auto
|
--yes, -y, --auto
|
||||||
Assume yes response to questions
|
Assume yes response to questions.
|
||||||
--version, -v
|
--version, -v
|
||||||
Print installJRMC version and exit
|
Print installJRMC version and exit.
|
||||||
--debug, -d
|
--debug, -d
|
||||||
Print debug output
|
Print debug output.
|
||||||
--help, -h
|
--help, -h
|
||||||
Print help dialog and exit
|
Print help dialog and exit.
|
||||||
|
|
||||||
SERVICES
|
SERVICES
|
||||||
jriver-mediaserver (default --service-type=user)
|
jriver-mediaserver (default --service-type=user)
|
||||||
Enable and start a mediaserver systemd service (requires an existing X server)
|
Enable and start a mediaserver systemd service (requires an existing X server).
|
||||||
jriver-mediacenter (user)
|
jriver-mediacenter (user)
|
||||||
Enable and start a mediacenter systemd service (requires an existing X server)
|
Enable and start a mediacenter systemd service (requires an existing X server).
|
||||||
jriver-x11vnc (user)
|
jriver-x11vnc (user)
|
||||||
Enable and start x11vnc for the local desktop (requires an existing X server)
|
Enable and start x11vnc for the local desktop (requires an existing X server).
|
||||||
Usually combined with jriver-mediaserver or jriver-mediacenter services
|
Usually combined with jriver-mediaserver or jriver-mediacenter services.
|
||||||
--vncpass and --display are optional (see below)
|
--vncpass and --display are optional (see below).
|
||||||
jriver-xvnc (system)
|
jriver-xvnc (system)
|
||||||
Enable and start a new Xvnc session running JRiver Media Center
|
Enable and start a new Xvnc session running JRiver Media Center.
|
||||||
--vncpass PASSWORD
|
--vncpass PASSWORD
|
||||||
Set the vnc password for x11vnc/Xvnc access. If no password is set, installJRMC
|
Set the vnc password for x11vnc/Xvnc access. If no password is set, installJRMC
|
||||||
will either use existing password stored in \$HOME/.vnc/jrmc_passwd or else no password
|
will either use existing password stored in \$HOME/.vnc/jrmc_passwd or else no password.
|
||||||
--display DISPLAY
|
--display DISPLAY
|
||||||
Display to use for x11vnc/Xvnc (default: The current display (x11vnc) or the
|
Display to use for x11vnc/Xvnc (default: The current display (x11vnc) or the
|
||||||
current display incremented by 1 (Xvnc))
|
current display incremented by 1 (Xvnc)).
|
||||||
jriver-createrepo (system)
|
jriver-createrepo (system)
|
||||||
Install hourly service to build latest MC RPM and run createrepo
|
Install hourly service to build latest MC RPM and run createrepo.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ parse_input() {
|
|||||||
declare -gi BUILD_SWITCH REPO_INSTALL_SWITCH LOCAL_INSTALL_SWITCH \
|
declare -gi BUILD_SWITCH REPO_INSTALL_SWITCH LOCAL_INSTALL_SWITCH \
|
||||||
CONTAINER_INSTALL_SWITCH CREATEREPO_SWITCH SNAP_INSTALL_SWITCH \
|
CONTAINER_INSTALL_SWITCH CREATEREPO_SWITCH SNAP_INSTALL_SWITCH \
|
||||||
APPIMAGE_INSTALL_SWITCH COMPAT_SWITCH UNINSTALL_SWITCH YES_SWITCH DEBUG=0
|
APPIMAGE_INSTALL_SWITCH COMPAT_SWITCH UNINSTALL_SWITCH YES_SWITCH DEBUG=0
|
||||||
declare -g USER_MC_VERSION USER_MC_MVERSION USER_MC_RELEASE USER_MC_REPO USER_ARCH MJR_FILE \
|
declare -g MC_VERSION_USER MC_MVERSION_USER MC_RELEASE_USER MC_REPO_USER USER_ARCH MJR_FILE \
|
||||||
BETAPASS SERVICE_TYPE VNCPASS USER_DISPLAY BUILD_TARGET CREATEREPO_TARGET
|
BETAPASS SERVICE_TYPE VNCPASS USER_DISPLAY BUILD_TARGET CREATEREPO_TARGET
|
||||||
local long_opts short_opts input
|
local long_opts short_opts input
|
||||||
long_opts="install:,build::,outputdir:,mcversion:,arch:,mcrepo:,compat,"
|
long_opts="install:,build::,outputdir:,mcversion:,arch:,mcrepo:,compat,"
|
||||||
@@ -139,7 +139,7 @@ parse_input() {
|
|||||||
--install|-i) shift;
|
--install|-i) shift;
|
||||||
case $1 in
|
case $1 in
|
||||||
local|rpm|deb) BUILD_SWITCH=1 LOCAL_INSTALL_SWITCH=1 ;;
|
local|rpm|deb) BUILD_SWITCH=1 LOCAL_INSTALL_SWITCH=1 ;;
|
||||||
repo|remote) REPO_INSTALL_SWITCH=1 ;;
|
repo|remote|""|-*) REPO_INSTALL_SWITCH=1 ;;
|
||||||
container) CONTAINER_INSTALL_SWITCH=1 ;;
|
container) CONTAINER_INSTALL_SWITCH=1 ;;
|
||||||
snap) SNAP_INSTALL_SWITCH=1 ;;
|
snap) SNAP_INSTALL_SWITCH=1 ;;
|
||||||
appimage) APPIMAGE_INSTALL_SWITCH=1 ;;
|
appimage) APPIMAGE_INSTALL_SWITCH=1 ;;
|
||||||
@@ -151,37 +151,44 @@ parse_input() {
|
|||||||
--mcversion) shift;
|
--mcversion) shift;
|
||||||
if [[ $1 =~ ^([0-9]+)(\.[0-9]+\.[0-9]+)?(-([0-9]+))?$ ]]; then
|
if [[ $1 =~ ^([0-9]+)(\.[0-9]+\.[0-9]+)?(-([0-9]+))?$ ]]; then
|
||||||
# Major version is required
|
# Major version is required
|
||||||
USER_MC_MVERSION="${BASH_REMATCH[1]}"
|
MC_MVERSION_USER="${BASH_REMATCH[1]}"
|
||||||
# Set default release to 1 if not provided
|
# Set default release to 1 if not provided
|
||||||
USER_MC_RELEASE="${BASH_REMATCH[4]:-1}"
|
MC_RELEASE_USER="${BASH_REMATCH[4]:-1}"
|
||||||
# If we get the full version, use it
|
# If we get the full version, use it
|
||||||
[[ -n ${BASH_REMATCH[2]} ]] && USER_MC_VERSION="${BASH_REMATCH[1]}${BASH_REMATCH[2]}"
|
[[ -n ${BASH_REMATCH[2]} ]] && MC_VERSION_USER="${BASH_REMATCH[1]}${BASH_REMATCH[2]}"
|
||||||
|
|
||||||
# Set major version defaults
|
# Set major version defaults
|
||||||
case "$USER_MC_MVERSION" in
|
case "$MC_MVERSION_USER" in
|
||||||
34) MC_VERSION="${USER_MC_VERSION:-$MC_VERSION}" MC_REPO="bookworm" BOARD_ID="89.0" ;;
|
35) MC_REPO_HARDCODE="bookworm" BOARD_ID="92.0" ;; # fallback to hardcoded version if full version not provided
|
||||||
33) MC_VERSION="${USER_MC_VERSION:-33.0.72}" MC_REPO="bullseye" BOARD_ID="86.0" ;;
|
34) MC_VERSION_USER="${MC_VERSION_USER:-34.0.75}" MC_REPO_HARDCODE="bookworm" BOARD_ID="89.0" ;;
|
||||||
32) MC_VERSION="${USER_MC_VERSION:-32.0.58}" MC_REPO="bullseye" BOARD_ID="83.0" ;;
|
33) MC_VERSION_USER="${MC_VERSION_USER:-33.0.72}" MC_REPO_HARDCODE="bullseye" BOARD_ID="86.0" ;;
|
||||||
31) MC_VERSION="${USER_MC_VERSION:-31.0.83}" MC_REPO="bullseye" BOARD_ID="80.0" ;;
|
32) MC_VERSION_USER="${MC_VERSION_USER:-32.0.58}" MC_REPO_HARDCODE="bullseye" BOARD_ID="83.0" ;;
|
||||||
30) MC_VERSION="${USER_MC_VERSION:-30.0.96}" MC_REPO="buster" BOARD_ID="76.0" ;;
|
31) MC_VERSION_USER="${MC_VERSION_USER:-31.0.83}" MC_REPO_HARDCODE="bullseye" BOARD_ID="80.0" ;;
|
||||||
29) MC_VERSION="${USER_MC_VERSION:-29.0.91}" MC_REPO="buster" BOARD_ID="74.0" ;;
|
30) MC_VERSION_USER="${MC_VERSION_USER:-30.0.96}" MC_REPO_HARDCODE="buster" BOARD_ID="76.0" ;;
|
||||||
28) MC_VERSION="${USER_MC_VERSION:-28.0.110}" MC_REPO="buster" BOARD_ID="71.0" ;;
|
29) MC_VERSION_USER="${MC_VERSION_USER:-29.0.91}" MC_REPO_HARDCODE="buster" BOARD_ID="74.0" ;;
|
||||||
27) MC_VERSION="${USER_MC_VERSION:-27.0.88}" MC_REPO="buster" BOARD_ID="67.0" ;;
|
28) MC_VERSION_USER="${MC_VERSION_USER:-28.0.110}" MC_REPO_HARDCODE="buster" BOARD_ID="71.0" ;;
|
||||||
26) MC_VERSION="${USER_MC_VERSION:-26.0.107}" MC_REPO="jessie" BOARD_ID="64.0" ;;
|
27) MC_VERSION_USER="${MC_VERSION_USER:-27.0.88}" MC_REPO_HARDCODE="buster" BOARD_ID="67.0" ;;
|
||||||
25) MC_VERSION="${USER_MC_VERSION:-25.0.114}" MC_REPO="jessie" BOARD_ID="62.0" ;;
|
26) MC_VERSION_USER="${MC_VERSION_USER:-26.0.107}" MC_REPO_HARDCODE="jessie" BOARD_ID="64.0" ;;
|
||||||
24) MC_VERSION="${USER_MC_VERSION:-24.0.78}" MC_REPO="jessie" BOARD_ID="58.0" ;;
|
25) MC_VERSION_USER="${MC_VERSION_USER:-25.0.114}" MC_REPO_HARDCODE="jessie" BOARD_ID="62.0" ;;
|
||||||
23) MC_VERSION="${USER_MC_VERSION:-23.0.104}" MC_REPO="jessie" BOARD_ID="54.0" ;;
|
24) MC_VERSION_USER="${MC_VERSION_USER:-24.0.78}" MC_REPO_HARDCODE="jessie" BOARD_ID="58.0" ;;
|
||||||
22) MC_VERSION="${USER_MC_VERSION:-22.0.102}" MC_REPO="jessie" BOARD_ID="51.0" ;;
|
23) MC_VERSION_USER="${MC_VERSION_USER:-23.0.104}" MC_REPO_HARDCODE="jessie" BOARD_ID="54.0" ;;
|
||||||
21) MC_VERSION="${USER_MC_VERSION:-21.0.90}" MC_REPO="jessie" BOARD_ID="44.0" ;;
|
22) MC_VERSION_USER="${MC_VERSION_USER:-22.0.102}" MC_REPO_HARDCODE="jessie" BOARD_ID="51.0" ;;
|
||||||
20) MC_VERSION="${USER_MC_VERSION:-20.0.131}" MC_REPO="jessie" BOARD_ID="35.0";;
|
21) MC_VERSION_USER="${MC_VERSION_USER:-21.0.90}" MC_REPO_HARDCODE="jessie" BOARD_ID="44.0" ;;
|
||||||
*) err "Bad --mcversion"; print_help; exit 1 ;;
|
20) MC_VERSION_USER="${MC_VERSION_USER:-20.0.131}" MC_REPO_HARDCODE="jessie" BOARD_ID="35.0" ;;
|
||||||
|
*)
|
||||||
|
# Warn for future major beta versions
|
||||||
|
if [[ $MC_MVERSION_USER -gt ${MC_VERSION_HARDCODE%%.*} ]] && [[ -z $MC_VERSION_USER ]]; then
|
||||||
|
echo "For future major versions, supply full version (and --betapass if necessary)."
|
||||||
|
err "Bad --mcversion"; print_help; exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
err "Bad --mcversion"; print_help; exit 1
|
err "Bad --mcversion"; print_help; exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--arch) shift; USER_ARCH="$1" ;;
|
--arch) shift; USER_ARCH="$1" ;;
|
||||||
--mcrepo) shift; USER_MC_REPO="$1" ;;
|
--mcrepo) shift; MC_REPO_USER="$1" ;;
|
||||||
--restorefile) shift; MJR_FILE="$1"; [[ -f $MJR_FILE ]] || err "Specified license $MJR_FILE missing." ;;
|
--restorefile) shift; MJR_FILE="$1"; [[ -f $MJR_FILE ]] || err "Specified license $MJR_FILE missing." ;;
|
||||||
--betapass) shift; BETAPASS="$1" ;;
|
--betapass) shift; BETAPASS="$1" ;;
|
||||||
--service-type) shift; SERVICE_TYPE="$1" ;;
|
--service-type) shift; SERVICE_TYPE="$1" ;;
|
||||||
@@ -208,7 +215,7 @@ parse_input() {
|
|||||||
err "Incorrect option provided, see installJRMC --help"; exit 1
|
err "Incorrect option provided, see installJRMC --help"; exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set some default conditions
|
# Default to --install=repo (can be overridden later by OS defaults)
|
||||||
if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH
|
if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH
|
||||||
|| CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) &&
|
|| CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) &&
|
||||||
[[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then
|
[[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then
|
||||||
@@ -216,7 +223,7 @@ parse_input() {
|
|||||||
REPO_INSTALL_SWITCH=1
|
REPO_INSTALL_SWITCH=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $BETA_PASS ]] && ((REPO_INSTALL_SWITCH)); then
|
if [[ -n $BETAPASS ]] && ((REPO_INSTALL_SWITCH)); then
|
||||||
echo "Warning: not all repositories have beta channels"
|
echo "Warning: not all repositories have beta channels"
|
||||||
echo "If the MC package is unavailable, try using --mcrepo to select another repository"
|
echo "If the MC package is unavailable, try using --mcrepo to select another repository"
|
||||||
fi
|
fi
|
||||||
@@ -252,9 +259,10 @@ init() {
|
|||||||
# Run the self-updater if enabled
|
# Run the self-updater if enabled
|
||||||
((SELF_UPDATE_SWITCH)) && update "$@"
|
((SELF_UPDATE_SWITCH)) && update "$@"
|
||||||
|
|
||||||
fix_permissions "$HOME/.jriver" "$USER"
|
# Check that the .jriver directory is owned by the user
|
||||||
|
((YES_SWITCH)) || fix_permissions "$HOME/.jriver" "$USER"
|
||||||
|
|
||||||
# Get host information
|
# Get host information and immediately fail if required vars are unavailable
|
||||||
[[ -f /etc/os-release ]] && source /etc/os-release
|
[[ -f /etc/os-release ]] && source /etc/os-release
|
||||||
|
|
||||||
# Detect host architecture and translate to MC convention
|
# Detect host architecture and translate to MC convention
|
||||||
@@ -281,7 +289,7 @@ init() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Normalize ID and set host-specific vars
|
# Normalize ID and set OS defaults
|
||||||
case $ID in
|
case $ID in
|
||||||
debian|fedora|centos) ;;
|
debian|fedora|centos) ;;
|
||||||
rhel|almalinux) ID="centos" ;;
|
rhel|almalinux) ID="centos" ;;
|
||||||
@@ -289,26 +297,26 @@ init() {
|
|||||||
raspbian) ID="debian" ;;
|
raspbian) ID="debian" ;;
|
||||||
*mandriva*) ID="mandriva"
|
*mandriva*) ID="mandriva"
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
debug "Automatically using --install=local for Mandriva"
|
debug "Automatically using --install=local for Mandriva."
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
LOCAL_INSTALL_SWITCH=1
|
LOCAL_INSTALL_SWITCH=1
|
||||||
fi ;;
|
fi ;;
|
||||||
manjaro|arch|cachyos) ID="arch"
|
manjaro|arch|cachyos) ID="arch"
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
debug "Automatically using --install=local for Arch"
|
debug "Automatically using --install=local for Arch."
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
LOCAL_INSTALL_SWITCH=1
|
LOCAL_INSTALL_SWITCH=1
|
||||||
fi ;;
|
fi ;;
|
||||||
*suse*) ID="suse"
|
*suse*) ID="suse"
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
debug "Automatically using --install=local for SUSE"
|
debug "Automatically using --install=local for SUSE."
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
LOCAL_INSTALL_SWITCH=1
|
LOCAL_INSTALL_SWITCH=1
|
||||||
fi ;;
|
fi ;;
|
||||||
*) err "Auto-detecting distro, this is unreliable and --compat may be required"
|
*) err "Auto-detecting OS, this is unreliable and --compat may be required."
|
||||||
for cmd in dnf yum apt-get pacman; do
|
for cmd in dnf yum apt-get pacman; do
|
||||||
if command -v "$cmd" &>/dev/null; then
|
if command -v "$cmd" &>/dev/null; then
|
||||||
case "$cmd" in
|
case "$cmd" in
|
||||||
@@ -324,7 +332,7 @@ init() {
|
|||||||
if [[ -z $ID ]]; then
|
if [[ -z $ID ]]; then
|
||||||
err "OS detection failed!"
|
err "OS detection failed!"
|
||||||
if ask_ok "Continue with manual installation?"; then
|
if ask_ok "Continue with manual installation?"; then
|
||||||
debug "Automatically using --install=local for unknown distro"
|
debug "Automatically using --install=local for unknown distro."
|
||||||
ID="unknown"
|
ID="unknown"
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
@@ -335,36 +343,36 @@ init() {
|
|||||||
fi ;;
|
fi ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Set distro-specific package manager commands for normalized IDs
|
# Set distro-specific package manager commands for normalized OS
|
||||||
case $ID in
|
case $ID in
|
||||||
fedora|centos|mandriva)
|
fedora|centos|mandriva)
|
||||||
local rpm_mgr
|
local rpm_mgr
|
||||||
rpm_mgr=$(command -v dnf &>/dev/null && echo "dnf" || echo "yum")
|
rpm_mgr=$(command -v dnf &>/dev/null && echo "dnf" || echo "yum")
|
||||||
PKG_INSTALL=(sudo "$rpm_mgr" install -y)
|
PKG_INSTALL=(sudo "$rpm_mgr" install --assumeyes)
|
||||||
PKG_REMOVE=(sudo "$rpm_mgr" remove -y)
|
PKG_REMOVE=(sudo "$rpm_mgr" remove --assumeyes)
|
||||||
PKG_UPDATE=(sudo "$rpm_mgr" makecache)
|
PKG_UPDATE=(sudo "$rpm_mgr" makecache --assumeyes)
|
||||||
PKG_QUERY=(rpm -q)
|
PKG_QUERY=(rpm -q)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
||||||
;;
|
;;
|
||||||
debian|ubuntu)
|
debian|ubuntu)
|
||||||
PKG_INSTALL=(sudo apt-get -f install --install-recommends -y -q0)
|
PKG_INSTALL=(sudo apt-get install --fix-broken --install-recommends --assume-yes)
|
||||||
PKG_REMOVE=(sudo apt-get remove --auto-remove -y -q0)
|
PKG_REMOVE=(sudo apt-get remove --auto-remove --assume-yes)
|
||||||
PKG_UPDATE=(sudo apt-get update -y -q0)
|
PKG_UPDATE=(sudo apt-get update --assume-yes)
|
||||||
PKG_QUERY=(dpkg -s)
|
PKG_QUERY=(dpkg -s)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_deb "$@"; }
|
PKG_INSTALL_LOCAL() { install_mc_deb "$@"; }
|
||||||
;;
|
;;
|
||||||
suse)
|
suse)
|
||||||
PKG_INSTALL=(sudo zypper --gpg-auto-import-keys --non-interactive --quiet install --force --force-resolution --replacefiles --no-confirm)
|
PKG_INSTALL=(sudo zypper --gpg-auto-import-keys --non-interactive install --force --force-resolution --replacefiles --no-confirm)
|
||||||
PKG_REMOVE=(sudo zypper --non-interactive --quiet remove --clean-deps)
|
PKG_REMOVE=(sudo zypper --non-interactive remove --clean-deps)
|
||||||
PKG_UPDATE=(sudo zypper --non-interactive --quiet refresh jriver)
|
PKG_UPDATE=(sudo zypper --non-interactive refresh jriver)
|
||||||
PKG_QUERY=(rpm -q)
|
PKG_QUERY=(rpm --query)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
||||||
;;
|
;;
|
||||||
arch)
|
arch)
|
||||||
PKG_INSTALL=(sudo pacman -Sy --noconfirm)
|
PKG_INSTALL=(sudo pacman --sync --refresh --noconfirm)
|
||||||
PKG_REMOVE=(sudo pacman -Rs --noconfirm)
|
PKG_REMOVE=(sudo pacman --remove --recursive --noconfirm)
|
||||||
PKG_UPDATE=(sudo pacman -Syy)
|
PKG_UPDATE=(sudo pacman --sync --refresh --refresh)
|
||||||
PKG_QUERY=(sudo pacman -Qs)
|
PKG_QUERY=(sudo pacman --query --search)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_arch; }
|
PKG_INSTALL_LOCAL() { install_mc_arch; }
|
||||||
;;
|
;;
|
||||||
unknown)
|
unknown)
|
||||||
@@ -380,30 +388,30 @@ init() {
|
|||||||
BUILD_TARGET="${BUILD_TARGET:-$ID}"
|
BUILD_TARGET="${BUILD_TARGET:-$ID}"
|
||||||
CREATEREPO_TARGET="${CREATEREPO_TARGET:-$ID}"
|
CREATEREPO_TARGET="${CREATEREPO_TARGET:-$ID}"
|
||||||
|
|
||||||
# Repo selection
|
# Repo selection (precedence: user > host (MC31+ debian/ubuntu) > hardcoded)
|
||||||
# Match repo to the host on MC31+ unless overriden by user
|
if [[ -n $MC_REPO_USER ]]; then
|
||||||
if [[ $ID =~ debian|ubuntu && "${USER_MC_MVERSION:-${MC_VERSION%%.*}}" -ge 31 ]]; then
|
MC_REPO="$MC_REPO_USER"
|
||||||
MC_REPO=${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO}}
|
elif [[ $ID =~ debian|ubuntu && "${MC_MVERSION_USER:-${MC_VERSION_HARDCODE%%.*}}" -ge 31 ]]; then
|
||||||
|
MC_REPO=${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO_HARDCODE}}
|
||||||
|
else
|
||||||
|
MC_REPO="$MC_REPO_HARDCODE"
|
||||||
fi
|
fi
|
||||||
MC_REPO="${USER_MC_REPO:-$MC_REPO}" # allow user override
|
|
||||||
|
|
||||||
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
|
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
|
||||||
|
|
||||||
# Retrieves the latest MC version number if we need it
|
set_mc_version
|
||||||
if ((BUILD_SWITCH || LOCAL_INSTALL_SWITCH || CREATEREPO_SWITCH)); then
|
|
||||||
get_latest_mc_version
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set MC version variables
|
echo "Selected MC version $MC_VERSION from the $MC_REPO repo (via $MC_VERSION_SOURCE)"
|
||||||
MC_VERSION="${USER_MC_VERSION:-$MC_VERSION}"
|
|
||||||
MC_RELEASE="${USER_MC_RELEASE:-1}"
|
# Set additional MC version variables
|
||||||
MC_MVERSION="${USER_MC_MVERSION:-${MC_VERSION%%.*}}"
|
MC_RELEASE="${MC_RELEASE_USER:-1}"
|
||||||
|
MC_MVERSION="${MC_MVERSION_USER:-${MC_VERSION%%.*}}"
|
||||||
MC_PKG="mediacenter$MC_MVERSION"
|
MC_PKG="mediacenter$MC_MVERSION"
|
||||||
MC_RPM="$OUTPUT_DIR/RPMS/$ARCH/mediacenter$MC_MVERSION-$MC_VERSION-$MC_RELEASE.$ARCH.rpm"
|
MC_RPM="$OUTPUT_DIR/RPMS/$ARCH/mediacenter$MC_MVERSION-$MC_VERSION-$MC_RELEASE.$ARCH.rpm"
|
||||||
MC_ROOT="/usr/lib/jriver/Media Center $MC_MVERSION"
|
MC_ROOT="/usr/lib/jriver/Media Center $MC_MVERSION"
|
||||||
|
|
||||||
# Generate explicit package name
|
# Generate explicit package name
|
||||||
if [[ -n $USER_MC_VERSION ]]; then
|
if [[ -n $MC_VERSION_USER ]]; then
|
||||||
# Append explicit package version when user provides --mcversion
|
# Append explicit package version when user provides --mcversion
|
||||||
case $ID in
|
case $ID in
|
||||||
fedora|centos|suse|mandriva) MC_PKG+="-$MC_VERSION" ;;
|
fedora|centos|suse|mandriva) MC_PKG+="-$MC_VERSION" ;;
|
||||||
@@ -413,30 +421,39 @@ init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# @description Determines the latest JRiver MC version using several methods
|
# @description Determines the latest JRiver MC version using several methods
|
||||||
get_latest_mc_version() {
|
set_mc_version() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
local mc_version_source
|
declare -g MC_VERSION MC_VERSION_SOURCE
|
||||||
|
|
||||||
# User --mcversion
|
if [[ -n $MC_VERSION_USER ]]; then
|
||||||
if [[ -n $USER_MC_VERSION ]]; then
|
MC_VERSION="$MC_VERSION_USER"
|
||||||
mc_version_source="user input"
|
MC_VERSION_SOURCE="user input"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Package manager will handle updates in other instances
|
||||||
|
if ! ((BUILD_SWITCH || LOCAL_INSTALL_SWITCH || CREATEREPO_SWITCH)); then
|
||||||
|
MC_VERSION="$MC_VERSION_HARDCODE"
|
||||||
|
MC_VERSION_SOURCE="hardcoded"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine latest version
|
||||||
# Containerized package manager
|
# Containerized package manager
|
||||||
elif create_mc_apt_container &&
|
if create_mc_apt_container &&
|
||||||
MC_VERSION=$(sudo buildah run "$CNT" -- apt-cache policy "mediacenter${USER_MC_MVERSION:-${MC_VERSION%%.*}}" | awk '/Candidate:/ {sub(/-.*/, "", $2); print $2}' | sort -V | tail -n1) &&
|
MC_VERSION=$(buildah run "$CNT" -- apt-cache policy "mediacenter${MC_MVERSION_USER:-${MC_VERSION_HARDCODE%%.*}}" | awk '/Candidate:/ {sub(/-.*/, "", $2); print $2}' | sort -V | tail -n1) &&
|
||||||
execute sudo buildah rm "$CNT" &&
|
buildah rm "$CNT" &>/dev/null &&
|
||||||
[[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
[[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
mc_version_source="containerized package manager"
|
MC_VERSION_SOURCE="containerized package manager"
|
||||||
# Fallback to webscrape
|
# Fallback to webscrape
|
||||||
elif MC_VERSION=$(download "https://yabb.jriver.com/interact/index.php/board,$BOARD_ID.html" "-" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1) &&
|
elif MC_VERSION=$(download "https://yabb.jriver.com/interact/index.php/board,$BOARD_ID.html" "-" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1) &&
|
||||||
[[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
[[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
mc_version_source="webscrape"
|
MC_VERSION_SOURCE="webscrape"
|
||||||
# Fallback to hardcoded value
|
# Fallback to hardcoded value
|
||||||
else
|
else
|
||||||
mc_version_source="hardcoded"
|
MC_VERSION="$MC_VERSION_HARDCODE"
|
||||||
echo "Warning! Using hardcoded version number"
|
MC_VERSION_SOURCE="hardcoded"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Selected MC version $MC_VERSION from the $MC_REPO repo (via $mc_version_source)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Installs a package using the system package manager
|
# @description Installs a package using the system package manager
|
||||||
@@ -470,7 +487,7 @@ install_package() {
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# Define distribution-specific package aliases
|
# Distribution-specific package aliases
|
||||||
case $ID in
|
case $ID in
|
||||||
debian|ubuntu) pkg_aliases=(
|
debian|ubuntu) pkg_aliases=(
|
||||||
[rpm-build]="rpm"
|
[rpm-build]="rpm"
|
||||||
@@ -503,7 +520,7 @@ install_package() {
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
# Generate installation flags based on the distribution
|
# Add OS install flags to package manager command
|
||||||
case $ID in
|
case $ID in
|
||||||
debian|ubuntu)
|
debian|ubuntu)
|
||||||
((allow_downgrades)) && install_flags+=(--allow-downgrades)
|
((allow_downgrades)) && install_flags+=(--allow-downgrades)
|
||||||
@@ -512,15 +529,13 @@ install_package() {
|
|||||||
((allow_downgrades)) && install_flags+=(--allowerasing)
|
((allow_downgrades)) && install_flags+=(--allowerasing)
|
||||||
((no_gpg_check)) && install_flags+=(--nogpgcheck)
|
((no_gpg_check)) && install_flags+=(--nogpgcheck)
|
||||||
((refresh)) && install_flags+=(--refresh)
|
((refresh)) && install_flags+=(--refresh)
|
||||||
# Only add reinstall flag for mediacenter package
|
|
||||||
if ((reinstall)) && [[ ${#pkg_array[@]} -eq 1 ]] && "${PKG_QUERY[@]}" "mediacenter$MC_MVERSION" &>/dev/null; then
|
|
||||||
pkg_install=("${pkg_install[@]/install/reinstall}")
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
suse)
|
suse)
|
||||||
((no_gpg_check)) && install_flags+=(--allow-unsigned-rpm) ;;
|
((no_gpg_check)) && install_flags+=(--allow-unsigned-rpm) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
((silent)) && install_flags+=(--quiet)
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
if [[ ${#pkg_array[@]} -gt 0 ]]; then
|
if [[ ${#pkg_array[@]} -gt 0 ]]; then
|
||||||
if ! execute "${pkg_install[@]}" "${install_flags[@]}" "${pkg_array[@]}"; then
|
if ! execute "${pkg_install[@]}" "${install_flags[@]}" "${pkg_array[@]}"; then
|
||||||
@@ -688,7 +703,16 @@ install_mc_repo() {
|
|||||||
err "Failed to add temporary repository"
|
err "Failed to add temporary repository"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; }
|
|
||||||
|
# Update package lists
|
||||||
|
if ! execute "${PKG_UPDATE[@]}"; then
|
||||||
|
err "Package update failed!"
|
||||||
|
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]] &&
|
||||||
|
ask_ok "Re-run installJRMC with --mcrepo=$MC_REPO_HARDCODE?"; then
|
||||||
|
exec "$SCRIPT_PATH" "$@" "--no-update" "--mcrepo=$MC_REPO_HARDCODE"
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Installing $MC_PKG package"
|
echo "Installing $MC_PKG package"
|
||||||
if ! install_package \
|
if ! install_package \
|
||||||
@@ -715,7 +739,7 @@ install_mc_repo() {
|
|||||||
acquire_deb() {
|
acquire_deb() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
declare -g MC_DEB MC_SOURCE
|
declare -g MC_DEB MC_SOURCE
|
||||||
local fname mnt
|
local fname
|
||||||
|
|
||||||
[[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES"
|
[[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES"
|
||||||
|
|
||||||
@@ -730,10 +754,10 @@ acquire_deb() {
|
|||||||
MC_DEB="$OUTPUT_DIR/SOURCES/$fname"
|
MC_DEB="$OUTPUT_DIR/SOURCES/$fname"
|
||||||
MC_SOURCE="https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname"
|
MC_SOURCE="https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname"
|
||||||
|
|
||||||
# If deb file already exists, skip download
|
# If deb file already exists and is >30MB, skip download
|
||||||
if [[ -f $MC_DEB ]]; then
|
if [[ -f $MC_DEB ]]; then
|
||||||
if [[ $(stat -c%s "$MC_DEB") -lt 10000000 ]]; then
|
if [[ $(stat -c%s "$MC_DEB") -lt 30000000 ]]; then
|
||||||
echo "Removing existing DEB under 10MB: $MC_DEB"
|
echo "Removing existing DEB under 30MB: $MC_DEB"
|
||||||
execute rm -f "$MC_DEB"
|
execute rm -f "$MC_DEB"
|
||||||
else
|
else
|
||||||
echo "Using existing DEB: $MC_DEB"
|
echo "Using existing DEB: $MC_DEB"
|
||||||
@@ -742,12 +766,18 @@ acquire_deb() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Download the deb file using the containerized package manager
|
# Download the deb file using the containerized package manager
|
||||||
if ! { create_mc_apt_container "apt-get download --allow-unauthenticated mediacenter$MC_MVERSION &>/dev/null" &&
|
# shellcheck disable=SC2016
|
||||||
mnt="$(sudo buildah mount "$CNT")" &&
|
if ! {
|
||||||
execute sudo find "$mnt" -maxdepth 1 -type f -name "*.deb" -exec cp {} "$MC_DEB" \; &&
|
# Download to /tmp to silence _apt permission warnings
|
||||||
|
create_mc_apt_container "cd /tmp && apt-get download --allow-unauthenticated mediacenter$MC_MVERSION -qq" &&
|
||||||
|
env CNT="$CNT" MC_DEB="$MC_DEB" buildah unshare -- bash -eu -o pipefail -c '
|
||||||
|
mnt="$(buildah mount "$CNT")"
|
||||||
|
deb="$(find "$mnt/tmp" -maxdepth 1 -type f -name "*.deb" | head -n1)"
|
||||||
|
[[ -n "$deb" ]] && cp -f "$deb" "$MC_DEB"
|
||||||
|
buildah umount "$CNT"' &&
|
||||||
[[ -f $MC_DEB ]] &&
|
[[ -f $MC_DEB ]] &&
|
||||||
execute sudo buildah umount "$CNT" &&
|
buildah rm "$CNT" &>/dev/null;
|
||||||
execute sudo buildah rm "$CNT"; }; then
|
}; then
|
||||||
debug "Failed to download DEB using containerized package manager"
|
debug "Failed to download DEB using containerized package manager"
|
||||||
echo "Using legacy download method"
|
echo "Using legacy download method"
|
||||||
# Define the repository search order
|
# Define the repository search order
|
||||||
@@ -777,8 +807,8 @@ acquire_deb() {
|
|||||||
translate_packages() {
|
translate_packages() {
|
||||||
debug "${FUNCNAME[0]}()" "$*"
|
debug "${FUNCNAME[0]}()" "$*"
|
||||||
local deb_file="$1"
|
local deb_file="$1"
|
||||||
declare -n requires_arr="$2"
|
# shellcheck disable=SC2178
|
||||||
declare -n recommends_arr="$3"
|
declare -n requires_arr="$2" recommends_arr="$3"
|
||||||
local -i i
|
local -i i
|
||||||
|
|
||||||
# Load deb dependencies into array
|
# Load deb dependencies into array
|
||||||
@@ -843,6 +873,7 @@ translate_packages() {
|
|||||||
recommends_arr+=("mesa-vdpau-driver-freeworld|mesa-vdpau-driver")
|
recommends_arr+=("mesa-vdpau-driver-freeworld|mesa-vdpau-driver")
|
||||||
;;
|
;;
|
||||||
suse)
|
suse)
|
||||||
|
requires_arr=("${requires_arr[@]/python*/python3}")
|
||||||
requires_arr=("${requires_arr[@]/libc6/glibc}")
|
requires_arr=("${requires_arr[@]/libc6/glibc}")
|
||||||
requires_arr=("${requires_arr[@]/libasound2/alsa-lib}")
|
requires_arr=("${requires_arr[@]/libasound2/alsa-lib}")
|
||||||
requires_arr=("${requires_arr[@]/libx11-6/libX11-6}")
|
requires_arr=("${requires_arr[@]/libx11-6/libX11-6}")
|
||||||
@@ -914,16 +945,15 @@ translate_packages() {
|
|||||||
recommends_arr=('mesa-libgl' 'nvidia-libgl' 'nvidia-utils' 'vulkan-intel'
|
recommends_arr=('mesa-libgl' 'nvidia-libgl' 'nvidia-utils' 'vulkan-intel'
|
||||||
'vulkan-radeon' 'vorbis-tools' 'musepack-tools')
|
'vulkan-radeon' 'vorbis-tools' 'musepack-tools')
|
||||||
;;
|
;;
|
||||||
*)
|
*) echo "Skipping package translations for $ID" ;;
|
||||||
echo "Skipping package translations for $ID"
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Creates a SPEC file and builds the RPM from the source DEB using rpmbuild
|
# @description Creates an RPM .spec file and builds the RPM from the source DEB using rpmbuild
|
||||||
build_rpm() {
|
build_rpm() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
declare -n requires_arr="$1"
|
# shellcheck disable=SC2178
|
||||||
declare -n recommends_arr="$2"
|
declare -n requires_arr="$1" recommends_arr="$2"
|
||||||
local requires_str recommends_str
|
local requires_str recommends_str
|
||||||
local i rpmbuild_cmd stub
|
local i rpmbuild_cmd stub
|
||||||
local spec_file="$OUTPUT_DIR/SPECS/mediacenter$MC_MVERSION-$MC_VERSION-$MC_RELEASE-$BUILD_TARGET-$ARCH.spec"
|
local spec_file="$OUTPUT_DIR/SPECS/mediacenter$MC_MVERSION-$MC_VERSION-$MC_RELEASE-$BUILD_TARGET-$ARCH.spec"
|
||||||
@@ -948,6 +978,9 @@ build_rpm() {
|
|||||||
# Convert array to newline delim'd string (for heredoc)
|
# Convert array to newline delim'd string (for heredoc)
|
||||||
printf -v requires_str "Requires: %s\n" "${requires_arr[@]}"
|
printf -v requires_str "Requires: %s\n" "${requires_arr[@]}"
|
||||||
printf -v recommends_str "Recommends: %s\n" "${recommends_arr[@]}"
|
printf -v recommends_str "Recommends: %s\n" "${recommends_arr[@]}"
|
||||||
|
|
||||||
|
unset requires_arr recommends_arr
|
||||||
|
|
||||||
# Strip last newline
|
# Strip last newline
|
||||||
requires_str="${requires_str%?}"
|
requires_str="${requires_str%?}"
|
||||||
recommends_str="${recommends_str%?}"
|
recommends_str="${recommends_str%?}"
|
||||||
@@ -964,27 +997,26 @@ build_rpm() {
|
|||||||
Release: $MC_RELEASE
|
Release: $MC_RELEASE
|
||||||
Summary: JRiver Media Center
|
Summary: JRiver Media Center
|
||||||
Group: Applications/Media
|
Group: Applications/Media
|
||||||
|
License: LicenseRef-JRiver-Proprietary
|
||||||
|
URL: https://www.jriver.com/
|
||||||
Source0: $MC_SOURCE
|
Source0: $MC_SOURCE
|
||||||
%define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}-%%{release}.%%{ARCH}.rpm
|
|
||||||
|
|
||||||
AutoReq: 0
|
BuildArch: $ARCH
|
||||||
|
|
||||||
|
%global _rpmfilename %%{ARCH}/%%{NAME}-%%{version}-%%{release}.%%{ARCH}.rpm
|
||||||
|
|
||||||
|
AutoReqProv: no
|
||||||
|
|
||||||
$requires_str
|
$requires_str
|
||||||
$recommends_str
|
$recommends_str
|
||||||
|
|
||||||
Conflicts: MediaCenter
|
|
||||||
|
|
||||||
Provides: mediacenter$MC_MVERSION
|
Provides: mediacenter$MC_MVERSION
|
||||||
|
|
||||||
License: Copyright 1998-$(date +%Y), JRiver, Inc. All rights reserved. Protected by U.S. patents #7076468 and #7062468
|
|
||||||
URL: https://www.jriver.com/
|
|
||||||
|
|
||||||
%define __provides_exclude_from ^%{_libdir}/jriver/.*/.*\\.so.*$
|
%define __provides_exclude_from ^%{_libdir}/jriver/.*/.*\\.so.*$
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Media Center is more than a world class player.
|
Media Center is more than a world class player.
|
||||||
|
|
||||||
%global __os_install_post %{nil}
|
|
||||||
%prep
|
%prep
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@@ -992,9 +1024,6 @@ build_rpm() {
|
|||||||
%install
|
%install
|
||||||
dpkg -x %{S:0} %{buildroot}
|
dpkg -x %{S:0} %{buildroot}
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
|
||||||
%postun -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_bindir}/mediacenter$MC_MVERSION
|
%{_bindir}/mediacenter$MC_MVERSION
|
||||||
$stub
|
$stub
|
||||||
@@ -1014,14 +1043,16 @@ build_rpm() {
|
|||||||
-bb
|
-bb
|
||||||
"$spec_file"
|
"$spec_file"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Run rpmbuild and verify output RPM exists
|
||||||
execute "${rpmbuild_cmd[@]}" && [[ -f $MC_RPM ]]
|
execute "${rpmbuild_cmd[@]}" && [[ -f $MC_RPM ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Creates the Arch PKGBUILD file for Media Center
|
# @description Creates the Arch PKGBUILD file for Media Center
|
||||||
build_pkgbuild() {
|
build_pkgbuild() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
declare -n requires_arr="$1"
|
# shellcheck disable=SC2178
|
||||||
declare -n recommends_arr="$2"
|
declare -n requires_arr="$1" recommends_arr="$2"
|
||||||
local pkgbuild_file="$OUTPUT_DIR/PKGBUILD/mediacenter.pkgbuild"
|
local pkgbuild_file="$OUTPUT_DIR/PKGBUILD/mediacenter.pkgbuild"
|
||||||
|
|
||||||
[[ -d $OUTPUT_DIR/PKGBUILD ]] || execute mkdir -p "$OUTPUT_DIR/PKGBUILD"
|
[[ -d $OUTPUT_DIR/PKGBUILD ]] || execute mkdir -p "$OUTPUT_DIR/PKGBUILD"
|
||||||
@@ -1044,6 +1075,7 @@ build_pkgbuild() {
|
|||||||
bsdtar xf data.tar.xz -C "\$pkgdir"
|
bsdtar xf data.tar.xz -C "\$pkgdir"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
unset requires_arr recommends_arr
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Installs Media Center via DEB package w/ optional compatability fixes
|
# @description Installs Media Center via DEB package w/ optional compatability fixes
|
||||||
@@ -1100,7 +1132,7 @@ install_mc_deb() {
|
|||||||
--reinstall \
|
--reinstall \
|
||||||
"$temp_deb"; then
|
"$temp_deb"; then
|
||||||
err "Local MC DEB installation failed"
|
err "Local MC DEB installation failed"
|
||||||
if ask_ok "Remove source DEB and retry"; then
|
if ask_ok "Remove source DEB and retry?"; then
|
||||||
execute sudo rm -f "$MC_DEB" "$temp_deb"
|
execute sudo rm -f "$MC_DEB" "$temp_deb"
|
||||||
exec "$SCRIPT_PATH" "$@" "--no-update"
|
exec "$SCRIPT_PATH" "$@" "--no-update"
|
||||||
fi
|
fi
|
||||||
@@ -1116,7 +1148,7 @@ install_mc_deb() {
|
|||||||
# @description Installs MC via RPM package
|
# @description Installs MC via RPM package
|
||||||
install_mc_rpm() {
|
install_mc_rpm() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
install_package --no-install-check --no-gpg-check --allow-downgrades --reinstall "$MC_RPM"
|
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Installs Media Center generically for unsupported OSes
|
# @description Installs Media Center generically for unsupported OSes
|
||||||
@@ -1197,10 +1229,10 @@ run_createrepo() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run createrepo
|
# Run createrepo
|
||||||
local -a cr_opts=(-q "$CREATEREPO_WEBROOT")
|
local -a cr_opts=(--update)
|
||||||
# [[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_opts+=(--update) # TODO temporarily disabled for legacy createrepo
|
# [[ -d "$CREATEREPO_WEBROOT/repodata" ]] && cr_opts+=(--update) # TODO temporarily disabled for legacy createrepo
|
||||||
if ! execute sudo -u "$CREATEREPO_USER" createrepo "${cr_opts[@]}"; then
|
if ! execute sudo -u "$CREATEREPO_USER" createrepo "${cr_opts[@]}" "$CREATEREPO_WEBROOT"; then
|
||||||
if ! (execute sudo createrepo "${cr_opts[@]}" && execute sudo chown -R "$CREATEREPO_USER:$CREATEREPO_USER" "$CREATEREPO_WEBROOT"); then
|
if ! (execute sudo createrepo "${cr_opts[@]}" "$CREATEREPO_WEBROOT" && execute sudo chown -R "$CREATEREPO_USER:$CREATEREPO_USER" "$CREATEREPO_WEBROOT"); then
|
||||||
err "createrepo failed"
|
err "createrepo failed"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -1636,7 +1668,7 @@ uninstall() {
|
|||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
local service type unit f
|
local service type unit f
|
||||||
|
|
||||||
if ! ask_ok "Do you really want to uninstall JRiver Media Center?"; then
|
if ! ask_ok "Uninstall JRiver Media Center, services, and firewall rules?"; then
|
||||||
echo "Uninstall cancelled"
|
echo "Uninstall cancelled"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -1724,7 +1756,7 @@ uninstall() {
|
|||||||
echo "To restore your MC library: mv $HOME/.jriver.bk $HOME/.jriver"
|
echo "To restore your MC library: mv $HOME/.jriver.bk $HOME/.jriver"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
echo "To reset and backup your MC library: mv $HOME/.jriver $HOME/.jriver.bk"
|
echo "To backup and reset your MC library: mv $HOME/.jriver $HOME/.jriver.bk"
|
||||||
echo "To remove your MC library: rm -rf $HOME/.jriver"
|
echo "To remove your MC library: rm -rf $HOME/.jriver"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1841,7 +1873,7 @@ main() {
|
|||||||
|
|
||||||
if ((REPO_INSTALL_SWITCH)); then
|
if ((REPO_INSTALL_SWITCH)); then
|
||||||
echo "Installing JRiver Media Center from remote repository"
|
echo "Installing JRiver Media Center from remote repository"
|
||||||
if install_mc_repo; then
|
if install_mc_repo "$@"; then
|
||||||
echo "JRiver Media Center installed successfully from remote repository"
|
echo "JRiver Media Center installed successfully from remote repository"
|
||||||
install_mesa_freeworld
|
install_mesa_freeworld
|
||||||
link_ssl_certs
|
link_ssl_certs
|
||||||
@@ -1856,7 +1888,7 @@ main() {
|
|||||||
if ((BUILD_SWITCH)); then
|
if ((BUILD_SWITCH)); then
|
||||||
acquire_deb || { err "Could not download Media Center DEB package"; return 1; }
|
acquire_deb || { err "Could not download Media Center DEB package"; return 1; }
|
||||||
|
|
||||||
# Convert the source DEB dependencies to various distro-specific package naming
|
# Convert the source DEB dependencies to various distro-specific packages
|
||||||
install_package dpkg
|
install_package dpkg
|
||||||
translate_packages "$MC_DEB" requires recommends
|
translate_packages "$MC_DEB" requires recommends
|
||||||
|
|
||||||
@@ -1923,6 +1955,7 @@ main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# @section Helper functions
|
# @section Helper functions
|
||||||
|
# @internal
|
||||||
debug() { ((DEBUG)) && echo "Debug: $*"; }
|
debug() { ((DEBUG)) && echo "Debug: $*"; }
|
||||||
err() { echo "Error: $*" >&2; }
|
err() { echo "Error: $*" >&2; }
|
||||||
ask_ok() {
|
ask_ok() {
|
||||||
@@ -1957,14 +1990,14 @@ download() {
|
|||||||
local url="$1"
|
local url="$1"
|
||||||
local output="${2:-}"
|
local output="${2:-}"
|
||||||
local -a cmd
|
local -a cmd
|
||||||
if command -v curl &>/dev/null || install_package --silent curl; then
|
if command -v curl &>/dev/null || install_package curl; then
|
||||||
cmd=(curl --silent --fail --location)
|
cmd=(curl --silent --fail --location)
|
||||||
if [[ -n "$output" ]]; then
|
if [[ -n "$output" ]]; then
|
||||||
cmd+=(--output "$output")
|
cmd+=(--output "$output")
|
||||||
else
|
else
|
||||||
cmd+=(--remote-name)
|
cmd+=(--remote-name)
|
||||||
fi
|
fi
|
||||||
elif command -v wget &>/dev/null || install_package --silent wget; then
|
elif command -v wget &>/dev/null || install_package wget; then
|
||||||
cmd=(wget --quiet)
|
cmd=(wget --quiet)
|
||||||
[[ -n "$output" ]] && cmd+=("--output-document=$output")
|
[[ -n "$output" ]] && cmd+=("--output-document=$output")
|
||||||
else
|
else
|
||||||
@@ -1978,23 +2011,24 @@ create_mc_apt_container() {
|
|||||||
debug "${FUNCNAME[0]}()" "$@"
|
debug "${FUNCNAME[0]}()" "$@"
|
||||||
declare -g CNT
|
declare -g CNT
|
||||||
local -a cmds=("$@")
|
local -a cmds=("$@")
|
||||||
{ command -v buildah &>/dev/null || install_package buildah &>/dev/null; } &&
|
# shellcheck disable=SC2016
|
||||||
CNT=$(sudo buildah from --quiet alpine:edge) &&
|
{ command -v buildah &>/dev/null || install_package buildah; } &&
|
||||||
sudo buildah run "$CNT" -- sh -c '
|
CNT=$(buildah from --quiet alpine:edge) &&
|
||||||
apk add --no-cache apt curl gnupg &>/dev/null
|
buildah run --env MC_REPO="$MC_REPO" --env MC_ARCH="$MC_ARCH" "$CNT" -- sh -c '
|
||||||
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.key | gpg --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg &>/dev/null
|
apk add --quiet --no-progress --no-cache apt curl gnupg
|
||||||
|
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.key | gpg --quiet --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg
|
||||||
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
|
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://dist.jriver.com/latest/mediacenter/
|
URIs: https://dist.jriver.com/latest/mediacenter/
|
||||||
Signed-By: /usr/share/keyrings/jriver-com-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/jriver-com-archive-keyring.gpg
|
||||||
Suites: '"$MC_REPO"'
|
Suites: $MC_REPO
|
||||||
Components: main
|
Components: main
|
||||||
Architectures: '"$MC_ARCH"'
|
Architectures: $MC_ARCH
|
||||||
EOF
|
EOF
|
||||||
apt-get update &>/dev/null' &&
|
apt-get update -qq' &&
|
||||||
# If user passes command strings run them in the container
|
# If user passes command strings run them in the container
|
||||||
for cmd in "${cmds[@]}"; do
|
for cmd in "${cmds[@]}"; do
|
||||||
sudo buildah run "$CNT" -- sh -c "$cmd" || { err "$cmd failed"; return 1; }
|
buildah run "$CNT" -- sh -c "$cmd" || { err "$cmd failed"; return 1; }
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
add_temp_repo() {
|
add_temp_repo() {
|
||||||
|
|||||||
Reference in New Issue
Block a user