2022-08-21 23:57:56 +02:00
|
|
|
#!/bin/bash
|
2022-08-21 15:06:00 +02:00
|
|
|
|
|
|
|
hlds_build=8308
|
|
|
|
amxmod_version=1.8.2
|
|
|
|
jk_botti_version=1.43
|
|
|
|
steamcmd_url="https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz"
|
|
|
|
hlds_url="https://github.com/DevilBoy-eXe/hlds/releases/download/$hlds_build/hlds_build_$hlds_build.zip"
|
|
|
|
metamod_url="https://github.com/mittorn/metamod-p/releases/download/1/metamod.so"
|
|
|
|
amxmod_url="http://www.amxmodx.org/release/amxmodx-$amxmod_version-base-linux.tar.gz"
|
|
|
|
jk_botti_url="http://koti.kapsi.fi/jukivili/web/jk_botti/jk_botti-$jk_botti_version-release.tar.xz"
|
|
|
|
|
2022-08-22 00:12:06 +02:00
|
|
|
|
|
|
|
if [ "$1" == "client" ]
|
|
|
|
then
|
|
|
|
CLIENT=true
|
|
|
|
PACKAGES="build-essential gcc-multilib g++-multilib python libsdl2-dev:i386 libfontconfig-dev:i386 libfreetype6-dev:i386"
|
|
|
|
WAF_OPTION=""
|
|
|
|
export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig
|
|
|
|
else
|
|
|
|
CLIENT=false
|
|
|
|
XASHDS_PORT=27015
|
|
|
|
CLIENT=false
|
|
|
|
PACKAGES="build-essential ca-certificates cmake curl git gnupg2 g++-multilib lib32gcc1-s1 libstdc++6:i386 python unzip xz-utils zip"
|
|
|
|
WAF_OPTION="-d"
|
2022-08-21 23:35:06 +02:00
|
|
|
fi
|
|
|
|
|
2022-08-21 15:28:03 +02:00
|
|
|
XASH3D_BASEDIR=$(pwd)/build
|
|
|
|
mkdir -p $XASH3D_BASEDIR/result
|
2022-08-21 15:06:00 +02:00
|
|
|
|
2022-08-21 15:28:03 +02:00
|
|
|
# Prerequisits satisfied?
|
2022-08-22 00:05:38 +02:00
|
|
|
#if [ $CLIENT == false ]
|
|
|
|
#then
|
|
|
|
#
|
|
|
|
#else
|
|
|
|
#
|
|
|
|
#fi
|
|
|
|
|
2022-08-21 15:06:00 +02:00
|
|
|
sudo dpkg --add-architecture i386
|
2022-08-21 23:49:52 +02:00
|
|
|
apt-get install -y --no-install-recommends $PACKAGES
|
2022-08-21 15:28:03 +02:00
|
|
|
|
|
|
|
## compile xash3ds
|
|
|
|
# go to build directory
|
|
|
|
cd $XASH3D_BASEDIR
|
2022-08-21 23:16:09 +02:00
|
|
|
git clone --recursive https://github.com/FWGS/xash3d-fwgs
|
|
|
|
mkdir -p xash3d-fwgs/bin/
|
|
|
|
cd xash3d-fwgs
|
|
|
|
## old if you use deprecated xash3d
|
|
|
|
## cmake -DXASH_DEDICATED=ON -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" ../
|
|
|
|
## make
|
2022-08-21 23:45:09 +02:00
|
|
|
|
2022-08-21 23:35:06 +02:00
|
|
|
./waf configure -T release $WAF_OPTION
|
2022-08-22 00:09:02 +02:00
|
|
|
./waf build
|
2022-08-21 23:16:09 +02:00
|
|
|
./waf install --destdir=bin/
|
2022-08-21 23:22:25 +02:00
|
|
|
|
2022-08-21 15:06:00 +02:00
|
|
|
|
2022-08-21 23:16:09 +02:00
|
|
|
## here we fetch half-life from steam server
|
2022-08-21 15:28:03 +02:00
|
|
|
mkdir -p $XASH3D_BASEDIR/steam
|
|
|
|
cd $XASH3D_BASEDIR/steam
|
2022-08-21 23:16:09 +02:00
|
|
|
## an steamcmd automation
|
2022-08-21 15:06:00 +02:00
|
|
|
echo "login anonymous
|
2022-08-21 15:45:21 +02:00
|
|
|
force_install_dir $XASH3D_BASEDIR/result
|
2022-08-21 15:06:00 +02:00
|
|
|
app_set_config 90 mod valve
|
|
|
|
app_update 90
|
|
|
|
app_update 90
|
|
|
|
app_update 90 validate
|
|
|
|
app_update 90 validate
|
2022-08-21 15:28:03 +02:00
|
|
|
quit" > $XASH3D_BASEDIR/steam/hlds.install
|
2022-08-21 15:06:00 +02:00
|
|
|
|
2022-08-21 23:16:09 +02:00
|
|
|
## fetch steamcmd
|
2022-08-21 15:06:00 +02:00
|
|
|
curl -sL "$steamcmd_url" | tar xzvf -
|
2022-08-21 23:22:25 +02:00
|
|
|
## run half-life download from steam server with steamcmd
|
2022-08-21 15:06:00 +02:00
|
|
|
./steamcmd.sh +runscript hlds.install
|
2022-08-21 23:22:25 +02:00
|
|
|
## place Xash3D binaries in result and overwrite all
|
2022-08-21 23:53:22 +02:00
|
|
|
cp -R $XASH3D_BASEDIR/xash3d-fwgs/bin/* $XASH3D_BASEDIR/result/
|
2022-08-21 23:16:09 +02:00
|
|
|
## this is just another source you can use instead of steamcmd.
|
|
|
|
## curl -sLJO "$hlds_url"
|
|
|
|
## unzip "hlds_build_$hlds_build.zip" -d "hlds_build_$hlds_build"
|
|
|
|
## cp -R "hlds_build_$hlds_build/hlds"/* $XASH3D_BASEDIR/result/
|
2022-08-21 15:06:00 +02:00
|
|
|
|
|
|
|
|
2022-08-21 15:28:03 +02:00
|
|
|
touch $XASH3D_BASEDIR/result/valve/listip.cfg
|
|
|
|
touch $XASH3D_BASEDIR/result/valve/banned.cfg
|
2022-08-21 23:25:48 +02:00
|
|
|
echo "./xash +ip 0.0.0.0 -port $XASHDS_PORT -pingboost 1 -timeout 3 +map boot_camp" > $XASH3D_BASEDIR/result/start.sh
|
2022-08-21 15:28:03 +02:00
|
|
|
chmod +x $XASH3D_BASEDIR/result/start.sh
|
|
|
|
cd $XASH3D_BASEDIR/result
|