diff --git a/manifest.json b/manifest.json index 3a4bea3..909c2bb 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A movie collection manager for Usenet and BitTorrent users.", "fr": "Un gestionnaire de filmothèque pour utilisateurs de Usenet et BitTorrent." }, - "version": "3.1.1.4954~ynh1", + "version": "3.1.1.4954~ynh2", "url": "https://radarr.video", "upstream": { "license": "GPL-3.0-only", diff --git a/scripts/_common.sh b/scripts/_common.sh index 0bc0883..5f58ee2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,10 +5,9 @@ #================================================= version="3.1.1.4954" -architecture=$(dpkg --print-architecture) -if [ $architecture = "amd64" ]; then - architecture="x64" -fi + +# Supported architectures +supported_architectures=("arm" "arm64" "x64") # dependencies used by the app pkg_dependencies="curl mediainfo sqlite3" @@ -17,6 +16,19 @@ pkg_dependencies="curl mediainfo sqlite3" # PERSONAL HELPERS #================================================= +get_architecture() { + architecture=$(dpkg --print-architecture) + if [ $architecture = "amd64" ]; then + architecture="x64" + elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 32 ]]; then + architecture="arm" + elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 64 ]]; then + architecture="arm64" + elif [[ $(echo ${supported_architectures[@]} | grep -ow "$architecture" | wc -w) = 0 ]]; then + ynh_die --message="Unsupported architecture $architecture" + fi +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 4a58517..e209802 100755 --- a/scripts/install +++ b/scripts/install @@ -81,6 +81,8 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 +get_architecture + 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" --source_id="app.$architecture" diff --git a/scripts/update_version.sh b/scripts/update_version.sh index f16e847..03cc08f 100755 --- a/scripts/update_version.sh +++ b/scripts/update_version.sh @@ -58,8 +58,7 @@ prepare_source () { echo "$destination updated" } -architectures=("arm" "arm64" "x64") -for architecture in "${architectures[@]}"; do +for architecture in "${supported_architectures[@]}"; do prepare_source --template="../conf/app.src.default" --destination="../conf/app.$architecture.src" --architecture="$architecture" done diff --git a/scripts/upgrade b/scripts/upgrade index 7c58276..b78dc2a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,6 +83,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=3 + get_architecture + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="app.$architecture" fi