9 Commits

Author SHA1 Message Date
d6e9ec6501 Does the easy solution work 2021-12-03 12:28:04 -05:00
99746aecd0 Fix SUSE commands 2021-12-03 12:11:00 -05:00
cab6122d25 Fix SUSE commands 2021-12-03 12:09:27 -05:00
51a426c66b Add some SUSE fixes 2021-12-03 11:27:32 -05:00
5ccc7f1604 Fix version 2021-12-02 20:07:08 -05:00
a1892c5a25 Bug squash 2021-12-02 20:05:24 -05:00
f6af090431 Disable version limits for building RPMs 2021-12-02 19:54:52 -05:00
b64bbf3ccd Disable version limits for building RPMs 2021-12-02 19:49:04 -05:00
46a024590a Remove atombuild 2021-12-02 13:48:08 -05:00
2 changed files with 28 additions and 28 deletions

View File

@@ -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'

View File

@@ -20,7 +20,7 @@
shopt -s extglob shopt -s extglob
_scriptversion="1.0b1" _scriptversion="1.0b2"
_outputdir="$PWD/output" _outputdir="$PWD/output"
_createrepo_webroot="/var/www/jriver" _createrepo_webroot="/var/www/jriver"
_exec_user="$(whoami)" _exec_user="$(whoami)"
@@ -105,8 +105,6 @@ init() {
getOS getOS
# Make sure universe repo is installed on Ubuntu # Make sure universe repo is installed on Ubuntu
if [[ "$ID" == "ubuntu" ]]; then if [[ "$ID" == "ubuntu" ]]; then
if ! grep ^deb /etc/apt/sources.list|grep -q universe; then if ! grep ^deb /etc/apt/sources.list|grep -q universe; then
@@ -141,10 +139,10 @@ init() {
firewall_cmd(){ ifSudo ufw "$@"; } firewall_cmd(){ ifSudo ufw "$@"; }
elif [[ "$ID" =~ ^opensuse.* ]]; then elif [[ "$ID" =~ ^opensuse.* ]]; then
echo "SUSE support is experimental!" echo "SUSE support is experimental!"
pkg_install(){ ifSudo zypper install -y -q "$@"; } pkg_install(){ ifSudo zypper --non-interactive -q install "$@"; }
pkg_reinstall(){ ifSudo zypper install -y -q -f "$@"; } pkg_reinstall(){ ifSudo zypper --non-interactive -q install -f "$@"; }
pkg_remove(){ ifSudo zypper remove --clean-deps -y -q "$@"; } pkg_remove(){ ifSudo zypper --non-interactive -q remove --clean-deps "$@"; }
pkg_update(){ ifSudo zypper update -y -q; } pkg_update(){ ifSudo zypper --non-interactive -q refresh; }
pkg_query(){ ifSudo rpm -q "$@"; } pkg_query(){ ifSudo rpm -q "$@"; }
firewall_cmd(){ ifSudo firewall-cmd "$@"; } firewall_cmd(){ ifSudo firewall-cmd "$@"; }
fi fi
@@ -336,16 +334,17 @@ getLatestVersion() {
# Latest defaults # Latest defaults
_base="buster" # For container method _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 #_base_next="bullseye" # TODO use for fallback to smooth upgrades
# Legacy # 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 # Peg older versions to prevent ABI and dependency mismatches in automatic mode
# This can be overriden w/ --mcversion # This can be overriden w/ --mcversion
# TODO need user input here # 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 if [[ "$ID" == "ubuntu" ]]; then
# [[ "$VERSION_CODENAME" =~ ^(focal|groovy|hirsute|impish)$ ]] && \ # [[ "$VERSION_CODENAME" =~ ^(focal|groovy|hirsute|impish)$ ]] && \
# _base="bullseye" # _base="bullseye"
@@ -377,7 +376,7 @@ getLatestVersion() {
# Use a containerized package manager # Use a containerized package manager
# TODO but how to determine build distro ($_base=buster)? # TODO but how to determine build distro ($_base=buster)?
[[ ! -x $(command -v buildah) ]] && installPackage --silent buildah [[ ! -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 \ 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" "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 \ 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 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 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 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 fi
} }
@@ -589,6 +588,8 @@ acquireDeb() {
buildRPM() { buildRPM() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -l _build_requires _requires
declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm" declare -g _mcrpm="$_outputdir/RPMS/x86_64/MediaCenter-$_mcversion.x86_64.rpm"
# skip rebuilding the rpm if it already exists # skip rebuilding the rpm if it already exists
@@ -605,9 +606,22 @@ buildRPM() {
# rpmbuild uses rpm to check for build dependencies # rpmbuild uses rpm to check for build dependencies
# this will fail on non-rpm distros # this will fail on non-rpm distros
if [[ "$ID" =~ ^(fedora|centos|opensuse.*)$ ]]; then 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 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 # Create spec file
cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec" cat <<- EOF > "$_outputdir/SPECS/mediacenter.spec"
Name: MediaCenter Name: MediaCenter
@@ -632,7 +646,6 @@ buildRPM() {
Requires: libstdc++ >= 7.4 Requires: libstdc++ >= 7.4
Requires: gtk3 >= 3.24 Requires: gtk3 >= 3.24
Requires: mesa-libGL Requires: mesa-libGL
Requires: libglvnd-glx
Requires: pango >= 1.42 Requires: pango >= 1.42
Requires: nss >= 3.42 Requires: nss >= 3.42
Requires: nspr >= 4.20 Requires: nspr >= 4.20
@@ -686,6 +699,7 @@ buildRPM() {
# Run rpmbuild # Run rpmbuild
echo "Building version $_mcversion, please wait..." echo "Building version $_mcversion, please wait..."
if debug; then if debug; then
rpmbuild --define="%_topdir $_outputdir" --define="%_libdir /usr/lib" -bb "$_outputdir/SPECS/mediacenter.spec" rpmbuild --define="%_topdir $_outputdir" --define="%_libdir /usr/lib" -bb "$_outputdir/SPECS/mediacenter.spec"
else else
@@ -1330,7 +1344,6 @@ main() {
fi fi
# Install services # Install services
if [[ "${#_services[@]}" -gt 0 ]]; then if [[ "${#_services[@]}" -gt 0 ]]; then
setDisplay setDisplay
! [[ -d "$_systemddir" ]] && ifSudo mkdir -p "$_systemddir" ! [[ -d "$_systemddir" ]] && ifSudo mkdir -p "$_systemddir"