1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/veloren_ynh.git synced 2024-09-03 17:46:10 +02:00

Upgrade to 0.12.0~ynh1

This commit is contained in:
yalh76 2022-07-17 01:00:03 +02:00
parent 098bea204a
commit 92548f4b0b
17 changed files with 96 additions and 100 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Multiplayer voxel RPG inspired by games such as Cube World, Legend of Zelda: Breath of the Wild, Dwarf Fortress and Minecraft
**Shipped version:** 0.11.0~ynh1
**Shipped version:** 0.12.0~ynh1
**Demo:** server.veloren.net:14004
@ -30,9 +30,9 @@ Multiplayer voxel RPG inspired by games such as Cube World, Legend of Zelda: Bre
Veloren is in pre-alpha, il y aura des bugs.
This package provides the last "release" version of Veloren, which is older than that of the official server. You will need to download the corresponding version of the client:
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=macos)
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=macos)
## Documentation and resources

View file

@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
RPG voxel multijoueur inspiré de jeux tels que Cube World, Legend of Zelda : Breath of the Wild, Dwarf Fortress et Minecraft
**Version incluse :** 0.11.0~ynh1
**Version incluse :** 0.12.0~ynh1
**Démo :** server.veloren.net:14004
@ -26,9 +26,9 @@ RPG voxel multijoueur inspiré de jeux tels que Cube World, Legend of Zelda : Br
Veloren est en pre-alpha, il y aura des bugs.
Ce paquet fournit la dernière version "release" de Veloren, qui est plus ancienne que celle du serveur officiel. Il vous faudra télécharger la version correspondante du client:
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=macos)
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=macos)
## Documentations et ressources

View file

@ -1,6 +1,3 @@
# See here for more information
# https://github.com/YunoHost/package_check#syntax-check_process-file
;; Test complet
; Manifest
server_name=
@ -36,8 +33,3 @@
;;; Options
Email=
Notification=none
;;; Upgrade options
; commit=CommitHash
name=Name and date of the commit.
manifest_arg=generate_custom_world=1&

View file

@ -1,7 +1,7 @@
SOURCE_URL=https://gitlab.com/veloren/veloren/-/archive/v0.11.0/veloren-v0.11.0.tar.gz
SOURCE_SUM=a2a840fcbbafaaa429c8c2ffce56488de099ed71e310fcae6d56b927409d1f8f
SOURCE_URL=https://gitlab.com/veloren/veloren/-/archive/v0.12.0/veloren-v0.12.0.tar.gz
SOURCE_SUM=10fc0d1cb123ff9caf4ff90412df5241306780dbd2a43be1e37a0c8bac437697
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=veloren-v0.11.0.tar.gz
SOURCE_FILENAME=veloren-v0.12.0.tar.gz
SOURCE_EXTRACT=true

View file

@ -8,7 +8,7 @@ User=__APP__
Group=__APP__
WorkingDirectory=__DATA_PATH__/
Environment=VELOREN_ASSETS=__FINAL_PATH__/
ExecStart=__FINALPATH__/target/release/veloren-server-cli --basic
ExecStart=__FINALPATH__/live/veloren-server-cli
KillSignal=SIGUSR1
TimeoutStopSec=150
StandardOutput=append:/var/log/__APP__/__APP__.log

1
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1 @@
Multiplayer voxel RPG inspired by games such as Cube World, Legend of Zelda: Breath of the Wild, Dwarf Fortress and Minecraft

1
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1 @@
RPG voxel multijoueur inspiré de jeux tels que Cube World, Legend of Zelda : Breath of the Wild, Dwarf Fortress et Minecraft

View file

@ -1,6 +1,6 @@
Veloren is in pre-alpha, il y aura des bugs.
This package provides the last "release" version of Veloren, which is older than that of the official server. You will need to download the corresponding version of the client:
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=macos)
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=macos)

View file

@ -1,6 +1,6 @@
Veloren est en pre-alpha, il y aura des bugs.
Ce paquet fournit la dernière version "release" de Veloren, qui est plus ancienne que celle du serveur officiel. Il vous faudra télécharger la version correspondante du client:
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.11.0/download?job=macos)
* [Windows x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=windows)
* [Linux x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=linux)
* [MacOS x64](https://gitlab.com/veloren/veloren/-/jobs/artifacts/v0.12.0/download?job=macos)

View file

@ -6,7 +6,7 @@
"en": "Multiplayer voxel RPG inspired by games such as Cube World, Legend of Zelda: Breath of the Wild, Dwarf Fortress and Minecraft",
"fr": "RPG voxel multijoueur inspiré de jeux tels que Cube World, Legend of Zelda : Breath of the Wild, Dwarf Fortress et Minecraft"
},
"version": "0.11.0~ynh1",
"version": "0.12.0~ynh1",
"url": "https://veloren.net",
"upstream": {
"license": "GPL-3.0-only",
@ -22,12 +22,12 @@
"email": "jules.bertholet@gmail.com"
},
"requirements": {
"yunohost": ">= 4.1.3"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [],
"arguments": {
"install" : [
"install": [
{
"name": "server_name",
"type": "string",

View file

@ -5,14 +5,14 @@
#=================================================
# dependencies used by the app
pkg_dependencies="cargo rustc ca-certificates librust-backtrace+libbacktrace-dev build-essential git git-lfs"
pkg_dependencies="ca-certificates librust-backtrace+libbacktrace-dev build-essential git git-lfs"
#=================================================
# PERSONAL HELPERS
#=================================================
function setup_source {
ynh_setup_source --dest_dir="$final_path"
ynh_setup_source --dest_dir="$final_path/build"
patch_source
@ -27,42 +27,42 @@ function patch_source {
if [ -z "$world_map_size_lg_y" ]; then
world_map_size_lg_y="10"
fi
ynh_replace_string -m "MapSizeLg::new(Vec2 { x: [0-9]\{1,\}, y: [0-9]\{1,\} }" -r "MapSizeLg::new(Vec2 { x: $world_map_size_lg_x, y: $world_map_size_lg_y }" -f "$final_path/world/src/sim/mod.rs"
ynh_replace_string -m "MapSizeLg::new(Vec2 { x: [0-9]\{1,\}, y: [0-9]\{1,\} }" -r "MapSizeLg::new(Vec2 { x: $world_map_size_lg_x, y: $world_map_size_lg_y }" -f "$final_path/build/world/src/sim/mod.rs"
fi
if [ ! -z "$continent_scale_hack" ]; then
ynh_replace_string -m "continent_scale_hack = [0-9]\{1,\}\.[0-9]\{1,\}" -r "continent_scale_hack = $continent_scale_hack" -f "$final_path/world/src/sim/mod.rs"
ynh_replace_string -m "continent_scale_hack = [0-9]\{1,\}\.[0-9]\{1,\}" -r "continent_scale_hack = $continent_scale_hack" -f "$final_path/build/world/src/sim/mod.rs"
fi
if [ ! -z "$days_in_month" ]; then
ynh_replace_string -m "MONTH: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "MONTH: f32 = $days_in_month" -f "$final_path/world/src/sim2/mod.rs"
ynh_replace_string -m "MONTH: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "MONTH: f32 = $days_in_month" -f "$final_path/build/world/src/sim2/mod.rs"
fi
if [ ! -z "$months_in_year" ]; then
ynh_replace_string -m "YEAR: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "YEAR: f32 = $months_in_year" -f "$final_path/world/src/sim2/mod.rs"
ynh_replace_string -m "YEAR: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "YEAR: f32 = $months_in_year" -f "$final_path/build/world/src/sim2/mod.rs"
fi
if [ ! -z "$months_in_tick" ]; then
ynh_replace_string -m "TICK_PERIOD: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "TICK_PERIOD: f32 = $months_in_tick" -f "$final_path/world/src/sim2/mod.rs"
ynh_replace_string -m "TICK_PERIOD: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "TICK_PERIOD: f32 = $months_in_tick" -f "$final_path/build/world/src/sim2/mod.rs"
fi
if [ ! -z "$years_in_history" ]; then
ynh_replace_string -m "HISTORY_DAYS: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "HISTORY_DAYS: f32 = $years_in_history" -f "$final_path/world/src/sim2/mod.rs"
ynh_replace_string -m "HISTORY_DAYS: f32 = [0-9]\{1,\}\.[0-9]\{1,\}" -r "HISTORY_DAYS: f32 = $years_in_history" -f "$final_path/build/world/src/sim2/mod.rs"
fi
if [ $generate_economy_csv -eq 1 ]; then
ynh_replace_special_string -m "GENERATE_CSV: bool = false" -r "GENERATE_CSV: bool = true" -f "$final_path/world/src/sim2/mod.rs"
ynh_replace_special_string -m "GENERATE_CSV: bool = false" -r "GENERATE_CSV: bool = true" -f "$final_path/build/world/src/sim2/mod.rs"
fi
if [ $allow_inter_site_trade -eq 0 ]; then
ynh_replace_special_string -m "INTER_SITE_TRADE: bool = true" -r "INTER_SITE_TRADE: bool = false" -f "$final_path/world/src/sim2/mod.rs"
ynh_replace_special_string -m "INTER_SITE_TRADE: bool = true" -r "INTER_SITE_TRADE: bool = false" -f "$final_path/build/world/src/sim2/mod.rs"
fi
}
function set_permissions {
mkdir -p "$final_path"
chown -R root:$app "$final_path"
chown -R $app:$app "$final_path"
chmod -R g=u,g-w,o-rwx "$final_path"
mkdir -p "$data_path"
@ -74,25 +74,31 @@ function set_permissions {
}
function install_rust {
sudo -u $app bash -c '
curl https://sh.rustup.rs -sSf | sh -s -- -q -y 2>&1
source ~/.cargo/env
rustup toolchain install $(cat "'"$final_path/rust-toolchain"'") 2>&1
'
ynh_exec_warn_less ynh_exec_as "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain stable'
}
function compile_server {
install_rust
chown -R $app:$app "$final_path"
pushd "$final_path"
sudo -u $app bash -c "
source ~/.cargo/env
NIX_GIT_HASH=\"cf2bdb20/2021-06-12-08:55\" NIX_GIT_TAG=\"v0.10.0\" VELOREN_ASSETS=\"$final_path/assets\" RUSTFLAGS=\"-D warnings\" VELOREN_USERDATA_STRATEGY=system cargo build --bin veloren-server-cli --release --quiet 2>&1
"
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
pushd "$final_path/build"
ynh_exec_warn_less ynh_exec_as "$app" env PATH="$PATH" NIX_GIT_HASH="cf2bdb20/2021-06-12-08:55" NIX_GIT_TAG="v0.10.0" VELOREN_ASSETS="$final_path/assets" RUSTFLAGS="-D warnings" VELOREN_USERDATA_STRATEGY=system cargo build --bin veloren-server-cli --release
popd
sudo -u $app ln -sf "$final_path/assets" "$data_path/assets"
ynh_secure_remove --file="$final_path/live"
mkdir -p "$final_path/live/assets/"
cp -af "$final_path/build/target/release/veloren-server-cli" "$final_path/live/veloren-server-cli"
cp -af "$final_path/build/assets/common" "$final_path/live/assets/common"
cp -af "$final_path/build/assets/server" "$final_path/live/assets/server"
cp -af "$final_path/build/assets/world" "$final_path/live/assets/world"
# Remove build files and rustup
ynh_secure_remove --file="$final_path/build"
ynh_secure_remove --file="$final_path/.cargo"
ynh_secure_remove --file="$final_path/.rustup"
ynh_exec_as $app ln -sf "$final_path/assets" "$data_path/assets"
set_permissions
}
@ -103,7 +109,7 @@ function generate_custom_world {
add_configuration_files
pushd "$data_path"
grep -q "Server is ready to accept connections." <((sudo -u $app VELOREN_ASSETS="$final_path/assets" $final_path/target/release/veloren-server-cli --basic & echo $! >&3 ) 3>pid)
grep -q "Server is ready to accept connections." <((ynh_exec_as $app VELOREN_ASSETS="$final_path/assets" $final_path/live/veloren-server-cli --basic & echo $! >&3 ) 3>pid)
kill "$(<pid)"
fuser $port/tcp -k
popd

View file

@ -79,7 +79,7 @@ ynh_app_setting_set --app=$app --key=allow_inter_site_trade --value=$allow_inter
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN PORTS
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Finding an available port..." --weight=10
@ -92,8 +92,6 @@ metrics_port=$(ynh_find_port --port=$(expr $port + 1))
ynh_print_info --message="Prometheus metrics will be available at 127.0.0.1:$metrics_port/metrics"
ynh_app_setting_set --app=$app --key=metrics_port --value=$metrics_port
# Expose port publicly
# Open the port
ynh_script_progression --message="Configuring firewall..." --weight=10
ynh_exec_warn_less yunohost firewall allow --no-upnp Both $port
@ -145,8 +143,9 @@ if [ $generate_custom_world -eq 1 ]; then
fi
#=================================================
# ADD CONFIGURATIONS
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..."
add_configuration_files

View file

@ -40,12 +40,12 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_remove_systemd_config
#=================================================
# REMOVE DEPENDENCIES
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=10
ynh_script_progression --message="Removing logrotate configuration..." --weight=10
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE APP MAIN DIR
@ -56,20 +56,12 @@ ynh_script_progression --message="Removing app main directory..." --weight=10
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE APP DATA DIR
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing app data directory..." --weight=10
ynh_script_progression --message="Removing dependencies..." --weight=10
# Remove the data directory securely
ynh_secure_remove --file="$data_path"
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=10
# Remove the app-specific logrotate config
ynh_remove_logrotate
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# CLOSE A PORT
@ -86,6 +78,9 @@ fi
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
ynh_secure_remove --file="$data_path"
# Remove the log files
ynh_secure_remove --file="/var/log/$app"

View file

@ -49,14 +49,6 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$data_path"
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=15
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
@ -70,6 +62,14 @@ set_permissions
#=================================================
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=15
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE VARIOUS FILES
#=================================================
@ -84,6 +84,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..."
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
@ -98,12 +105,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=10
ynh_systemd_action --service_name=$app --action="start" --line_match="Server is ready to accept connections." --log_path="/var/log/$app/$app.log"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -32,10 +32,9 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -49,6 +48,11 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=10
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -57,13 +61,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$data_path"
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=10
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -76,6 +73,13 @@ then
setup_source
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=10
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# SPECIFIC UPGRADE
#=================================================
@ -98,8 +102,9 @@ if [ $generate_custom_world -eq 1 ]; then
fi
#=================================================
# ADD CONFIGURATIONS
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
add_configuration_files

View file

@ -1,2 +0,0 @@
*~
*.sw[op]

View file

@ -1,2 +0,0 @@
*~
*.sw[op]