1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/listmonk_ynh.git synced 2024-09-03 19:36:15 +02:00
This commit is contained in:
Éric Gaspar 2023-03-10 19:12:11 +01:00
parent c4e6661395
commit 0c58423df4
2 changed files with 18 additions and 20 deletions

View file

@ -41,31 +41,29 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=3 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 # Download, check integrity, uncompress and patch the source from app.src
if [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ] if [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ]
then then
ynh_setup_source --dest_dir="$final_path/build" --source_id=arm ynh_setup_source --dest_dir="$install_dir/build" --source_id=arm
pushd "$final_path/build" pushd "$install_dir/build"
# Build the sources # Build the sources
ynh_use_go ynh_use_go
export GOPATH="$final_path/build/go" export GOPATH="$install_dir/build/go"
export GOCACHE="$final_path/build/.cache" export GOCACHE="$install_dir/build/.cache"
ynh_use_nodejs ynh_use_nodejs
make dist make dist
mv listmonk .. mv listmonk ..
popd popd
ynh_remove_go ynh_remove_go
ynh_remove_nodejs ynh_remove_nodejs
ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$install_dir/build"
else else
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$install_dir"
fi fi
chmod -R o-rwx "$final_path" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$install_dir"
chmod +x "$final_path/listmonk" chmod +x "$install_dir/listmonk"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION

View file

@ -36,31 +36,31 @@ then
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
if [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ] if [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ]
then then
ynh_setup_source --dest_dir="$final_path/build" --source_id=arm --keep="$final_path/config.toml" ynh_setup_source --dest_dir="$install_dir/build" --source_id=arm --keep="$install_dir/config.toml"
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Go # Install Go
ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION
pushd "$final_path/build" pushd "$install_dir/build"
# Build the sources # Build the sources
ynh_use_go ynh_use_go
export GOPATH="$final_path/build/go" export GOPATH="$install_dir/build/go"
export GOCACHE="$final_path/build/.cache" export GOCACHE="$install_dir/build/.cache"
ynh_use_nodejs ynh_use_nodejs
make dist make dist
mv listmonk .. mv listmonk ..
popd popd
ynh_remove_go ynh_remove_go
ynh_remove_nodejs ynh_remove_nodejs
ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$install_dir/build"
else else
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.toml" ynh_setup_source --dest_dir="$install_dir" --keep="$install_dir/config.toml"
fi fi
fi fi
chmod -R o-rwx "$final_path" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$install_dir"
chmod +x "$final_path/listmonk" chmod +x "$install_dir/listmonk"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION