mirror of
https://github.com/km4ack/73Linux
synced 2026-08-13 17:51:54 -04:00
72 lines
2.4 KiB
Text
Executable file
72 lines
2.4 KiB
Text
Executable file
BAPP=4.0
|
|
ID=HAMLIB
|
|
Name=Rig_Control
|
|
Comment="Rig Control for Radios"
|
|
Ver=Update:4.4
|
|
localVer=0
|
|
W3=
|
|
|
|
INSTALL(){
|
|
CUR_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
|
|
|
mkdir -p ${BAPSRC}
|
|
|
|
CLEANSOURCE(){
|
|
#this function removes any old source files before
|
|
#new files are downloaded for installation. This
|
|
#function is called by install functions below.
|
|
PACKAGE=$(ls $BUILDDIR | grep $PACKAGE)
|
|
if [ -d ${BAPSRC}/${PACKAGE} ]; then
|
|
sudo rm -rf ${BAPSRC}/${PACKAGE}*
|
|
fi
|
|
}
|
|
|
|
PACKAGE=hamlib
|
|
CLEANSOURCE
|
|
sudo -A apt install -y libusb-1.0-0 libusb-1.0-0-dev libnova-0.16-0 libnova-dev swig libindi-dev libindi-data libindi-plugins libgd-dev
|
|
pyver=$(python3 -V | awk '{print $2}' | awk -F. '{print $1"."$2}')
|
|
cd ${BAPSRC}
|
|
NEWRIG=$(curl -s https://sourceforge.net/projects/hamlib/files/latest/download |
|
|
grep -o https://downloads.sourceforge.net/project/hamlib/hamlib/[0-9].[0-9].[0-9] |
|
|
head -n 1 | awk -F "/" '{print $7}')
|
|
HAMLIBLINK=https://sourceforge.net/projects/hamlib/files/hamlib/${NEWRIG}/hamlib-${NEWRIG}.tar.gz
|
|
wget --tries 2 --connect-timeout=60 ${HAMLIBLINK}
|
|
tar -xzf hamlib-${NEWRIG}.tar.gz
|
|
rm hamlib-${NEWRIG}.tar.gz
|
|
cd hamlib-${NEWRIG} || return
|
|
#./configure --with-python-binding PYTHON_VERSION=$pyver #(see issue #99)
|
|
./configure
|
|
make
|
|
sudo -A make install
|
|
sudo -A ldconfig
|
|
sudo -A make clean
|
|
}
|
|
|
|
|
|
REMOVE(){
|
|
DIR=$(ls $HOME/.bap-source-files)
|
|
if [ -z "$DIR" ]; then
|
|
echo "#############################################################"
|
|
echo "# ERROR::Source files not found for hamlib. Can't uninstall #"
|
|
echo "#############################################################"
|
|
else
|
|
cd $HOME/.bap-source-files/$DIR
|
|
echo "uninstalling hamlib"
|
|
sudo -A make uninstall
|
|
fi
|
|
}
|
|
|
|
|
|
VERSION(){
|
|
if ! hash rigctl 2>/dev/null; then
|
|
CURRENT=0
|
|
NEWVER=$(curl --max-time 20 -s https://sourceforge.net/projects/hamlib/files/latest/download |
|
|
grep -o https://downloads.sourceforge.net/project/hamlib/hamlib/[0-9].[0-9].[0-9] |
|
|
head -n 1 | awk -F "/" '{print $7}')
|
|
else
|
|
CURRENT=$(rigctl --version | awk '{print $3}')
|
|
NEWVER=$(curl --max-time 20 -s https://sourceforge.net/projects/hamlib/files/latest/download |
|
|
grep -o https://downloads.sourceforge.net/project/hamlib/hamlib/[0-9].[0-9].[0-9] |
|
|
head -n 1 | awk -F "/" '{print $7}')
|
|
fi
|
|
}
|