Files

54 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2024-05-27 13:42:38 -07:00
#!/bin/bash
#
# Author : Gaston Gonzalez
# Date : 25 November 2022
# Updated : 13 October 2025
# Purpose : Install hamlib for rig control (rigctld)
2024-05-27 13:42:38 -07:00
set -e
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR
2024-05-27 13:42:38 -07:00
. ./env.sh
. ../overlay/opt/emcomm-tools/bin/et-common
2024-05-27 13:42:38 -07:00
APP="hamlib"
# The latest verion of Hamlib 4.6.5 has a problem with initial client
# connections that can lead to rig control timeouts in applications like
# JS8Call. Rolling back to version 4.5 which was stable.
#VERSION=4.6.5
VERSION=4.5
APP_AND_VERSION="${APP}-${VERSION}"
INSTALL_DIR="/opt/${APP_AND_VERSION}"
LINK_PATH="/opt/${APP}"
TARBALL=${APP_AND_VERSION}.tar.gz
URL=https://github.com/Hamlib/Hamlib/releases/download/${VERSION}/${TARBALL}
2024-05-27 13:42:38 -07:00
if [[ ! -e $ET_DIST_DIR/$TARBALL ]]; then
2024-05-27 13:42:38 -07:00
et-log "Downloading hamlib: $URL "
download_with_retries ${URL} ${TARBALL}
2024-05-27 13:42:38 -07:00
[ ! -e ${ET_DIST_DIR} ] && mkdir -v ${ET_DIST_DIR}
[ ! -e ${ET_SRC_DIR} ] && mkdir -v ${ET_SRC_DIR}
2024-05-27 13:42:38 -07:00
mv ${TARBALL} ${ET_DIST_DIR}
2024-05-27 13:42:38 -07:00
fi
CWD_DIR=`pwd`
cd ${ET_SRC_DIR}
et-log "Unpacking ${ET_DIST_DIR}/${TARBALL}"
tar -xzf ${ET_DIST_DIR}/${TARBALL} && cd ${APP_AND_VERSION}
2024-05-27 13:42:38 -07:00
[ ! -e ${INSTALL_DIR} ] && mkdir -v ${INSTALL_DIR}
2024-05-27 13:42:38 -07:00
et-log "Building Hamlib ${VERSION}"
./configure --prefix=${INSTALL_DIR}
2024-05-27 13:42:38 -07:00
make && make check && make install
[ -e ${LINK_PATH} ] && rm ${LINK_PATH}
ln -v -s ${INSTALL_DIR} ${LINK_PATH}
2024-05-27 13:42:38 -07:00
stow -v -d /opt ${APP} -t /usr/local
2024-05-27 13:42:38 -07:00
cd $CWD_DIR