master
fanta 3 years ago
parent 739b0da996
commit a906c5cd31

@ -0,0 +1,65 @@
#!/bin/bash
# fanta <fanta@56k.es>
minetestUrlReleases="https://github.com/minetest/minetest/archive/refs/tags"
minetestVersion="5.4.1"
minetestUrlSourceCode="$minetestUrlReleases/$minetestVersion.tar.gz"
minetestDirTmp="/tmp/minetest-$minetestVersion.tar.gz"
minetestDirConfig="/etc/minetest"
dependenciesDebian10="ca-certificates git postgresql postgresql-server-dev-11 curl libspatialindex-dev doxygen libbz2-dev gettext libirrlicht-dev luajit libluajit-5.1-dev libncurses-dev g++ make libc6-dev cmake libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev wget"
dependenciesDebian11="ca-certificates git postgresql postgresql-server-dev-13 curl libspatialindex-dev doxygen libbz2-dev gettext libirrlicht-dev luajit libluajit-5.1-dev libncurses-dev g++ make libc6-dev cmake libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev wget"
main (){
checkDebianVersion
updateSys
installDependencies
}
isDebian() {
[ -f /etc/issue ] && debianVersion=$(grep "Debian" /etc/issue | cut -d " " -f 3)
haveProgram hostnamectl && debianVersion=$(hostnamectl | grep -i Debian | awk '{ print $5 }')
haveProgram lsb_release && debianVersion=$(lsb_release -a 2> /dev/null | grep Desc | grep Debian | awk '{ print $4}')
if [ $debianVersion == $1 ]; then echo "[+] Debian $debianVersion detected"; fi
}
haveProgram() {
type $1 &> /dev/null
}
checkDebianVersion() {
for i in {1..20}; do isDebian $i; done
}
isOK (){
if [ $? -eq 0 ]
then
echo -e "$taskName\e[32m [OK]\e[0m"
else
echo -e "$taskName\e[31m [NOTOK]\e[0m"
exit 1
fi
}
updateSys (){
taskName="Update System"; echo -e "\n[+][$taskName]"
apt -qq update && apt -qq upgrade -y > /dev/null 2>&1
isOK
}
installDependencies (){
taskName="Install dependencies"; echo -e "\n[+][$taskName]"
echo -e "$dependenciesDebian11"
apt -qq -y install $dependenciesDebian11 > /dev/null 2>&1
isOK
}
downloadMinetest (){
taskName="Download Minetest source version $minetestVersion"; echo -e "\n[+][$taskName]"
wget -q "$minetestUrlSourceCode" -O $minetestDirTmp
isOK
}
main
Loading…
Cancel
Save