4 Commits

Author SHA1 Message Date
c7cb45dfa5 createrepo implies build and this was ugly 2021-12-05 13:49:49 -05:00
3f21dae6e1 Disallow repo install on SUSE for now 2021-12-05 13:44:59 -05:00
07cc841252 Allow RPM croosbuilding 2021-12-05 13:39:46 -05:00
d94081b7b4 Cleanup requires 2021-12-05 13:16:48 -05:00
2 changed files with 86 additions and 27 deletions

View File

@@ -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) rpm: Build and install MC locally (RPM-based OSes only)
--build --build
Build RPM from source DEB (no installation) Build RPM from source DEB (no installation)
--build-suse
Override OS detection and build SUSE RPM
--mcversion VERSION --mcversion VERSION
Build or install a specific MC version, ex. "28.0.25" Build or install a specific MC version, ex. "28.0.25"
--outputdir PATH --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) Install systemd services and containers for user USER (Default: executing user)
--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
Build rpm, copy to webroot, and run createrepo Build rpm, copy to webroot, and run createrepo
--createrepo-suse
Override OS detection and run --createrepo with SUSE RPM
--createrepo-webroot PATH --createrepo-webroot PATH
The webroot directory to install the repo (Default: /srv/jriver/) The webroot directory to install the repo (Default: /srv/jriver/)
--createrepo-user USER --createrepo-user USER

View File

@@ -20,7 +20,7 @@
shopt -s extglob shopt -s extglob
_scriptversion="1.0b3" _scriptversion="1.0b4"
_outputdir="$PWD/output" _outputdir="$PWD/output"
_createrepo_webroot="/var/www/jriver" _createrepo_webroot="/var/www/jriver"
_exec_user="$(whoami)" _exec_user="$(whoami)"
@@ -44,6 +44,8 @@ printHelp() {
rpm: Build and install RPM locally (RPM-based distros only) rpm: Build and install RPM locally (RPM-based distros only)
--build --build
Build RPM from source DEB (but don't install it) Build RPM from source DEB (but don't install it)
--build-suse
Override OS detection and build SUSE RPM
--mcversion VERSION --mcversion VERSION
Specify the MC version, ex. "28.0.25" (Default: latest version) Specify the MC version, ex. "28.0.25" (Default: latest version)
--outputdir PATH --outputdir PATH
@@ -64,6 +66,8 @@ printHelp() {
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 (Default: current user) The web server user (Default: current user)
--createrepo-suse
Override OS detection and run --createrepo with SUSE RPM
--version, -v --version, -v
Print this script version and exit Print this script version and exit
--debug, -d --debug, -d
@@ -136,7 +140,6 @@ init() {
pkg_query(){ ifSudo dpkg -s "$@"; } pkg_query(){ ifSudo dpkg -s "$@"; }
firewall_cmd(){ ifSudo ufw "$@"; } firewall_cmd(){ ifSudo ufw "$@"; }
elif [[ "$ID" =~ ^opensuse.* ]]; then elif [[ "$ID" =~ ^opensuse.* ]]; then
echo "SUSE support is experimental!"
pkg_install(){ ifSudo zypper --non-interactive -q install --force --no-confirm "$@"; } pkg_install(){ ifSudo zypper --non-interactive -q install --force --no-confirm "$@"; }
pkg_remove(){ ifSudo zypper --non-interactive -q remove --clean-deps "$@"; } pkg_remove(){ ifSudo zypper --non-interactive -q remove --clean-deps "$@"; }
pkg_update(){ ifSudo zypper --non-interactive -q refresh jriver; } pkg_update(){ ifSudo zypper --non-interactive -q refresh jriver; }
@@ -233,7 +236,7 @@ parseInput() {
_install="repo" _install="repo"
fi 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" eval set -- "$_input"
while true; do while true; do
case "$1" in case "$1" in
@@ -251,6 +254,10 @@ parseInput() {
--build) --build)
_build=true _build=true
;; ;;
--build-suse)
_build=true
_build_suse=true
;;
--outputdir) --outputdir)
shift && _outputdir="$1" shift && _outputdir="$1"
;; ;;
@@ -273,6 +280,11 @@ parseInput() {
_build=true _build=true
_createrepo=true _createrepo=true
;; ;;
--createrepo-suse)
_build=true
_build_suse=true
_createrepo=true
;;
--createrepo-webroot) --createrepo-webroot)
shift && _createrepo_webroot="$1" shift && _createrepo_webroot="$1"
;; ;;
@@ -341,7 +353,7 @@ getLatestVersion() {
# This can be overriden w/ --mcversion # This can be overriden w/ --mcversion
# TODO need user input here # TODO need user input here
# disable version checks for createrepo or rpmbuild (servers) # 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 if [[ "$ID" == "ubuntu" ]]; then
# [[ "$VERSION_CODENAME" =~ ^(focal|groovy|hirsute|impish)$ ]] && \ # [[ "$VERSION_CODENAME" =~ ^(focal|groovy|hirsute|impish)$ ]] && \
# _base="bullseye" # _base="bullseye"
@@ -585,7 +597,7 @@ acquireDeb() {
buildRPM() { buildRPM() {
debug "Running: ${FUNCNAME[0]}" 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" 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' _build_requires=$'BuildRequires: rpm >= 4.11.0\nBuildRequires: dpkg'
fi fi
# If you are building on SUSE, I assume you want SUSE RPMs read -r -d '' _global_requires <<- 'EOF'
# i.e. cross-building not an option but could be added Requires: glibc >= 2.28
if [[ "$ID" =~ ^opensuse.*$ ]]; then Requires: alsa-lib >= 1.1.8
_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' 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 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 fi
debug "Requires: $_requires" #debug "Requires: $_requires"
# Create spec file # Create spec file
cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec" cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec"
@@ -629,26 +689,16 @@ buildRPM() {
%define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}.%%{ARCH}.rpm %define _rpmfilename %%{ARCH}/%%{NAME}-%%{version}.%%{ARCH}.rpm
AutoReq: 0 AutoReq: 0
Requires: glibc >= 2.28
Requires: alsa-lib >= 1.1.8 ${_global_requires:-}
Requires: gtk3 >= 3.24 ${_custom_requires:-}
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:-}
Recommends: vorbis-tools >= 1.4.0 Recommends: vorbis-tools >= 1.4.0
Recommends: lame >= 3.0 Recommends: lame >= 3.0
Provides: mediacenter$_mversion 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/ URL: http://www.jriver.com/
%define __provides_exclude_from ^%{_libdir}/jriver/.*/.*\\.so.*$ %define __provides_exclude_from ^%{_libdir}/jriver/.*/.*\\.so.*$
@@ -1287,6 +1337,11 @@ main() {
# Install MC using package manager # Install MC using package manager
if [[ -v _install && "$_install" == "repo" ]]; then 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 if installMCFromRepo; then
echo "JRiver Media Center installed successfully" echo "JRiver Media Center installed successfully"
else else
@@ -1303,8 +1358,7 @@ main() {
acquireDeb acquireDeb
if ! buildRPM; then if ! buildRPM; then
err "Build failed." err "Build failed."
# In case this is automated, let's remove the source DEB and reaquire # For automation, let's remove the source DEB and reaquire it on next run in case it is corrupted or buggy
# it on next run in case it is corrupted or buggy
[[ -f "$DEBFILENAME" ]] && echo "Removing source DEB" && rm -f "$DEBFILENAME" [[ -f "$DEBFILENAME" ]] && echo "Removing source DEB" && rm -f "$DEBFILENAME"
exit 1 exit 1
fi fi