#!/bin/sh -e
###
# This script will install the dependencies for building Signet. It can be run
# as a normal user who has sudo or doas access, or as root.
###
os=`uname`
if [ "$os" = "Linux" ]; then
        me=`whoami`
        sudo=""
        if [ "$me" != "root" ]; then
                # We need to do a priv esc
                failed=0
                which sudo && sudo=`which sudo` || true
                which doas && sudo=`which doas` || true
                if [ -z "$sudo" ]; then
                        echo "Error: Not running as root and couldn't find sudo nor doas"
                        exit 1
                fi
        fi
        $sudo apt-get update
        $sudo apt-get install -y git build-essential qtbase5-dev qtchooser qt5-qmake libqt5websockets5-dev libqt5x11extras5-dev libgcrypt20-dev zlib1g-dev libx11-dev
	# To build the man page, we'll also need pandoc
	$sudo apt-get install -y pandoc
else
        echo "Platform not yet implemented"
fi
