diff --git a/scripts/install b/scripts/install index acd0eb2..0a5751e 100755 --- a/scripts/install +++ b/scripts/install @@ -131,21 +131,21 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Building Minetest..." -# Compile Minetest -pushd /opt/yunohost/$app - # Install the game - if [ $game = "capturetheflag" ]; then +# Install the game +if [ $game = "capturetheflag" ]; then + pushd $final_path git clone --recursive https://github.com/MT-CTF/capturetheflag.git games/capturetheflag - else - # Download Minetest Game - ynh_setup_source --dest_dir=/opt/yunohost/$app/games/minetest_game --source_id=minetest_game - fi + popd +else + # Download Minetest Game + ynh_setup_source --dest_dir=$final_path/games/minetest_game --source_id=minetest_game +fi +pushd $final_path cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE make -j$(nproc) - popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4eb9921..438c1eb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -141,24 +141,26 @@ fi # SPECIFIC UPGRADE #================================================= # Compile Minetest -pushd /opt/yunohost/$app - # Install the game - if [ $game = "capturetheflag" ]; then - # Download Capture The Flag +# Install the game +if [ $game = "capturetheflag" ]; then + # Download Capture The Flag + + pushd $final_path # To avoid mess remove this first ynh_secure_remove games/capturetheflag/ # Then clone the latest version from git git clone --recursive https://github.com/MT-CTF/capturetheflag.git games/capturetheflag - else - # Download Minetest Game - ynh_setup_source --dest_dir=/opt/yunohost/$app/games/minetest_game --source_id=minetest_game - fi + popd +else + # Download Minetest Game + ynh_setup_source --dest_dir=$final_path/games/minetest_game --source_id=minetest_game +fi +pushd $final_path cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE make -j$(nproc) - popd #=================================================