diff --git a/scripts/install b/scripts/install index 24cf001..6ea7a71 100755 --- a/scripts/install +++ b/scripts/install @@ -106,6 +106,20 @@ port=$(ynh_find_port 8095) #ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_app_setting_set $app port $port +#================================================= +# INSTALL ERLANG and ELIXIR +#================================================= +ynh_print_info "Installing erlang and elixir ..." + +if [ "$(lsb_release --codename --short)" == "jessie" ]; then + sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~jessie_amd64.deb + sudo apt install -y ../sources/elixir_1.8.1-2~debian~jessie_amd64.deb +elif + [ "$(lsb_release --codename --short)" == "stretch" ]; then + sudo apt install -y ../sources/esl-erlang_21.2.6-1~debian~stretch_amd64.deb + sudo apt install -y ../sources/elixir_1.8.1-2~debian~stretch_amd64.deb +fi + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -118,19 +132,6 @@ ynh_print_info "Installing dependencies ..." ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -# Add erlang for Debian Jessie - -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -elif - [ "$(lsb_release --codename --short)" == "stretch" ]; then - echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list -fi -sudo wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc -sudo apt-key add erlang_solutions.asc -sudo rm erlang_solutions.asc - -# install dependencies ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools #================================================= diff --git a/scripts/remove b/scripts/remove index 6b280b1..c4f0ffb 100755 --- a/scripts/remove +++ b/scripts/remove @@ -68,7 +68,14 @@ ynh_print_info "Removing dependencies" # Remove metapackage and its dependencies ynh_remove_app_dependencies -ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list" + +#================================================= +# REMOVE ERLANG AND ELIXIR +#================================================= +ynh_print_info "Removing erlang and elixir..." + +sudo apt remove -y esl-erlang +sudo apt remove -y elixir #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/upgrade b/scripts/upgrade index a625d2d..8b74dde 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,9 @@ if [ -z $final_path ]; then ynh_app_setting_set $app final_path $final_path fi +# Remove repository +ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list" + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================