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

Upgrade to 5.5.1~ynh1

This commit is contained in:
yalh76 2022-06-19 04:22:13 +02:00
parent f8de67e9e6
commit 3329f9e8cb
14 changed files with 3461 additions and 223 deletions

View file

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

View file

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

View file

@ -1,13 +1,12 @@
;; Test complet minetest_game ;; Test complet minetest_game
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
pvp=1 is_public=0
servername="packagecheck"
game="minetest_game" game="minetest_game"
servername="packagecheck"
pvp=1
creative=0 creative=0
damage=1 damage=1
is_public=0
password="pass"
port="30000" port="30000"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
@ -27,15 +26,14 @@
;; Test complet capturetheflag ;; Test complet capturetheflag
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
pvp=1 is_public=0
servername="packagecheck"
game="capturetheflag" game="capturetheflag"
servername="packagecheck"
pvp=1
creative=0 creative=0
damage=1 damage=1
is_public=0 (PUBLIC|public=1|private=0) port="30000"
password="pass"
port="30000" (PORT)
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=0 setup_sub_dir=0

View file

@ -1,7 +1,7 @@
SOURCE_URL=https://github.com/minetest/minetest/archive/5.4.1.tar.gz SOURCE_URL=https://github.com/minetest/minetest/archive/5.5.1.tar.gz
SOURCE_SUM=de9e4410583c845c104b4be25f9d0b8743d8573c120149b8910ae2519f9ab14e SOURCE_SUM=dc0ae5188ef351db85c38b27f38f8549b133ed82aa46daea6deee148aa3454f4
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest-5.4.1.tar.gz SOURCE_FILENAME=minetest-5.5.1.tar.gz
SOURCE_EXTRACT=true SOURCE_EXTRACT=true

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.4.1.tar.gz SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.5.1.tar.gz
SOURCE_SUM=b4bfa0755b88230cf4bdb6af6a0951dd1248f6cdf87fecc340e43ac12c80b0b2 SOURCE_SUM=5a24fec4ed838744906f020096c35616e7ba76eeec2b93b980a40af011107e7c
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest_game-5.4.1.tar.gz SOURCE_FILENAME=minetest_game-5.5.1.tar.gz
SOURCE_EXTRACT=true

View file

@ -8,7 +8,7 @@ RequiresMountsFor=/home/yunohost.app/__APP__
Restart=on-failure Restart=on-failure
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
ExecStart=__FINALPATH__/bin/minetestserver --config /home/yunohost.app/__APP__/.minetest/minetest.conf --logfile /var/log/__APP__/__APP__.log ExecStart=__FINALPATH__/bin/minetestserver --config __DATADIR__/.minetest/minetest.conf --logfile /var/log/__APP__/__APP__.log
# Sandboxing options to harden security # Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these # Depending on specificities of your service/app, you may need to tweak these

View file

@ -6,7 +6,7 @@ How to configure this app: by SSH
* Migration from old package * Migration from old package
* You cant migrate directly with an update. * You cant migrate directly with an update.
* Before installing the new package you need to download this folder from your server `/var/games/minetest-server/.minetest/worlds/world` (this folder contains all world data) * Before installing the new package you need to download this folder from your server `/var/games/minetest-server/.minetest/worlds/world` (this folder contains all world data)
* Uninstall the old package `sudo yunohost app remove minetest` * Uninstall the old package `sudo yunohost app remove minetest`
* Install the new one `sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh` * Install the new one `sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh`

View file

@ -6,7 +6,7 @@
"en": "Free, open source voxel game engine and game. Need a client to connect to the server.", "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." "fr": "Moteur de jeu de type « bac à sable » gratuit et open source. Nécessite un client pour se connecter au serveur."
}, },
"version": "5.4.1~ynh2", "version": "5.5.1~ynh1",
"url": "http://www.minetest.net/", "url": "http://www.minetest.net/",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",

View file

@ -28,7 +28,7 @@ ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
@ -41,6 +41,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir" --is_big
#================================================= #=================================================
# SPECIFIC BACKUP # SPECIFIC BACKUP
#================================================= #=================================================
@ -55,12 +61,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE HOME DIR
#=================================================
ynh_backup --src_path="$home_path" --is_big
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -26,10 +26,10 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
game=$YNH_APP_ARG_GAME game=$YNH_APP_ARG_GAME
servername=$YNH_APP_ARG_SERVERNAME
pvp=$YNH_APP_ARG_PVP pvp=$YNH_APP_ARG_PVP
creative=$YNH_APP_ARG_CREATIVE creative=$YNH_APP_ARG_CREATIVE
damage=$YNH_APP_ARG_DAMAGE damage=$YNH_APP_ARG_DAMAGE
servername=$YNH_APP_ARG_SERVERNAME
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -48,10 +48,10 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=game --value=$game ynh_app_setting_set --app=$app --key=game --value=$game
ynh_app_setting_set --app=$app --key=servername --value=$servername
ynh_app_setting_set --app=$app --key=pvp --value=$pvp ynh_app_setting_set --app=$app --key=pvp --value=$pvp
ynh_app_setting_set --app=$app --key=creative --value=$creative ynh_app_setting_set --app=$app --key=creative --value=$creative
ynh_app_setting_set --app=$app --key=damage --value=$damage ynh_app_setting_set --app=$app --key=damage --value=$damage
ynh_app_setting_set --app=$app --key=servername --value=$servername
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -63,6 +63,7 @@ ynh_script_progression --message="Finding an available port..."
# Find an available port # Find an available port
port=$(ynh_find_port 30000) port=$(ynh_find_port 30000)
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
# Open the port # Open the port
ynh_script_progression --message="Configuring firewall..." ynh_script_progression --message="Configuring firewall..."
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port
@ -79,16 +80,8 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
home_path=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=home_path --value=$home_path
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell ynh_system_user_create --username=$app --home_dir="$final_path"
mkdir -p "$home_path"
chmod 750 "$home_path"
chmod -R o-rwx "$home_path"
chown -R $app:$app "$home_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -106,27 +99,25 @@ chown -R $app:$app "$final_path"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# ADD A CONFIGURATION # CREATE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." ynh_script_progression --message="Creating a data directory..."
mkdir -p $home_path/.minetest/worlds/ datadir=/home/yunohost.app/$app
cp -a ../conf/minetest.conf $home_path/.minetest/ ynh_app_setting_set --app=$app --key=datadir --value=$datadir
#================================================= mkdir -p $datadir
# SETUP SYSTEMD mkdir -p "$datadir/.minetest/worlds/"
#=================================================
ynh_script_progression --message="Configuring a systemd service..."
# Create a dedicated systemd config chmod 750 "$datadir"
ynh_add_systemd_config chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#================================================= #=================================================
# BUILDING # BUILDING
#================================================= #=================================================
ynh_script_progression --message="Building Minetest..." ynh_script_progression --message="Building Minetest..."
# Install the game # Install the game
if [ $game = "capturetheflag" ]; then if [ $game = "capturetheflag" ]; then
pushd $final_path pushd $final_path
@ -144,31 +135,28 @@ pushd $final_path
popd popd
#================================================= #=================================================
# MODIFY A CONFIG FILE # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." ynh_script_progression --message="Adding a configuration file..."
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
# Install the game
if [ $is_public -eq 1 ]; then if [ $is_public -eq 1 ]; then
announce="true" announce="true"
else else
announce="false" announce="false"
fi fi
ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" ynh_add_config --template="../conf/minetest.conf" --destination="$datadir/.minetest/minetest.conf"
chmod 400 "$datadir/.minetest/minetest.conf"
chown $app:$app "$datadir/.minetest/minetest.conf"
#================================================= #=================================================
# CREATE LOG DIRECTORY # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Creating log directory..." ynh_script_progression --message="Configuring a systemd service..."
mkdir -p /var/log/$app # Create a dedicated systemd config
ynh_add_systemd_config
# Set permissions on logs
chown -R $app:$app /var/log/$app
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -177,6 +165,9 @@ chown -R $app:$app /var/log/$app
#================================================= #=================================================
ynh_script_progression --message="Configuring log rotation..." ynh_script_progression --message="Configuring log rotation..."
mkdir -p /var/log/$app
chown -R $app:$app /var/log/$app
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate ynh_use_logrotate

View file

@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -57,6 +57,17 @@ ynh_script_progression --message="Removing app main directory..."
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE DATA DIR
#=================================================
# Remove the data directory if --purge option is used
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
ynh_script_progression --message="Removing app data directory..."
ynh_secure_remove --file="$datadir"
fi
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
@ -82,8 +93,6 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Removing various files..." ynh_script_progression --message="Removing various files..."
ynh_secure_remove --file="$home_path"
# Remove the log files # Remove the log files
ynh_secure_remove --file="/var/log/$app" ynh_secure_remove --file="/var/log/$app"

View file

@ -28,9 +28,17 @@ ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#================================================= #=================================================
@ -39,7 +47,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
ynh_script_progression --message="Recreating the dedicated system user..." ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
@ -52,6 +60,19 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path" chown -R $app:$app "$final_path"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Restoring the data directory..."
ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p $datadir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#================================================= #=================================================
@ -67,16 +88,9 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
ynh_script_progression --message="Restoring various files..." ynh_script_progression --message="Restoring various files..."
# Restore home_path # Open the port
ynh_restore_file --origin_path="$home_path" --not_mandatory ynh_script_progression --message="Configuring firewall..."
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port
mkdir -p "$home_path"
chmod 750 "$home_path"
chmod -R o-rwx "$home_path"
chown -R $app:$app "$home_path"
mkdir /var/log/$app -p
chown -R $app: /var/log/$app
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
@ -91,6 +105,9 @@ systemctl enable $app.service --quiet
#================================================= #=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." ynh_script_progression --message="Restoring the logrotate configuration..."
mkdir /var/log/$app -p
chown -R $app: /var/log/$app
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================

View file

@ -20,7 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
game=$(ynh_app_setting_get --app=$app --key=game) game=$(ynh_app_setting_get --app=$app --key=game)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
pvp=$(ynh_app_setting_get --app=$app --key=pvp) pvp=$(ynh_app_setting_get --app=$app --key=pvp)
creative=$(ynh_app_setting_get --app=$app --key=creative) creative=$(ynh_app_setting_get --app=$app --key=creative)
damage=$(ynh_app_setting_get --app=$app --key=damage) damage=$(ynh_app_setting_get --app=$app --key=damage)
@ -82,6 +82,13 @@ if [ -z "$domain" ]; then
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
fi fi
# If datadir doesn't exist, create it
if [ -z $datadir ]; then
datadir=$(ynh_app_setting_get --app=$app --key=home_path)
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
ynh_app_setting_delete --app=$app --key=home_path
fi
# Cleaning legacy permissions # Cleaning legacy permissions
if ynh_legacy_permissions_exists; then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all
@ -95,7 +102,7 @@ fi
ynh_script_progression --message="Making sure dedicated system user exists..." ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -123,22 +130,12 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#=================================================
# COPY CONFIG FILE
#=================================================
if [ -e $home_path ]
then
echo "Nothing to do..."
else
mkdir -p $home_path/.minetest/
mkdir $home_path/.minetest/worlds/
fi
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# Compile Minetest # BUILDING
#=================================================
ynh_script_progression --message="Building Minetest..."
# Install the game # Install the game
if [ $game = "capturetheflag" ]; then if [ $game = "capturetheflag" ]; then
@ -161,6 +158,18 @@ pushd $final_path
ynh_exec_warn_less make -j$(nproc) ynh_exec_warn_less make -j$(nproc)
popd popd
#=================================================
# COPY CONFIG FILE
#=================================================
if [ -e $datadir ]
then
echo "Nothing to do..."
else
mkdir -p $datadir/.minetest/
mkdir $datadir/.minetest/worlds/
fi
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
@ -173,7 +182,10 @@ else
announce="false" announce="false"
fi fi
ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" ynh_add_config --template="../conf/minetest.conf" --destination="$datadir/.minetest/minetest.conf"
chmod 400 "$datadir/.minetest/minetest.conf"
chown $app:$app "$datadir/.minetest/minetest.conf"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD