diff --git a/scripts/install-mbtileserver.sh b/scripts/install-mbtileserver.sh new file mode 100755 index 0000000..8f3a374 --- /dev/null +++ b/scripts/install-mbtileserver.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 24 April 2025 +# Purpose : Install mbtileserver +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=mbtileserver +VERSION=0.11.0 +DOWNLOAD_FILE="${APP}_v${VERSION}_linux_amd64.zip" +BIN_FILE=QtTermTCP +INSTALL_DIR="/opt/${APP}-${VERSION}" +INSTALL_BIN_DIR="${INSTALL_DIR}/bin" +LINK_PATH="/opt/${APP}" + +et-log "Installing ${APP} ${VERSION}..." + +if [[ ! -e ${ET_DIST_DIR}/${DOWNLOAD_FILE} ]]; then + + URL="https://github.com/consbio/mbtileserver/releases/download/v${VERSION}/${DOWNLOAD_FILE}" + + et-log "Downloading ${APP}: ${URL}" + curl -s -L -o ${DOWNLOAD_FILE} --fail ${URL} + + mv ${DOWNLOAD_FILE} ${ET_DIST_DIR} +fi + +CWD_DIR=`pwd` + +[[ ! -e ${INSTALL_BIN_DIR} ]] && mkdir -v -p ${INSTALL_BIN_DIR} +cd ${INSTALL_BIN_DIR} +unzip "${ET_DIST_DIR}/${DOWNLOAD_FILE}" +mv "mbtileserver_v${VERSION}_linux_amd64" ${APP} +chmod 755 ${APP} + +[[ -e ${LINK_PATH} ]] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt ${APP} -t /usr/local + +cd $CWD_DIR diff --git a/scripts/install.sh b/scripts/install.sh index 8cef27f..fae8658 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 18 March 2025 +# Updated : 24 April 2025 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -60,3 +60,6 @@ exitIfNotRoot [ ! -z "${ET_EXPERT}" ] && ./download-wikipedia.sh ./install-wine.sh + +# Install GIS applications +./install-mbtileserver.sh diff --git a/tests/test-mbtileserver.sh b/tests/test-mbtileserver.sh new file mode 100755 index 0000000..2af23d2 --- /dev/null +++ b/tests/test-mbtileserver.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 24 April 2025 +# Purpose : Test mbtileserver installation + +OUT=$(which mbtileserver) +exit $?