diff --git a/README.md b/README.md index 36f3a98..f03b31f 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,12 @@ Can be run as Single User Blog or Multi User Instance. Each User can be limited from 1 to unlimited blogs. -**WriteFreely** require a dedicated **root domain**, eg. writefreely.domain.tld - **Shipped version:** v0.10.0 +## Important points to read before installing + +**WriteFreely** require a dedicated **root domain**, eg. writefreely.domain.tld + ## Screenshots ![writefreely-screenshot1](https://user-images.githubusercontent.com/30271971/52228565-fa4ab300-28b2-11e9-8983-3eb8cdbc2262.png) @@ -65,7 +67,6 @@ If User Mode is configured Multiple users, the app be used by multiple users Developers info ---------------- -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/writefreely_ynh/tree/testing). To try the testing branch, please proceed like that. diff --git a/conf/arm.src b/conf/arm.src new file mode 100644 index 0000000..c59cf88 --- /dev/null +++ b/conf/arm.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://github.com/writeas/writefreely/releases/download/v0.10.0/writefreely_0.10.0_linux_arm7.tar.gz +SOURCE_SUM=a746db116272d5ded74cd5556b56ed2f2c4f6af1785f44e6254b63adee0a7d92 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=false +SOURCE_FILENAME= diff --git a/conf/x86-64.src b/conf/x86-64.src index b7871a7..ab1ad89 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ SOURCE_URL=https://github.com/writeas/writefreely/releases/download/v0.10.0/writefreely_0.10.0_linux_amd64.tar.gz -SOURCE_SUM=6dea841d2f81abd0569915011f183aa818a6f2750da1f953848e05bc49073f3d +SOURCE_SUM=11498cfc579b94326bdae0b61a992ba4ee3a0200a83920043c1d8ea3bdce8380 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=false diff --git a/scripts/detect_arch b/scripts/detect_arch deleted file mode 100644 index ba04b7e..0000000 --- a/scripts/detect_arch +++ /dev/null @@ -1,14 +0,0 @@ -#!/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 3529a9d..3219d11 100755 --- a/scripts/install +++ b/scripts/install @@ -8,7 +8,7 @@ source detect_arch source _common.sh -source detect_arch +source ynh_detect_arch__2 source /usr/share/yunohost/helpers #================================================= @@ -34,9 +34,10 @@ is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD single_user=$YNH_APP_ARG_SINGLE_USER +architecture=$(ynh_detect_arch) + # Bypass package_checker name not compatible with writefreely -if [ "$admin" = "package_checker" ] -then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then admin="test" fi @@ -47,10 +48,10 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_print_info --message="Validating installation parameters..." -# Check machine architecture (in particular, we don't support ARM and 32bit machines) -if [ $architecture == "x86_64" ] || [ $architecture == "arm" ] +# Check machine architecture, we don't support 32bit machines +if [ $architecture = "i386" ] then - ynh_die --message="Sorry, but this app can only be installed on a x86, 64 bits machine :(" + ynh_die --message="Sorry, but this app cannot be installed on a i386 32 bits machine :(" fi final_path=/var/www/$app diff --git a/scripts/upgrade b/scripts/upgrade index a05907a..38d7f60 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,7 @@ source detect_arch source _common.sh -source detect_arch +source ynh_detect_arch__2 source ynh_check_app_version_changed source /usr/share/yunohost/helpers @@ -28,6 +28,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) port=$(ynh_app_setting_get --app=$app --key=port) +architecture=$(ynh_detect_arch) + #================================================= # CHECK VERSION #================================================= diff --git a/scripts/ynh_detect_arch__2 b/scripts/ynh_detect_arch__2 new file mode 100644 index 0000000..b1c7375 --- /dev/null +++ b/scripts/ynh_detect_arch__2 @@ -0,0 +1,25 @@ +#!/bin/bash + +# 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 +}