diff --git a/scripts/install-et-portaudio.sh b/scripts/install-et-portaudio.sh new file mode 100755 index 0000000..23bf16e --- /dev/null +++ b/scripts/install-et-portaudio.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 2 October 2025 +# Purpose : Builds and installs et-portaudio +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 + +APP="et-portaudio" +VERSION="1.0.0" +APP_AND_VERSION="${APP}-${VERSION}" +INSTALL_DIR="/opt/${APP_AND_VERSION}" +INSTALL_BIN_DIR="${INSTALL_DIR}/bin" +LINK_PATH="/opt/${APP}" + +et-log "Installing ${APP} ${VERSION}" + +CWD_DIR=`pwd` + +cd ../src/et-portaudio + +# Compile +make install + +[[ -e ${LINK_PATH} ]] && rm ${LINK_PATH} +ln -v -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt ${APP} -t /usr/local + +cd ${CWD} diff --git a/scripts/install.sh b/scripts/install.sh index d59220c..06e94f8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 30 September 2025 +# Updated : 2 October 2025 # Purpose : Main installer for EmComm Tools Community (ETC) . ./env.sh @@ -90,4 +90,6 @@ exitIfNotRoot # Install fldigi suite ./install-fldigi.sh +./install-et-portaudio.sh + # TODO: add installers for flmsg and flamp diff --git a/src/et-portaudio/Makefile b/src/et-portaudio/Makefile index c54137a..61b64d4 100644 --- a/src/et-portaudio/Makefile +++ b/src/et-portaudio/Makefile @@ -4,11 +4,22 @@ LDFLAGS = -lportaudio -lasound TARGET = et-portaudio SRC = main.c +VERSION=1.0.0 +INSTALL_DIR = /opt/et-portaudio-$(VERSION)/bin + +.PHONY: install all: $(TARGET) $(TARGET): $(SRC) $(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LDFLAGS) +install: $(TARGET) + @echo "Installing $(TARGET) to $(INSTALL_DIR)..." + @mkdir -p $(INSTALL_DIR) + @cp $(TARGET) $(INSTALL_DIR)/ + @chmod 755 $(INSTALL_DIR)/$(TARGET) + @echo "Done." + clean: rm -f $(TARGET) *.o diff --git a/src/et-portaudio/README.md b/src/et-portaudio/README.md index 43afd91..e4f6ac4 100644 --- a/src/et-portaudio/README.md +++ b/src/et-portaudio/README.md @@ -24,3 +24,9 @@ exit status of 1. ``bash make ``` + +## Install + +```bash +sudo make install +``` diff --git a/tests/test-et-portaudio.sh b/tests/test-et-portaudio.sh new file mode 100755 index 0000000..d82bdcf --- /dev/null +++ b/tests/test-et-portaudio.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 2 October 2025 +# Purpose : Test et-portaudio installation + +OUT=$(which et-portaudio) +exit $?