diff --git a/conf/arm64.src b/conf/arm64.src new file mode 100644 index 0000000..cc50123 --- /dev/null +++ b/conf/arm64.src @@ -0,0 +1,11 @@ +SOURCE_URL=https://github.com/haiwen/seafile-rpi/releases/download/v7.1.5/seafile-server-7.1.5-buster-armv7.tar.gz +SOURCE_SUM=4baec21c1acaec6f50c7a1b229a728417d8fbf87fe3be98f128bc9d2ad399681 +# (Optional) Program to check the integrity (sha256sum, md5sum...) +# default: sha256 +SOURCE_SUM_PRG=sha256sum +# (Optional) Archive format +# default: tar.gz +SOURCE_FORMAT=tar.gz +# (Optional) Put false if sources are directly in the archive root +# default: true +SOURCE_IN_SUBDIR=true diff --git a/conf/arm64_7_0.src b/conf/arm64_7_0.src new file mode 100644 index 0000000..7cb9b0d --- /dev/null +++ b/conf/arm64_7_0.src @@ -0,0 +1,11 @@ +SOURCE_URL=https://github.com/haiwen/seafile-rpi/releases/download/v7.0.5/seafile-server_7.0.5_stable_pi.tar.gz +SOURCE_SUM=dae9ab5d232a2b56f129aa29e7e54d2de05d838f0479955543cebcb14c9417db +# (Optional) Program to check the integrity (sha256sum, md5sum...) +# default: sha256 +SOURCE_SUM_PRG=sha256sum +# (Optional) Archive format +# default: tar.gz +SOURCE_FORMAT=tar.gz +# (Optional) Put false if sources are directly in the archive root +# default: true +SOURCE_IN_SUBDIR=true diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 1d3db9b..6df5480 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -1,16 +1,27 @@ -# 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 -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" -else - ynh_die --message "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 64)" ]; then + architecture="x86-64" + elif [ -n "$(uname -m | grep 86)" ]; then + architecture="i386" + elif [ -n "$(uname -m | grep arm)" ]; then + architecture="arm" + else + architecture="unknown" + fi + echo $architecture +} # Add swap diff --git a/scripts/install b/scripts/install index cda7baa..b9ff3b9 100644 --- a/scripts/install +++ b/scripts/install @@ -27,6 +27,7 @@ final_path=/opt/yunohost/$app seafile_user=$app admin_password=$YNH_APP_ARG_ADMIN_PASSWORD seafile_version=$(ynh_app_upstream_version) +architecture=$(ynh_detect_arch) # Create special path with / at the end if [[ $path_url == '/' ]] diff --git a/scripts/restore b/scripts/restore index 89ee42b..246a38d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,6 +23,7 @@ seafile_data=/home/yunohost.app/seafile-data db_pwd=$(ynh_app_setting_get --app $app --key mysqlpwd) final_path=$(ynh_app_setting_get --app $app --key final_path) seafile_user=$app +architecture=$(ynh_detect_arch) # Check domain/path availability ynh_webpath_available --domain $domain --path_url $path_url || ynh_die --message "$domain/$path_url is not available, please use an other domain or path." diff --git a/scripts/upgrade b/scripts/upgrade index 68cf2e7..ae4c847 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,7 @@ seafile_user=$app seafile_data=/home/yunohost.app/seafile-data installed_version=${YNH_APP_CURRENT_VERSION/~ynh*/} seafile_version=$(ynh_app_upstream_version) +architecture=$(ynh_detect_arch) if [ "$YNH_APP_CURRENT_VERSION" == '-' ]; then YNH_APP_CURRENT_VERSION="6.0.9~ynh0"