diff --git a/conf/arm.src b/conf/arm.src index d20f42e..5c0ca44 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.1.3/syncthing-linux-arm-v1.1.3.tar.gz -SOURCE_SUM=3589C9F308973B7D7600FD4BBA69652DFA0F752A28D05280940537E8242C8CE3 +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.1.1/syncthing-linux-arm-v1.1.1.tar.gz +SOURCE_SUM=02ed5e69a2b4a29c6e8cc5d47603678fd4ecee585cca1d54634491859a625e99 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/arm64.src b/conf/arm64.src new file mode 100644 index 0000000..a3c2185 --- /dev/null +++ b/conf/arm64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.1.1/syncthing-linux-arm64-v1.1.1.tar.gz +SOURCE_SUM=be333db0ec2525c2d872d5856749f2cebc582ff46b05c4d9dbfdc3726e05e6cd +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= diff --git a/conf/i386 b/conf/i386 new file mode 100644 index 0000000..0f34aa7 --- /dev/null +++ b/conf/i386 @@ -0,0 +1,6 @@ +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.1.1/syncthing-linux-386-v1.1.1.tar.gz +SOURCE_SUM=77fff3a7967ddd18c0a4214b750708230942fd818b9d599a609d42792f1d8baf +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= 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/detect_arch b/scripts/detect_arch new file mode 100644 index 0000000..ba04b7e --- /dev/null +++ b/scripts/detect_arch @@ -0,0 +1,14 @@ +#!/bin/bash + +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 86)" ]; then + architecture="i386" +elif [ -n "$(uname -m | grep arm)" ]; then + architecture="arm" +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 diff --git a/scripts/install b/scripts/install index 4fedcf6..f83c02a 100644 --- a/scripts/install +++ b/scripts/install @@ -7,6 +7,7 @@ #================================================= source _common.sh +source detect_arch source /usr/share/yunohost/helpers #================================================= @@ -75,11 +76,7 @@ ynh_print_info --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -if [ -n "$(uname -m | grep arm)" ] ; then -ynh_setup_source --dest_dir="$final_path" --source_id="arm" -else -ynh_setup_source --dest_dir="$final_path" -fi +ynh_setup_source --dest_dir="$final_path" --source_id=$architecture #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 315d4d3..4fd384d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,6 +7,7 @@ #================================================= source _common.sh +source detect_arch source /usr/share/yunohost/helpers #================================================= @@ -115,7 +116,7 @@ then ynh_print_info --message="Upgrading source files..." # 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 fi #=================================================