5 커밋

작성자 SHA1 메시지 날짜
f40d1b2ba0 Fix local RPM install 2021-12-03 13:13:29 -05:00
2ca5fdf933 Fix local RPM install 2021-12-03 13:11:34 -05:00
b7849c3a8b Fix local RPM install 2021-12-03 12:59:56 -05:00
73759e6a7f Fix local RPM install 2021-12-03 12:59:17 -05:00
d6e9ec6501 Does the easy solution work 2021-12-03 12:28:04 -05:00

파일 보기

@@ -20,7 +20,7 @@
shopt -s extglob shopt -s extglob
_scriptversion="1.0b2" _scriptversion="1.0b3"
_outputdir="$PWD/output" _outputdir="$PWD/output"
_createrepo_webroot="/var/www/jriver" _createrepo_webroot="/var/www/jriver"
_exec_user="$(whoami)" _exec_user="$(whoami)"
@@ -402,7 +402,7 @@ getLatestVersion() {
# Arguments: # Arguments:
# One or more package names # One or more package names
# Options: # Options:
# --no-check: Do not check if package is already installed # --nocheck: Do not check if package is already installed
# --nogpgcheck: Disable GPG checks for RPM based distros # --nogpgcheck: Disable GPG checks for RPM based distros
# --silent, -s: Do not report errors (useful if package is not strictly required and errors are noisy) # --silent, -s: Do not report errors (useful if package is not strictly required and errors are noisy)
####################################### #######################################
@@ -410,14 +410,14 @@ installPackage() {
debug "Running: ${FUNCNAME[0]}" "$@" debug "Running: ${FUNCNAME[0]}" "$@"
local -a _pkg_array _install_flags local -a _pkg_array _install_flags
local _pkg local _pkg _nocheck _silent _return
if _input=$(getopt -o +s -l no-check,nogpgcheck,silent -- "$@"); then if _input=$(getopt -o +s -l nocheck,nogpgcheck,silent -- "$@"); then
eval set -- "$_input" eval set -- "$_input"
while true; do while true; do
case "$1" in case "$1" in
--no-check) --nocheck)
local _no_check=true _nocheck=true
;; ;;
--nogpgcheck) --nogpgcheck)
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
@@ -427,7 +427,7 @@ installPackage() {
fi fi
;; ;;
--silent|-s) --silent|-s)
local _silent=true _silent=true
;; ;;
--) --)
shift shift
@@ -443,11 +443,11 @@ installPackage() {
for _pkg in "$@"; do for _pkg in "$@"; do
# Check for alias # Check for alias
if [[ -v PKG_ALIASES["$_pkg"] ]]; then if [[ ! -v _nocheck && -v PKG_ALIASES[$_pkg] ]]; then
_pkg=${PKG_ALIASES[$_pkg]} _pkg=${PKG_ALIASES[$_pkg]}
fi fi
# Check if already installed # Check if already installed
if [[ -v _no_check ]] || ! pkg_query "$_pkg" > /dev/null 2>&1; then if [[ -v _nocheck ]] || ! pkg_query "$_pkg" > /dev/null 2>&1; then
_pkg_array+=("$_pkg") _pkg_array+=("$_pkg")
fi fi
done done
@@ -461,7 +461,7 @@ installPackage() {
else else
pkg_install "${_install_flags[@]}" "${_pkg_array[@]}" > /dev/null 2>&1 pkg_install "${_install_flags[@]}" "${_pkg_array[@]}" > /dev/null 2>&1
fi fi
local _return=$? _return=$?
[[ $_return -ne 0 && ! -v _silent ]] && err "Failed to install ${_pkg_array[*]}. Attempting to continue..." [[ $_return -ne 0 && ! -v _silent ]] && err "Failed to install ${_pkg_array[*]}. Attempting to continue..."
return $_return return $_return
fi fi
@@ -532,10 +532,10 @@ installMCFromRepo() {
fi fi
if debug; then if debug; then
debug "installPackage --no-check $_mcpkg" debug "installPackage --nocheck $_mcpkg"
installPackage --no-check --nogpgcheck "$_mcpkg" installPackage --nocheck --nogpgcheck "$_mcpkg"
else else
installPackage --no-check --nogpgcheck "$_mcpkg" > /dev/null 2>&1 installPackage --nocheck --nogpgcheck "$_mcpkg" > /dev/null 2>&1
fi fi
return $? return $?
@@ -588,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
@@ -604,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
@@ -631,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
@@ -1292,11 +1306,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 ! installMCFromRepo; then if installMCFromRepo; then
echo "JRiver Media Center installed successfully"
else
err "JRiver Media Center installation failed" err "JRiver Media Center installation failed"
exit 1 exit 1
else
echo "JRiver Media Center installed successfully"
fi fi
symlinkCerts symlinkCerts
restoreLicense restoreLicense
@@ -1323,7 +1337,12 @@ main() {
# Install RPM # Install RPM
if [[ -v _install && "$_install" == "rpm" ]]; then if [[ -v _install && "$_install" == "rpm" ]]; then
installPackage --no-check --nogpgcheck "$_mcrpm" if installPackage --nocheck --nogpgcheck "$_mcrpm"; then
echo "JRiver Media Center installed successfully"
else
err "JRiver Media Center installation failed"
exit 1
fi
symlinkCerts symlinkCerts
restoreLicense restoreLicense
openFirewall "jriver" openFirewall "jriver"