Compare commits
9 Commits
eb085ef529
...
d6e9ec6501
| Author | SHA1 | Date | |
|---|---|---|---|
| d6e9ec6501 | |||
| 99746aecd0 | |||
| cab6122d25 | |||
| 51a426c66b | |||
| 5ccc7f1604 | |||
| a1892c5a25 | |||
| f6af090431 | |||
| b64bbf3ccd | |||
| 46a024590a |
@@ -1,13 +0,0 @@
|
||||
cmd: 'echo "Pick a command (see .atom-build.yml)"'
|
||||
name: ''
|
||||
targets:
|
||||
# Fedora
|
||||
Run silently in Fedora:
|
||||
cmd: 'podmanRun -o "--rm --name=installJRMC_{FILE_ACTIVE_NAME_BASE} -v={FILE_ACTIVE_PATH}:{FILE_ACTIVE_PATH}:z -w {FILE_ACTIVE_PATH} fedora:latest {FILE_ACTIVE}'
|
||||
Run debug in Fedora:
|
||||
cmd: 'podmanRun -o "--rm --name=installJRMC_{FILE_ACTIVE_NAME_BASE} -v={FILE_ACTIVE_PATH}:{FILE_ACTIVE_PATH}:z -w {FILE_ACTIVE_PATH} fedora:latest {FILE_ACTIVE} --debug'
|
||||
# Ubuntu
|
||||
Run rpmbuild in Ubuntu:
|
||||
cmd: 'podmanRun -o "--rm --name=installJRMC_{FILE_ACTIVE_NAME_BASE} -v={FILE_ACTIVE_PATH}:{FILE_ACTIVE_PATH}:z -w {FILE_ACTIVE_PATH} ubuntu:latest {FILE_ACTIVE} --rpmbuild'
|
||||
Run createrepo in Ubuntu:
|
||||
cmd: 'podmanRun -o "--rm --name=installJRMC_{FILE_ACTIVE_NAME_BASE} -v={FILE_ACTIVE_PATH}:{FILE_ACTIVE_PATH}:z -w {FILE_ACTIVE_PATH} ubuntu:latest {FILE_ACTIVE} --createrepo'
|
||||
43
installJRMC
43
installJRMC
@@ -20,7 +20,7 @@
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
_scriptversion="1.0b1"
|
||||
_scriptversion="1.0b2"
|
||||
_outputdir="$PWD/output"
|
||||
_createrepo_webroot="/var/www/jriver"
|
||||
_exec_user="$(whoami)"
|
||||
@@ -105,8 +105,6 @@ init() {
|
||||
|
||||
getOS
|
||||
|
||||
|
||||
|
||||
# Make sure universe repo is installed on Ubuntu
|
||||
if [[ "$ID" == "ubuntu" ]]; then
|
||||
if ! grep ^deb /etc/apt/sources.list|grep -q universe; then
|
||||
@@ -141,10 +139,10 @@ init() {
|
||||
firewall_cmd(){ ifSudo ufw "$@"; }
|
||||
elif [[ "$ID" =~ ^opensuse.* ]]; then
|
||||
echo "SUSE support is experimental!"
|
||||
pkg_install(){ ifSudo zypper install -y -q "$@"; }
|
||||
pkg_reinstall(){ ifSudo zypper install -y -q -f "$@"; }
|
||||
pkg_remove(){ ifSudo zypper remove --clean-deps -y -q "$@"; }
|
||||
pkg_update(){ ifSudo zypper update -y -q; }
|
||||
pkg_install(){ ifSudo zypper --non-interactive -q install "$@"; }
|
||||
pkg_reinstall(){ ifSudo zypper --non-interactive -q install -f "$@"; }
|
||||
pkg_remove(){ ifSudo zypper --non-interactive -q remove --clean-deps "$@"; }
|
||||
pkg_update(){ ifSudo zypper --non-interactive -q refresh; }
|
||||
pkg_query(){ ifSudo rpm -q "$@"; }
|
||||
firewall_cmd(){ ifSudo firewall-cmd "$@"; }
|
||||
fi
|
||||
@@ -336,16 +334,17 @@ getLatestVersion() {
|
||||
|
||||
# Latest defaults
|
||||
_base="buster" # For container method
|
||||
_boardurl="https://yabb.jriver.com/interact/index.php/board,71.0.html" # buster, for fallback webscrape
|
||||
_boardurl="https://yabb.jriver.com/interact/index.php/board,71.0.html" # MC28 (Buster), for fallback webscrape
|
||||
#_base_next="bullseye" # TODO use for fallback to smooth upgrades
|
||||
|
||||
# Legacy
|
||||
_boardurl26="https://yabb.jriver.com/interact/index.php/board,64.0.html" # jessie/stretch
|
||||
#_boardurl26="https://yabb.jriver.com/interact/index.php/board,64.0.html" # jessie/stretch
|
||||
|
||||
# Peg older versions to prevent ABI and dependency mismatches in automatic mode
|
||||
# This can be overriden w/ --mcversion
|
||||
# TODO need user input here
|
||||
if ! [[ -v _createrepo ]]; then # disable version checks for createrepo servers
|
||||
# disable version checks for createrepo or rpmbuild (servers)
|
||||
if [[ ! -v _createrepo ]] || ! [[ -v _build && ! -v _install ]]; then
|
||||
if [[ "$ID" == "ubuntu" ]]; then
|
||||
# [[ "$VERSION_CODENAME" =~ ^(focal|groovy|hirsute|impish)$ ]] && \
|
||||
# _base="bullseye"
|
||||
@@ -377,7 +376,7 @@ getLatestVersion() {
|
||||
# Use a containerized package manager
|
||||
# TODO but how to determine build distro ($_base=buster)?
|
||||
[[ ! -x $(command -v buildah) ]] && installPackage --silent buildah
|
||||
if [[ -x $(command -v buildah) ]] && CNT=$(buildah from debian$_base); then
|
||||
if [[ -x $(command -v buildah) ]] && CNT=$(buildah from debian:$_base); then
|
||||
buildah run "$CNT" -- bash -c \
|
||||
"echo 'deb [trusted=yes arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $_base main' > /etc/apt/sources.list 2>&1"
|
||||
buildah run "$CNT" -- bash -c \
|
||||
@@ -488,7 +487,7 @@ addRepo() {
|
||||
wget -q "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" -O- | ifSudo apt-key add - > /dev/null 2>&1
|
||||
ifSudo wget "http://dist.jriver.com/latest/mediacenter/mediacenter$_mversion.list" -O "/etc/apt/sources.list.d/mediacenter$_mversion.list" > /dev/null 2>&1
|
||||
elif [[ "$ID" =~ ^opensuse.* ]]; then
|
||||
ifSudo zypper addrepo --no-gpgcheck "https://repos.bryanroessler.com/jriver" jriver
|
||||
ifSudo zypper addrepo --no-gpgcheck "https://repos.bryanroessler.com/jriver" jriver > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -589,6 +588,8 @@ acquireDeb() {
|
||||
buildRPM() {
|
||||
debug "Running: ${FUNCNAME[0]}"
|
||||
|
||||
declare -l _build_requires _requires
|
||||
|
||||
declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm"
|
||||
|
||||
# skip rebuilding the rpm if it already exists
|
||||
@@ -605,9 +606,22 @@ buildRPM() {
|
||||
# rpmbuild uses rpm to check for build dependencies
|
||||
# this will fail on non-rpm distros
|
||||
if [[ "$ID" =~ ^(fedora|centos|opensuse.*)$ ]]; then
|
||||
local _build_requires=$'BuildRequires: rpm >= 4.11.0\nBuildRequires: dpkg'
|
||||
_build_requires=$'BuildRequires: rpm >= 4.11.0\nBuildRequires: dpkg'
|
||||
fi
|
||||
|
||||
# ALIASES (for SUSE)
|
||||
|
||||
|
||||
|
||||
# If you are building on SUSE, I assume you want SUSE RPMs
|
||||
# i.e. cross-building not an option but could be added
|
||||
if [[ "$ID" =~ ^opensuse.*$ ]]; then
|
||||
_requires=$'Requires: libglvnd \nBuildRequires: dpkg'
|
||||
else
|
||||
_requires=$'Requires: libglvnd \nBuildRequires: dpkg'
|
||||
fi
|
||||
|
||||
|
||||
# Create spec file
|
||||
cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec"
|
||||
Name: MediaCenter
|
||||
@@ -632,7 +646,6 @@ buildRPM() {
|
||||
Requires: libstdc++ >= 7.4
|
||||
Requires: gtk3 >= 3.24
|
||||
Requires: mesa-libGL
|
||||
Requires: libglvnd-glx
|
||||
Requires: pango >= 1.42
|
||||
Requires: nss >= 3.42
|
||||
Requires: nspr >= 4.20
|
||||
@@ -686,6 +699,7 @@ buildRPM() {
|
||||
|
||||
# Run rpmbuild
|
||||
echo "Building version $_mcversion, please wait..."
|
||||
|
||||
if debug; then
|
||||
rpmbuild --define="%_topdir $_outputdir" --define="%_libdir /usr/lib" -bb "$_outputdir/SPECS/mediacenter.spec"
|
||||
else
|
||||
@@ -1330,7 +1344,6 @@ main() {
|
||||
fi
|
||||
|
||||
# Install services
|
||||
|
||||
if [[ "${#_services[@]}" -gt 0 ]]; then
|
||||
setDisplay
|
||||
! [[ -d "$_systemddir" ]] && ifSudo mkdir -p "$_systemddir"
|
||||
|
||||
Reference in New Issue
Block a user