diff --git a/scripts/install-mbtileserver.sh b/scripts/install-mbtileserver.sh index 8f3a374..0407605 100755 --- a/scripts/install-mbtileserver.sh +++ b/scripts/install-mbtileserver.sh @@ -1,6 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 24 April 2025 +# Upated : 25 April 2025 # Purpose : Install mbtileserver set -e trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG @@ -11,7 +12,6 @@ trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR 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}" diff --git a/scripts/install-mbutil.sh b/scripts/install-mbutil.sh new file mode 100755 index 0000000..d7b6ad3 --- /dev/null +++ b/scripts/install-mbutil.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 25 April 2025 +# Purpose : Install mbutil to allow for creation of offline tilesets +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=mbutil +VERSION=0.3.0 +DOWNLOAD_FILE="${APP}-${VERSION}.tar.gz" +SRC_DIR="${ET_SRC_DIR}/${APP}-${VERSION}" +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/mapbox/mbutil/archive/refs/tags/v${VERSION}.tar.gz" + + et-log "Downloading ${APP}: ${URL}" + curl -s -L -o ${DOWNLOAD_FILE} --fail ${URL} + + mv ${DOWNLOAD_FILE} ${ET_DIST_DIR} +fi + +CWD_DIR=`pwd` + +et-log "Unpacking ${APP} ${VERSION} source..." +tar -xzf "${ET_DIST_DIR}/${DOWNLOAD_FILE}" +mv "${APP}-${VERSION}" ${ET_SRC_DIR} && cd ${SRC_DIR} + +et-log "Installing ${APP} ${VERSION} globally..." +python setup.py install + +cd $CWD_DIR diff --git a/scripts/install-python.sh b/scripts/install-python.sh new file mode 100755 index 0000000..16f12b5 --- /dev/null +++ b/scripts/install-python.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 25 April 2025 +# Purpose : Installs Python 3 +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +et-log "Installing Python 2..." + +apt install \ + python2 \ + python-setuptools \ + -y + +# Set Python 2 as the default +update-alternatives --install /usr/bin/python python /usr/bin/python2 1 diff --git a/scripts/install.sh b/scripts/install.sh index fae8658..3cb23c6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,8 +2,8 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 24 April 2025 -# Purpose : Main installer for EmComm Tools OS Community +# Updated : 25 April 2025 +# Purpose : Main installer for EmComm Tools Community (ETC) . ./env.sh . ./functions.sh @@ -61,5 +61,7 @@ exitIfNotRoot ./install-wine.sh -# Install GIS applications +# Install GIS applications and dependencies ./install-mbtileserver.sh +./install-python.sh +./install-mbutil.sh diff --git a/tests/test-mbutil.sh b/tests/test-mbutil.sh new file mode 100755 index 0000000..83d5863 --- /dev/null +++ b/tests/test-mbutil.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 25 April 2025 +# Purpose : Test mb-util installation + +OUT=$(which mb-util) +exit $? diff --git a/tests/test-python.sh b/tests/test-python.sh new file mode 100755 index 0000000..6e29648 --- /dev/null +++ b/tests/test-python.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 25 November 2025 +# Purpose : Test Python installation + +OUT=$(python --version 2>&1 | grep "2.7") +exit $?