Good morning, everyone,

I use the script of Chase Wright MysticRyuujin.

I'm trying to install on Debian (10) Buster with its script.

I made some modifications to make it compatible with Debian 10.

I attach the script below:

#!/bin/bash

# Check that the user is root or sudo
if ! [ $(id -u) = 0 ]; then echo "Please run this script as root or sudo"; exit 1 ; fi

# Guacamole version to install
GUACVERSION="1.0.0.0"

# Colors used for the script
YELLOW='\033[1;33m''
BLUE='\033[0;34m''
RED='\033[0;31m''
GREEN='\033[0;32m''
NC='\033[0m' # No color

# Location of the journal
LOG="/tmp/guacamole_${GUACVERSION}_build.log"

# Retrieve the arguments for the "Non-Interactive" mode
while [ "$1" !="" ]; do
    box $1 in
        -m || --mysqlpwd)
            shift
            mysqlpwd="$1"
            ;;
        -g || --guacpwd)
            shift
            guacpwd="$1"
            ;;
        -u | | --mysqluser)
            shift
            mysqluser="$1"
            ;;
        -d | | --database)
            shift
            DB="$1"
            ;;
    esac
    shift
done

# Check if the given mysql user
if [ -z "$mysqluser" ]; then
    mysqluser="guacamole_user"
fi

# Check if the name of the database has been given
if [ -z "$DB" ]; then
    DB="guacamole_db"
fi

# Get the MySQL root password and the Guacamole user password
if [ -n "$mysqlpwd" ] &&& [ -n "$guacpwd" ]; then
        mysqlrootpassword=$mysqlpwd
        guacdbuserpassword=$guacpwd
else
    echo
    while true
    do
        read -s -p "Enter a MySQL ROOT password: "mysqlrootpassword
        echo
        read -s -p "Confirm MySQL ROOT password: "password2
        echo
        [ "$mysqlrootpassword" = "$password2" ] && break
        echo "Passwords do not match. Please try again."
        echo
    done
    echo
    while true
    do
        read -s -p "Enter a Guacamole User Database Password: "guacdbuserpassword
        echo
        read -s -p "Confirm Guacamole user database password: "password2
        echo
        [ "$guacdbuserpassword" = "$password2" ] && break
        echo "Passwords do not match. Please try again."
        echo
    done
    echo
fi

debconf-set-selections <<<< "mysql-server mysql-server/root_password password $mysqlrootpassword" debconf-set-selections <<<< "mysql-server mysql-server/root_password_again password $mysqlrootpassword"

# Ubuntu and Debian have different package names for libjpeg
# Ubuntu and Debian versions have different differnet package names for libpng-dev
# Ubuntu 18.04 does not include the default repo universe
source /etc/os-release
if [[[ "${NAME}" == "Ubuntu" ]]
then then
    JPEGTURBO="libjpeg-turbo8-dev"
    if [[[ "${VERSION_ID}" == "18.04" ]]
    then then
        sed -i's/bionic main$/bionic main universe/' /etc/apt/sources.list
    fi
    if [[[ "${VERSION_ID}" == "16.04" ]]
    then then
        LIBPNG="libpng12-dev"
    else
        LIBPNG="libpng-dev"
    fi
elif [[[ "${NAME}" == * *"Debian "* ]]
then then
    JPEGTURBO="libjpeg62-turbo-dev"
    if [[[ "${PRETTY_NAME}" == *"buster "* ]]
    then then
        LIBPNG="libpng-dev"
    else
    else
        LIBPNG="libpng12-dev"
    fi
else
    echo "Distribution not supported - Ubuntu or Debian only"
    exit 1
fi

# Update of apt so that we can search in apt-cache for the latest supported tomcat version
apt-get -qq update

# Tomcat 8.0.x is at the end of its life, but Tomcat 7.x is not....
# If Tomcat 8.5.x or newer is available, install it, otherwise install Tomcat 9.
# I have testing with Tomcat9........
if [ $[[ $(apt-cache show tomcat9 | egrep "Version: 9.[16-4]" | wc -l) -gt 0 ]]
then then
    TOMCAT="tomcat8"
else
    TOMCAT="tomcat9"
fi

if [ -z $(command -v mysql) ]
then then
    MYSQL="mysql-server mysql-client mysql-common mysql-utilities"
else
    MYSQL=""
fi

# Uncomment to manually force a tomcat version
#TOMCAT="

# Install the features
echo -e "${BLUE}Installing dependencies. This might take a few minutes...${NC}"

export DEBIAN_FRONTEND=non-interactive

apt-get -y install build-essential libcairo2-dev ${JPEGTURBO} ${LIBPNG} libossp-uuid-dev libavcodec-dev libavutil-dev \ libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev \
libvorbis-dev libwebp-dev ${MYSQL} libmariadb-java ${TOMCAT} freerdp2-x11 \
ghostscript wget dpkg-dev &>>> ${LOG}

if [ $? -ne 0 ]; then
    echo -e "${RED}Failed. See ${LOG}${NC}"
    exit 1
else
    echo -e "${GREEN}OK${NC}"
fi

# Define SERVER as the preferred download server for the Apache CDN
SERVER="http://apache.org/dyn/closer.cgi?action${GUACVERSION}";
echo -e "${BLUE}Downloading Files...${NC}"

# Download Guacamole Server
wget -q --show-progress -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed to download guacamole-server-${GUACVERSION}.tar.gz"
    echo -e "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz${NC}"
    exit 1
fi
echo -e "${GREEN}Downloaded guacamole-server-${GUACVERSION}.tar.gz${NC}"

# Download Guacamole Client
wget -q --show-progress -O guacamole-${GUACVERSION}.war ${SERVER}/binary/guacamole-${GUACVERSION}.war
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed to download guacamole-${GUACVERSION}.war"
    echo -e "${SERVER}/binary/guacamole-${GUACVERSION}.war${NC}"
    exit 1
fi
echo -e "${GREEN}Downloaded guacamole-${GUACVERSION}.war${NC}"

# Download Guacamole authentication extensions (Database)
wget -q --show-progress -O guacamole-auth-jdbc-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed to download guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
    echo -e "${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
    exit 1
fi
echo -e "${GREEN}Downloaded guacamole-auth-jdbc-${GUACVERSION}.tar.gz${NC}"
#
#
# Download Guacamole Authentication Extensions (CAS)

wget -q --show-progress -O guacamole-auth-cash-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-cash-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed to download guacamole-auth-cash-${GUACVERSION}.tar.gz"
    echo -e "${SERVER}/binary/guacamole-auth-cash-${GUACVERSION}.tar.gz"
    exit 1
fi
echo -e "${GREEN}Downloaded guacamole-auth-cash-${GUACVERSION}.tar.gz${NC}"

echo -e "${GREEN}Downloading complete.${NC}"
#
# Download Guacamole Authentication Extensions (TOTP)
#
wget -q --show-progress -O guacamole-auth-totp-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed to download guacamole-auth-totp-${GUACVERSION}.tar.gz"
    echo -e "${SERVER}/binary/guacamole-auth-totp-${GUACVERSION}.tar.gz"
    exit 1
fi
echo -e "${GREEN}Downloaded guacamole-auth-totp-${GUACVERSION}.tar.gz${NC}"

echo -e "${GREEN}Downloading complete.${NC}"
#
#
# Extract Guacamole files
tar -xzf guacamole-server-${GUACVERSION}.tar.gz
tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz
tar -xzf guacamole-auth-cash-${GUACVERSION}.tar.gz
tar -xzf guacamole-auth-totp-${GUACVERSION}.tar.gz

# Create directories
mkdir -p /etc/guacamole/lib
mkdir -p /etc/guacamole/extensions

# Install guacd
cd guacamole-server-${GUACVERSION}

echo -e "${BLUE}Building Guacamole with GCC $(gcc --version | head -n1 | grep -oP - \\K.*'' | awk'{print $1}'') ${NC}"

echo -e "${BLUE}Configuring. This might take a minute...${NC}"
./configure --with-init-dir=/etc/init.d &>>> ${LOG}
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed. See ${LOG}${NC}"
    exit 1
else
    echo -e "${GREEN}OK${NC}"
fi

echo -e "${BLUE}Running Make. This might take a few minutes...${NC}"
make &>>> ${LOG}
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed. See ${LOG}${NC}"
    exit 1
else
    echo -e "${GREEN}OK${NC}"
fi

echo -e "${BLUE}Running Make Install...${NC}"
make install &>>> ${LOG}
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed. See ${LOG}${NC}"
    exit 1
else
    echo -e "${GREEN}OK${NC}"
fi

ldconfig
systemctl enable guacd
cd ...

# Get the compilation file
BUILD_FOLDER=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# Move the files to the correct locations
mv guacamole-${GUACVERSION}.war /etc/guacamole/guacamole.war
ln -s /etc/guacamole/guacamole/guacamole.war /var/lib/${TOMCAT}/webapps/
ln -s /usr/local/lib/freerdp/guac*.so /usr/lib/${BUILD_FOLDER}/freerdp/
ln -s /usr/share/java/mysql-connector-java.jar /etc/guacamole/lib/
cp guacamole-auth-jdbc-${GUACVERSION}/mysql/guacamole-auth-jdbc-mysql-${GUACVERSION}.jar /etc/guacamole/extensions/ cp guacamole-auth-totp-${GUACVERSION}/guacamole-auth-totp-${GUACVERSION}.jar /etc/guacamole/extensions/ cp guacamole-auth-cash-${GUACVERSION}/guacamole-auth-cash-${GUACVERSION}.jar /etc/guacamole/extensions/

# Configure guacamole.properties
rm -f /etc/guacamole/guacamole/guacamole.properties
touch /etc/guacamole/guacamole/guacamole.properties
echo "mysql-hostname: localhost" >> /etc/guacamole/guacamole.properties
echo "mysql-port: 3306" >> /etc/guacamole/guacamole.properties
echo "mysql-database: ${DB}" >> /etc/guacamole/guacamole/guacamole.properties echo "mysql-username: ${mysqluser}" >> /etc/guacamole/guacamole/guacamole.properties echo "mysql-password: ${guacdbuserpassword}" >> /etc/guacamole/guacamole/guacamole.properties

# restart tomcat
echo -e "${BLUE}Restarting tomcat...${NC}"

service ${TOMCAT} restart
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed${NC}"
    exit 1
else
    echo -e "${GREEN}OK${NC}"
fi

# Create guacamole_db and grant it the permissions $mysqluser

# SQL code
SQLCODE="
create database ${DB};
create user if not exists' ${mysqluser}' @'localhost' identified by \"${guacdbuserpassword}\"; GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO'${mysqluser}' @'localhost';
flush privileges;"

# Execute the SQL code
echo ${SQLCODE} | mysql -u root -p${mysqlrootpassword}

# Add the Guacamole schema to the newly created database
echo -e "Adding db tables..."
cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p${mysqlrootpassword} ${DB}
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed${NC}"
    exit 1
else
    echo -e "${GREEN}OK${NC}"
fi

# Make sure that guacd is started
service guacd start

# Cleaning
echo -e "${BLUE}Cleanup install files...${NC}"

rm -rf guacamole-*
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
    echo -e "${RED}Failed${NC}"
    exit 1
else
    echo -e "${GREEN}OK${NC}"
fi

echo -e "${BLUE}Installation Complete\nhttp://localhost:8080/guacamole/\nDefault login guacadmin:guacadmin\nBe sure to change the password.${NC}"



Here is the error:

guacenc.c:79:5: error:'avcodec_register_all' is deprecated[-Werror=deprecated-declarations]
     avcodec_register_all();
     ^~~~~~~~~~~~~~~~~~~~
In file included from guacenc.c:27:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4102:6: note: declared here
 void avcodec_register_all(void);
      ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:761: guacenc-guacencenc.o] Error 1
make[2] : we leave the directory " /opt/guacamole-server-1.0.0.0/src/guacenc ".
make[1]: *** [Makefile:510: all-recursive] Error 1
make[1] : we leave the directory " /opt/guacamole-server-1.0.0.0 ".
make: *** [Makefile:432: all] Error 2


Do you have any idea how to remove this error?

Thank you.
Best regards

Reply via email to