diff --git a/conf/arm.src b/conf/arm.src new file mode 100644 index 0000000..54444f7 --- /dev/null +++ b/conf/arm.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v5.30.1/mattermost-v5.30.1-linux-arm.tar.gz +SOURCE_SUM=2292157939eb5be0ac5e1d58bc690d8f359040f1ae55f37f1f90cab422d11e2d +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost-v5.30.1-linux-arm.tar.gz diff --git a/conf/arm64.src b/conf/arm64.src new file mode 100644 index 0000000..f84fc7d --- /dev/null +++ b/conf/arm64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v5.30.1/mattermost-v5.30.1-linux-arm64.tar.gz +SOURCE_SUM=cbd150100947686c2d177db6067e98a36859e7da2fe4c173b89925a2fd1415d1 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost-5.30.1-linux-amd64.tar.gz diff --git a/conf/app.src b/conf/x86-64.src similarity index 100% rename from conf/app.src rename to conf/x86-64.src diff --git a/scripts/_common.sh b/scripts/_common.sh index 7401a47..7916409 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -12,6 +12,33 @@ # EXPERIMENTAL HELPERS #================================================= +# Check the architecture +# +# example: architecture=$(ynh_detect_arch) +# +# usage: ynh_detect_arch +# +# Requires YunoHost version 2.2.4 or higher. + +ynh_detect_arch(){ + local architecture + if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then + architecture="arm64" + elif [ -n "$(uname -m | grep 64)" ]; then + architecture="x86-64" + elif [ -n "$(uname -m | grep armv7)" ]; then + architecture="arm" + elif [ -n "$(uname -m | grep armv6)" ]; then + architecture="arm" + elif [ -n "$(uname -m | grep armv5)" ]; then + architecture="arm" + else + architecture="unknown" + fi + echo $architecture +} + + #================================================= # FUTURE OFFICIAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index ef8f81f..55b1ee3 100644 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ email=$(ynh_user_get_info "$admin" mail) password=$YNH_APP_ARG_PASSWORD language=$YNH_APP_ARG_LANGUAGE team_display_name=$YNH_APP_ARG_TEAM_DISPLAY_NAME +architecture=$(ynh_detect_arch) app=$YNH_APP_INSTANCE_NAME @@ -93,7 +94,7 @@ ynh_script_progression --message="Setting up source files..." --weight=3 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" #================================================= # CREATE DIRECTORY FOR DATA diff --git a/scripts/upgrade b/scripts/upgrade index 5a6a4f0..371ae6e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,6 +33,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +architecture=$(ynh_detect_arch) #================================================= # CHECK VERSION @@ -100,7 +101,7 @@ then ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" # Copy the admin saved settings from tmp directory to final path cp -a "$tmpdir/config.json" "$final_path/config/config.json"