From 9dbb7408e231a879fb66a905c56a4b92f7e6b01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 6 Jan 2024 11:43:51 +0100 Subject: [PATCH] Move phantomjs bin to install_dir --- conf/.env | 2 +- scripts/_common.sh | 13 +++++++------ scripts/remove | 2 -- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/conf/.env b/conf/.env index 3b88222..146c2d4 100644 --- a/conf/.env +++ b/conf/.env @@ -29,7 +29,7 @@ MAILGUN_SECRET= #POSTMARK_API_TOKEN= -PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs +PHANTOMJS_BIN_PATH=__INSTALL_DIR__/phantomjs/bin/phantomjs PHANTOMJS_SECRET=__PHANTOMJS_KEY__ LOG=single diff --git a/scripts/_common.sh b/scripts/_common.sh index 48f7e8a..fd0fb7d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,15 +9,16 @@ #================================================= _install_phantomjs() { - tmpdir="$(mktemp -d)" + source_dir="$install_dir/phantomjs/source" + destdir="$install_dir/phantomjs" + ynh_setup_source --dest_dir="$source_dir" --source_id="phantomjs" - ynh_setup_source --dest_dir="$tmpdir" --source_id="phantomjs" - pushd "$tmpdir" - ynh_exec_warn_less ./configure && ynh_exec_warn_less make + pushd "$source_dir" + ynh_exec_warn_less DESTDIR="$destdir" ./configure + ynh_exec_warn_less make -j "$(nproc)" ynh_exec_warn_less make install popd - - ynh_secure_remove --file="$tmpdir" + ynh_secure_remove --file="$source_dir" } #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/remove b/scripts/remove index 107c3c4..b88f6a3 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,8 +23,6 @@ ynh_remove_fpm_config # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" -ynh_secure_remove --file="/usr/local/bin/phantomjs" - #================================================= # END OF SCRIPT #=================================================