From a66777b7c61330a7dca25ffb07418359f56288d8 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Sun, 13 Oct 2024 04:54:48 -0700 Subject: [PATCH] Dire Wolf - Initial installation script for Dire Wolf --- scripts/install-direwolf.sh | 61 +++++++++++++++++++++++++++++++++++++ scripts/install.sh | 4 ++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100755 scripts/install-direwolf.sh diff --git a/scripts/install-direwolf.sh b/scripts/install-direwolf.sh new file mode 100755 index 0000000..9df7fc3 --- /dev/null +++ b/scripts/install-direwolf.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 27 March 2023 +# Updated : 13 October 2024 +# Purpose : Install Dire Wolf +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +. ./env.sh + +VERSION=1.6 +TARBALL=direwolf-$VERSION.tar.gz +INSTALL_DIR=/opt/direwolf-$VERSION +LINK_PATH=/opt/direwolf + +et-log "Installing Dire Wolf build dependencies..." +apt install \ + gcc \ + g++ \ + make \ + cmake \ + libasound2-dev \ + libudev-dev \ + -y + +if [ ! -e $ET_DIST_DIR/$TARBALL ]; then + + URL=https://github.com/wb2osz/direwolf/archive/refs/tags/${VERSION}.tar.gz + + et-log "Downloading Dire Wolf version: $URL" + curl -s -L -o $TARBALL --fail $URL + + [ ! -e $ET_DIST_DIR ] && mkdir $ET_DIST_DIR + [ ! -e $ET_SRC_DIR ] && mkdir $ET_SRC_DIR + + mv -v $TARBALL $ET_DIST_DIR +fi + +CWD_DIR=`pwd` + +cd $ET_SRC_DIR +tar -xzf $ET_DIST_DIR/$TARBALL && cd direwolf-$VERSION + +[ ! -e $INSTALL_DIR ] && mkdir -v $INSTALL_DIR + +[ -e build ] && rm -rf build +mkdir build && cd build +cmake -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_DIR .. +make -j4 +make install +make install-conf + +[ -e $LINK_PATH ] && rm $LINK_PATH +ln -s $INSTALL_DIR $LINK_PATH + +stow -v -d /opt direwolf -t /usr/local + +cd $CWD_DIR + diff --git a/scripts/install.sh b/scripts/install.sh index 9e70bdf..203ae9f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 9 October 2024 +# Updated : 13 October 2024 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -34,3 +34,5 @@ exitIfNotRoot ./install-cat.sh ./install-conky.sh + +./install-direwolf.sh