1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/listmonk_ynh.git synced 2024-09-03 19:36:15 +02:00

build all archs

This commit is contained in:
Éric Gaspar 2023-03-22 16:00:23 +01:00
parent 5e9462de37
commit 133ff32455
3 changed files with 38 additions and 55 deletions

View file

@ -46,13 +46,8 @@ ram.runtime = "50M"
[resources.sources]
[resources.sources.main]
amd64.url = "https://github.com/knadh/listmonk/releases/download/v2.4.0/listmonk_2.4.0_linux_amd64.tar.gz"
amd64.sha256 = "acdfd0f4549c15e3cd77a28778ac9904cc54abf3bec98074ee96edc64242971b"
armhf.url = "https://github.com/knadh/listmonk/archive/refs/tags/v2.4.0.tar.gz"
armhf.sha256 = "0a1fb22b485369fd47e8f19830e41c4fe5f6cf839f701fac0f6500071968faf8"
arm64.url = "https://github.com/knadh/listmonk/archive/refs/tags/v2.4.0.tar.gz"
arm64.sha256 = "0a1fb22b485369fd47e8f19830e41c4fe5f6cf839f701fac0f6500071968faf8"
in_subdir = false
url = "https://github.com/knadh/listmonk/archive/refs/tags/v2.4.0.tar.gz"
sha256 = "0a1fb22b485369fd47e8f19830e41c4fe5f6cf839f701fac0f6500071968faf8"
[resources.system_user]

View file

@ -27,14 +27,11 @@ ynh_app_setting_set --app=$app --key=password --value="$password"
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=12
if [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ]
then
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Go
ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION
fi
# Install Go
ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -42,24 +39,20 @@ fi
ynh_script_progression --message="Setting up source files..." --weight=3
# Download, check integrity, uncompress and patch the source from app.src
if [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ]
then
ynh_setup_source --dest_dir="$install_dir/build"
pushd "$install_dir/build"
# Build the sources
ynh_use_go
export GOPATH="$install_dir/build/go"
export GOCACHE="$install_dir/build/.cache"
ynh_use_nodejs
make dist
mv listmonk ..
popd
ynh_remove_go
ynh_remove_nodejs
ynh_secure_remove --file="$install_dir/build"
else
ynh_setup_source --dest_dir="$install_dir"
fi
ynh_setup_source --dest_dir="$install_dir/build"
pushd "$install_dir/build"
# Build the sources
ynh_use_go
export GOPATH="$install_dir/build/go"
export GOCACHE="$install_dir/build/.cache"
ynh_use_nodejs
make dist
mv listmonk ..
popd
ynh_remove_go
ynh_remove_nodejs
ynh_secure_remove --file="$install_dir/build"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"

View file

@ -33,29 +33,24 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
if [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ]
then
ynh_setup_source --dest_dir="$install_dir/build" --keep="$install_dir/config.toml"
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Go
ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION
pushd "$install_dir/build"
# Build the sources
ynh_use_go
export GOPATH="$install_dir/build/go"
export GOCACHE="$install_dir/build/.cache"
ynh_use_nodejs
make dist
mv listmonk ..
popd
ynh_remove_go
ynh_remove_nodejs
ynh_secure_remove --file="$install_dir/build"
else
ynh_setup_source --dest_dir="$install_dir" --keep="$install_dir/config.toml"
fi
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/build" --keep="$install_dir/config.toml"
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Go
ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION
pushd "$install_dir/build"
# Build the sources
ynh_use_go
export GOPATH="$install_dir/build/go"
export GOCACHE="$install_dir/build/.cache"
ynh_use_nodejs
make dist
mv listmonk ..
popd
ynh_remove_go
ynh_remove_nodejs
ynh_secure_remove --file="$install_dir/build"
fi
chmod -R o-rwx "$install_dir"