diff --git a/conf/arm.src b/conf/armv7.src similarity index 100% rename from conf/arm.src rename to conf/armv7.src diff --git a/scripts/_common.sh b/scripts/_common.sh index f0f9832..d95bb40 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,16 +10,47 @@ DATA_PATH="$DATADIR/data" # Detect the system architecture to download the right tarball # NOTE: `uname -m` is more accurate and universal than `arch` # See https://en.wikipedia.org/wiki/Uname +ynh_detect_arch(){ + local architecture if [ -n "$(uname -m | grep 64)" ]; then architecture="x86-64" elif [ -n "$(uname -m | grep 86)" ]; then architecture="i386" elif [ -n "$(uname -m | grep arm)" ]; then - architecture="arm" + architecture="armv7" else ynh_die "Unable to detect your achitecture, please open a bug describing \ your hardware and the result of the command \"uname -m\"." 1 fi +} + + +# 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 86)" ]; then +# architecture="i386" +# elif [ -n "$(uname -m | grep 64)" ]; then +# architecture="x86-64" +# elif [ -n "$(uname -m | grep armv7)" ]; then +# architecture="armv7" +# elif [ -n "$(uname -m | grep armv6)" ]; then +# architecture="armv6" +# elif [ -n "$(uname -m | grep armv5)" ]; then +# architecture="armv5" +# else +# architecture="unknown" +# fi +# echo $architecture +# } #================================================= # DEFINE ALL COMMON FONCTIONS diff --git a/scripts/install b/scripts/install index fc7e0a5..ae7ee3a 100644 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +architecture=$(ynh_detect_arch) app=$YNH_APP_INSTANCE_NAME @@ -86,7 +87,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 $architecture +ynh_setup_source --dest_dir=$final_path --source_id="$architecture" #================================================= # STANDARD MODIFICATIONS