1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/minetest_ynh.git synced 2024-09-03 20:36:00 +02:00

Merge pull request #14 from YunoHost-Apps/add_game_selection

Update to 5.3.0 and add game support
This commit is contained in:
Rafi59 2020-09-26 17:33:59 +02:00 committed by GitHub
commit 4573d530f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 70 additions and 22 deletions

View file

@ -11,7 +11,7 @@ If you dont have YunoHost, please see [here](https://yunohost.org/#/install)
## Overview
Minetest is a free open-source voxel game engine with easy modding and game creation.
**Shipped version:** 5.2.0
**Shipped version:** 5.3.0
## Screenshots

View file

@ -11,7 +11,7 @@ Si vous navez pas YunoHost, veuillez consulter [ici](https://yunohost.org/#/i
## Aperçu
Minetest est un moteur de jeu voxel open-source avec modding et création de jeux faciles.
**Version incluse:** 5.2.0
**Version incluse:** 5.3.0
## Captures décran

View file

@ -3,11 +3,12 @@
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet
;; Test complet minetest_game
; Manifest
domain="domain.tld" (DOMAIN)
pvp=1
servername="packagecheck"
game="minetest_game"
creative=0
damage=1
is_public=0 (PUBLIC|public=1|private=0)
@ -27,6 +28,32 @@
port_already_use=1
change_url=0
;; Test complet capturetheflag
; Manifest
domain="domain.tld" (DOMAIN)
pvp=1
servername="packagecheck"
game="capturetheflag"
creative=0
damage=1
is_public=0 (PUBLIC|public=1|private=0)
password="pass"
port="30000" (PORT)
; Checks
pkg_linter=1
setup_sub_dir=0
setup_root=0
setup_nourl=1
setup_private=0
setup_public=0
upgrade=1
backup_restore=1
multi_instance=1
incorrect_path=0
port_already_use=1
change_url=0
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/minetest/minetest/archive/5.2.0.tar.gz
SOURCE_SUM=4996c7c50a6600d0c7140680d4bd995cb9aae910f216b46373953b49d6b13a5d
SOURCE_URL=https://github.com/minetest/minetest/archive/5.3.0.tar.gz
SOURCE_SUM=65dc2049f24c93fa544500f310a61e289c1b8fa47bf60877b746a2c27a7238d6
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest-5.2.0.tar.gz
SOURCE_FILENAME=minetest-5.3.0.tar.gz

View file

@ -38,7 +38,7 @@ ipv6_server = true
serverlist_url = servers.minetest.net
# Default game (default when creating a new world)
default_game = minetest
default_game = __GAME__
# World directory (everything in the world is stored here)
map-dir = /home/yunohost.app/__APP__/.minetest/worlds/world

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.2.0.tar.gz
SOURCE_SUM=0c49fd6e310de1aba2e8cb8ae72efe0e06bb6bc8d7c5efea23bc201b6a80ce94
SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.3.0.tar.gz
SOURCE_SUM=06c6c1d4b97af211dd0fa518a3e68a205f594e9816a4b2477e48d4d21d278e2d
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest_game-5.2.0.tar.gz
SOURCE_FILENAME=minetest_game-5.3.0.tar.gz

View file

@ -6,7 +6,7 @@
"en": "Free, open source voxel game engine and game. Need a client to connect to the server.",
"fr": "Moteur de jeu de type « bac à sable » gratuit et open source. Nécessite un client pour se connecter au serveur."
},
"version": "5.2.0~ynh1",
"version": "5.3.0~ynh1",
"url": "http://www.minetest.net/",
"license": "MIT",
"maintainer": {
@ -46,6 +46,16 @@
},
"default": false
},
{
"name": "game",
"ask": {
"en": "Choose a game for your server",
"fr": "Choissisez un jeu pour votre serveur"
},
"choises": ["minetest_game", "capturetheflag"],
"default": "minetest_game",
"hint": "Minetest_game is the minetest default game. / Capture The Flag player vs player game."
},
{
"name": "servername",
"type": "string",

View file

@ -36,14 +36,6 @@ home_path=$(ynh_app_setting_get --app=$app --key=home_path)
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_print_info --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path"
@ -74,7 +66,4 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# END OF SCRIPT
#=================================================
# Restart Minetest
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/minetest.log" --line_match="listening on"
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -26,6 +26,7 @@ ynh_abort_if_errors
server_domain=$YNH_APP_ARG_SERVER_DOMAIN
is_public=$YNH_APP_ARG_IS_PUBLIC
game=$YNH_APP_ARG_GAME
pvp=$YNH_APP_ARG_PVP
creative=$YNH_APP_ARG_CREATIVE
damage=$YNH_APP_ARG_DAMAGE
@ -49,6 +50,7 @@ ynh_print_info --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=server_domain --value=$server_domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=game --value=$game
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=pvp --value=$pvp
ynh_app_setting_set --app=$app --key=creative --value=$creative
@ -115,8 +117,14 @@ ynh_add_systemd_config
#=================================================
# Compile Minetest
pushd /opt/yunohost/$app
# Install the game
if [ $game = "capturetheflag" ]; then
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
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE
@ -131,6 +139,7 @@ popd
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf"
@ -140,6 +149,7 @@ ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_fil
ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf"
#=================================================
# CREATE WORLD
#=================================================

View file

@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
server_domain=$(ynh_app_setting_get --app=$app --key=server_domain)
port=$(ynh_app_setting_get --app=$app --key=port)
game=$(ynh_app_setting_get --app=$app --key=game)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path)
@ -124,8 +125,18 @@ fi
#=================================================
# Compile Minetest
pushd /opt/yunohost/$app
# Install the game
if [ $game = "capturetheflag" ]; then
# Download Capture The Flag
# 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
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE
@ -144,6 +155,7 @@ cp ../conf/minetest.conf $home_path/.minetest/minetest.conf
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf"