From 10d2dfdbda32b9aa9d831360669f065a955b8874 Mon Sep 17 00:00:00 2001 From: Bram Date: Thu, 18 Jul 2019 14:25:29 +0200 Subject: [PATCH 01/14] Better error message when the distro is not stretch --- install_yunohost | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_yunohost b/install_yunohost index f4044e2..bd67202 100755 --- a/install_yunohost +++ b/install_yunohost @@ -209,19 +209,19 @@ function check_assertions() # Assert we're on Debian # Note : we do not rely on lsb_release to avoid installing a dependency # only to check this... - [[ -f "/etc/debian_version" ]] || die "This script can only be ran on Debian." + [[ -f "/etc/debian_version" ]] || die "This script can only be ran on Debian 9 (Stretch)." # Assert we're on Stretch # Note : we do not rely on lsb_release to avoid installing a dependency # only to check this... - [[ "$(cat /etc/debian_version)" =~ ^9.* ]] || die "This script can only be ran on Debian Stretch." + [[ "$(cat /etc/debian_version)" =~ ^9.* ]] || die "YunoHost is only available for the version 9 (Stretch) of Debian, you are using '$(cat /etc/debian_version)'." # Forbid people from installing on Ubuntu or Linux mint ... if [[ -f "/etc/lsb-release" ]]; then if cat /etc/lsb-release | grep -q -i "Ubuntu\|Mint" then - die "Please don't try to install YunoHost on an Ubuntu or Linux Mint system ... You need a 'raw' Debian." + die "Please don't try to install YunoHost on an Ubuntu or Linux Mint system ... You need a 'raw' Debian 9 (Stretch)." fi fi From 465d9493aa4d690dff034f2a746178dbb8e71625 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 20 Jul 2019 12:55:37 +0000 Subject: [PATCH 02/14] Attempt to fix debhelper issue --- install_yunohost | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install_yunohost b/install_yunohost index bd67202..ab8fe4c 100755 --- a/install_yunohost +++ b/install_yunohost @@ -472,6 +472,15 @@ function install_yunohost_packages() { # We need to make it mutable for the resolvconf dependency to be installed chattr -i /etc/resolv.conf 2>/dev/null || true + # Install those damn deps independently ... + # otherwise they make the install crash for random reasons ~.~ + # c.f. https://github.com/YunoHost/issues/issues/1382 + apt_get_wrapper \ + -o Dpkg::Options::="--force-confold" \ + -y --force-yes install \ + debhelper dh-autoreconf \ + || true + # Install YunoHost apt_get_wrapper \ -o Dpkg::Options::="--force-confold" \ From 6ceb9cb9e4d89e6f60db7a2c04b74230f264c020 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 29 Jul 2019 23:55:00 +0200 Subject: [PATCH 03/14] [cosmetic] --scrolltext wasnt needed here, made the window look broken --- install_yunohost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_yunohost b/install_yunohost index ab8fe4c..8b5350c 100755 --- a/install_yunohost +++ b/install_yunohost @@ -369,7 +369,7 @@ Do you agree to let YunoHost apply those changes to your configuration and there [[ "$sshd_config_possible_issues" == "0" ]] && return 0 # Otherwise, we ask the user to confirm - if ! whiptail --title "SSH Configuration" --yesno "$text" 20 78 --defaultno --scrolltext ; then + if ! whiptail --title "SSH Configuration" --yesno "$text" 20 78 --defaultno ; then # Keep a copy to be restored during the postinstall # so that the ssh confs behaves as manually modified. From ec06974a379b12d2b83ada5e7bee59035cfaa925 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 11 Aug 2019 22:24:04 +0200 Subject: [PATCH 04/14] Fucking fail2ban fails to install because the default jail points to a (sometimes) inexisting log file which miserably the apt/dpkg install in a yunohost-unrelated way ... --- install_yunohost | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/install_yunohost b/install_yunohost index 8b5350c..82c4b01 100755 --- a/install_yunohost +++ b/install_yunohost @@ -107,7 +107,7 @@ function main() step setup_package_source || die "Setting up deb package sources failed" step apt_update || die "Error caught during 'apt-get update'" step register_debconf || die "Unable to insert new values into debconf database" - step workaround_avahi_installation || die "Unable to install workaround for avahi installation" + step workarounds_because_sysadmin_sucks || die "Unable to run stupid workarounds" step install_yunohost_packages || die "Installation of Yunohost packages failed" step restart_services || die "Error caught during services restart" @@ -423,7 +423,7 @@ postsrsd postsrsd/domain string yunohost.org EOF } -function workaround_avahi_installation() { +function workarounds_because_sysadmin_sucks() { # When attempting several installation of Yunohost on the same host # with a light VM system like LXC @@ -461,6 +461,15 @@ function workaround_avahi_installation() { --home /var/run/avahi-daemon --no-create-home \ --gecos "Avahi mDNS daemon" --group avahi \ --uid $avahi_id + + # ######################## # + # Workarounds for fail2ban # + # ######################## # + + # We need to create auth.log in case it does not exists, because in some situation, + # this file does not exists, fail2ban will miserably fail to start because + # the default fail2ban jail include the sshd jail ... >.> + touch /var/log/auth.log } function install_yunohost_packages() { From 8d2974230c261d40eb95180ccb0f166e9031a879 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 11 Aug 2019 22:25:54 +0200 Subject: [PATCH 05/14] Eh gotta do the fail2ban thing first because the avahi part 'returns' in some case later --- install_yunohost | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/install_yunohost b/install_yunohost index 82c4b01..2e8a1e4 100755 --- a/install_yunohost +++ b/install_yunohost @@ -425,6 +425,19 @@ EOF function workarounds_because_sysadmin_sucks() { + # ######################## # + # Workarounds for fail2ban # + # ######################## # + + # We need to create auth.log in case it does not exists, because in some situation, + # this file does not exists, fail2ban will miserably fail to start because + # the default fail2ban jail include the sshd jail ... >.> + touch /var/log/auth.log + + # ######################## # + # Workarounds for avahi # + # ######################## # + # When attempting several installation of Yunohost on the same host # with a light VM system like LXC # we hit a bug with avahi-daemon postinstallation @@ -461,15 +474,7 @@ function workarounds_because_sysadmin_sucks() { --home /var/run/avahi-daemon --no-create-home \ --gecos "Avahi mDNS daemon" --group avahi \ --uid $avahi_id - - # ######################## # - # Workarounds for fail2ban # - # ######################## # - - # We need to create auth.log in case it does not exists, because in some situation, - # this file does not exists, fail2ban will miserably fail to start because - # the default fail2ban jail include the sshd jail ... >.> - touch /var/log/auth.log + } function install_yunohost_packages() { From 9a7079012422f75758f58fc562d964ca1e7cb421 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 11 Aug 2019 22:32:28 +0200 Subject: [PATCH 06/14] [enh] Avoid obsolete warning about force-yes --- install_yunohost | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_yunohost b/install_yunohost index 8b5350c..3d03b40 100755 --- a/install_yunohost +++ b/install_yunohost @@ -259,7 +259,7 @@ function upgrade_system() { # perl is yolomacnuggets :| # Stuff like "Can't locate object method "new" via package "Text::Iconv"" apt_get_wrapper -o Dpkg::Options::="--force-confold" \ - -y --force-yes install \ + -y --allow-change-held-packages install \ libtext-iconv-perl \ || return 1 @@ -278,7 +278,7 @@ function upgrade_system() { if is_raspbian ; then apt_get_wrapper -o Dpkg::Options::="--force-confold" \ - -y --force-yes install rpi-update \ + -y --allow-change-held-packages install rpi-update \ || return 3 if [[ "$BUILD_IMAGE" != "1" ]] ; then @@ -299,7 +299,7 @@ function install_script_dependencies() { apt_update apt_get_wrapper -o Dpkg::Options::="--force-confold" \ - -y --force-yes install \ + -y --allow-change-held-packages install \ $DEPENDENCIES \ || return 1 } @@ -477,7 +477,7 @@ function install_yunohost_packages() { # c.f. https://github.com/YunoHost/issues/issues/1382 apt_get_wrapper \ -o Dpkg::Options::="--force-confold" \ - -y --force-yes install \ + -y --allow-change-held-packages install \ debhelper dh-autoreconf \ || true @@ -485,7 +485,7 @@ function install_yunohost_packages() { apt_get_wrapper \ -o Dpkg::Options::="--force-confold" \ -o APT::install-recommends=true \ - -y --force-yes install \ + -y --allow-change-held-packages install \ yunohost yunohost-admin postfix \ || return 1 } From 934fc9509c22899058de4077756043606a92e605 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 12 Aug 2019 12:24:08 +0200 Subject: [PATCH 07/14] Test locale-gen exists, otherwise install locales --- install_yunohost | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_yunohost b/install_yunohost index 2e8a1e4..87ef69e 100755 --- a/install_yunohost +++ b/install_yunohost @@ -517,6 +517,9 @@ function restart_services() { function fix_locales() { # This function tries to fix the whole locale and perl mess about missing locale files + # Install 'locales' if locale-gen does not exists yet + command -v locale-gen > /dev/null || apt_get_wrapper -o Dpkg::Options::="--force-confold" -y install locales + # Generate at least en_US.UTF-8 sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen From 54c639cb0477e9f83a6de90e7a65295341240a1e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 12 Aug 2019 13:30:05 +0200 Subject: [PATCH 08/14] Refuse to install on docker or other weird containers --- install_yunohost | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install_yunohost b/install_yunohost index 87ef69e..0263d0f 100755 --- a/install_yunohost +++ b/install_yunohost @@ -240,6 +240,10 @@ function check_assertions() user_pi_logged_out || die "The user pi should be logged out." fi + # Check we aren't running in docker or other weird containers that we can't probably install on + systemd-detect-virt | grep -v -q -w "docker\|container-other" || [[ "$FORCE" == "1" ]] + || die "It seems like you are trying to install YunoHost in docker or a weird container technology which probably is not supported by this install script (or YunoHost as a whole). If you know what you are doing, you can run this script with -f." + # Check possible conflict with apache, bind9. [[ -z "$(dpkg --get-selections | grep -v deinstall | grep 'bind9\s')" ]] || [[ "$FORCE" == "1" ]] \ || die "Bind9 is installed and might conflict with dnsmasq. Uninstall it first, or if you know what you are doing, run this script with -f." From 58a178443b6297504d12dd840e77bdd2b93d74fa Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 12 Aug 2019 13:35:22 +0200 Subject: [PATCH 09/14] Go home Alex you drunk --- install_yunohost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_yunohost b/install_yunohost index 0263d0f..405f7f1 100755 --- a/install_yunohost +++ b/install_yunohost @@ -241,7 +241,7 @@ function check_assertions() fi # Check we aren't running in docker or other weird containers that we can't probably install on - systemd-detect-virt | grep -v -q -w "docker\|container-other" || [[ "$FORCE" == "1" ]] + systemd-detect-virt | grep -v -q -w "docker\|container-other" || [[ "$FORCE" == "1" ]] \ || die "It seems like you are trying to install YunoHost in docker or a weird container technology which probably is not supported by this install script (or YunoHost as a whole). If you know what you are doing, you can run this script with -f." # Check possible conflict with apache, bind9. From 354f88d1af907d601215a795bd689883fd847cff Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 10 Sep 2019 13:27:26 +0200 Subject: [PATCH 10/14] Remove --allow-change-held-packages, probably not needed --- install_yunohost | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_yunohost b/install_yunohost index 3d03b40..ce6f8ae 100755 --- a/install_yunohost +++ b/install_yunohost @@ -259,7 +259,7 @@ function upgrade_system() { # perl is yolomacnuggets :| # Stuff like "Can't locate object method "new" via package "Text::Iconv"" apt_get_wrapper -o Dpkg::Options::="--force-confold" \ - -y --allow-change-held-packages install \ + -y install \ libtext-iconv-perl \ || return 1 @@ -278,7 +278,7 @@ function upgrade_system() { if is_raspbian ; then apt_get_wrapper -o Dpkg::Options::="--force-confold" \ - -y --allow-change-held-packages install rpi-update \ + -y install rpi-update \ || return 3 if [[ "$BUILD_IMAGE" != "1" ]] ; then @@ -299,7 +299,7 @@ function install_script_dependencies() { apt_update apt_get_wrapper -o Dpkg::Options::="--force-confold" \ - -y --allow-change-held-packages install \ + -y install \ $DEPENDENCIES \ || return 1 } @@ -477,7 +477,7 @@ function install_yunohost_packages() { # c.f. https://github.com/YunoHost/issues/issues/1382 apt_get_wrapper \ -o Dpkg::Options::="--force-confold" \ - -y --allow-change-held-packages install \ + -y install \ debhelper dh-autoreconf \ || true @@ -485,7 +485,7 @@ function install_yunohost_packages() { apt_get_wrapper \ -o Dpkg::Options::="--force-confold" \ -o APT::install-recommends=true \ - -y --allow-change-held-packages install \ + -y install \ yunohost yunohost-admin postfix \ || return 1 } From a4652842a52734de716a471fc48c59ff73011749 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 14 Sep 2019 20:47:25 +0200 Subject: [PATCH 11/14] In auto mode, failed steps were not triggering 'die' because tee was eating the return code --- install_yunohost | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install_yunohost b/install_yunohost index 4c3558c..a042fe3 100755 --- a/install_yunohost +++ b/install_yunohost @@ -191,7 +191,10 @@ function apt_get_wrapper() { -- \ apt-get $* else - apt-get $* 2>&1 | tee -a $YUNOHOST_LOG + # Why we need pipefail : https://stackoverflow.com/a/6872163 + set -o pipefail + apt-get $* 2>&1 | tee -a $YUNOHOST_LOG || return 1 + set +o pipefail fi } From 46b3e3dc690b31222bf48485329e084c7b16a625 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 25 Jun 2019 22:43:11 +0200 Subject: [PATCH 12/14] Initial changes to try to install on Buster --- Makefile | 24 ++++++++++++++++++++++++ debconf | 21 +++++++++++++++++++++ install_yunohost | 37 ++++++++++++++++++++++++++++--------- 3 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 Makefile create mode 100644 debconf diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a09bd5a --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +BUILD_DEPS = dh-systemd python-all gdebi git git-buildpackage lua5.1 liblua5.1-dev libidn11-dev libssl-dev txt2man quilt + +init: + apt -o Dpkg::Options::="--force-confold" -y --force-yes install $(BUILD_DEPS) + mkdir -p /ynh-build/ + cd /ynh-build/; git clone https://github.com/yunohost/moulinette; + cd /ynh-build/; git clone https://github.com/yunohost/ssowat; + cd /ynh-build/; git clone https://github.com/yunohost/metronome; + cd /ynh-build/; git clone https://github.com/yunohost/yunohost; + +metronome: + cd /ynh-build/; rm -f metronome_*; cd metronome; dpkg-buildpackage -rfakeroot -uc -b -d + +yunohost: + cd /ynh-build/; rm -f yunohost_*; cd yunohost; debuild -us -uc + +install: + cd /ynh-build/; debconf-set-selections < debconf; export SUDO_FORCE_REMOVE=yes; gdebi /ynh-build/yunohost*.deb -n + +uninstall: + apt remove slapd yunohost moulinette --purge -y + rm -rf /usr/share/yunohost/ + rm -rf /usr/lib/moulinette/ + rm -rf /etc/yunohost/ diff --git a/debconf b/debconf new file mode 100644 index 0000000..c95bbc6 --- /dev/null +++ b/debconf @@ -0,0 +1,21 @@ + +slapd slapd/password1 password yunohost +slapd slapd/password2 password yunohost +slapd slapd/domain string yunohost.org +slapd shared/organization string yunohost.org +slapd slapd/allow_ldap_v2 boolean false +slapd slapd/invalid_config boolean true +slapd slapd/backend select MDB +postfix postfix/main_mailer_type select Internet Site +postfix postfix/mailname string /etc/mailname +mysql-server-5.5 mysql-server/root_password password yunohost +mysql-server-5.5 mysql-server/root_password_again password yunohost +mariadb-server-10.0 mysql-server/root_password password yunohost +mariadb-server-10.0 mysql-server/root_password_again password yunohost +nslcd nslcd/ldap-bindpw password +nslc nslcd/ldap-starttls boolean false +nslcd nslcd/ldap-reqcert select +nslcd nslcd/ldap-uris string ldap://localhost/ +nslcd nslcd/ldap-binddn string +nslcd nslcd/ldap-base string dc=yunohost,dc=org +libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow diff --git a/install_yunohost b/install_yunohost index a042fe3..02a5f36 100755 --- a/install_yunohost +++ b/install_yunohost @@ -104,12 +104,15 @@ function main() step confirm_installation || die "Installation cancelled at your request" step manage_sshd_config || die "Error caught during sshd management" step fix_locales # do not die for a failure here, it's minor - step setup_package_source || die "Setting up deb package sources failed" - step apt_update || die "Error caught during 'apt-get update'" - step register_debconf || die "Unable to insert new values into debconf database" - step workarounds_because_sysadmin_sucks || die "Unable to run stupid workarounds" - step install_yunohost_packages || die "Installation of Yunohost packages failed" - step restart_services || die "Error caught during services restart" + step build_packages_locally || die "Failed to build packages locally" + step install_local_packages || die "Failed to install local packages" + # The following steps rely on having a real deb repo, which we don't have for now + #step setup_package_source || die "Setting up deb package sources failed" + #step apt_update || die "Error caught during 'apt-get update'" + #step register_debconf || die "Unable to insert new values into debconf database" + #step workarounds_because_sysadmin_sucks || die "Unable to run stupid workarounds" + #step install_yunohost_packages || die "Installation of Yunohost packages failed" + #step restart_services || die "Error caught during services restart" if is_raspbian ; then step del_user_pi || die "Unable to delete user pi" @@ -130,6 +133,22 @@ function main() exit 0 } +function build_packages_locally() +{ + mkdir -p /ynh-build/ + cp ./Makefile ./debconf /ynh-build/ + cd /ynh-build + make init + make metronome + make yunohost +} + +function install_local_packages() +{ + cd /ynh-build + make install +} + ############################################################################### # Helpers # ############################################################################### @@ -214,10 +233,10 @@ function check_assertions() # only to check this... [[ -f "/etc/debian_version" ]] || die "This script can only be ran on Debian 9 (Stretch)." - # Assert we're on Stretch + # Assert we're on Buster # Note : we do not rely on lsb_release to avoid installing a dependency # only to check this... - [[ "$(cat /etc/debian_version)" =~ ^9.* ]] || die "YunoHost is only available for the version 9 (Stretch) of Debian, you are using '$(cat /etc/debian_version)'." + [[ "$(cat /etc/debian_version)" =~ ^10.* ]] || die "This script can only be ran on Debian Buster, you are using '$(cat /etc/debian_version)." # Forbid people from installing on Ubuntu or Linux mint ... if [[ -f "/etc/lsb-release" ]]; @@ -392,7 +411,7 @@ function setup_package_source() { # Debian repository - local CUSTOMDEB="deb http://forge.yunohost.org/debian/ stretch stable" + local CUSTOMDEB="deb http://forge.yunohost.org/debian/ buster stable" if [[ "$DISTRIB" == "stable" ]] ; then echo "$CUSTOMDEB" > $CUSTOMAPT From 13f7a1aa0c1383e5c22120108da1745d26c225b2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 26 Jun 2019 00:16:38 +0200 Subject: [PATCH 13/14] Fix various issues with buster install after initial tests --- Makefile | 12 ++++++++++-- install_yunohost | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a09bd5a..70a96e4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -BUILD_DEPS = dh-systemd python-all gdebi git git-buildpackage lua5.1 liblua5.1-dev libidn11-dev libssl-dev txt2man quilt +BUILD_DEPS = dh-systemd dh-python python-all python-yaml python-psutil gdebi git git-buildpackage lua5.1 liblua5.1-dev libidn11-dev libssl-dev txt2man quilt postfix + +.PHONY: init metronome ssowat moulinette yunohost install uninstall init: apt -o Dpkg::Options::="--force-confold" -y --force-yes install $(BUILD_DEPS) @@ -11,11 +13,17 @@ init: metronome: cd /ynh-build/; rm -f metronome_*; cd metronome; dpkg-buildpackage -rfakeroot -uc -b -d +ssowat: + cd /ynh-build/; rm -f ssowat_*; cd ssowat; debuild -us -uc + +moulinette: + cd /ynh-build/; rm -f moulinette_*; cd moulinette; debuild -us -uc + yunohost: cd /ynh-build/; rm -f yunohost_*; cd yunohost; debuild -us -uc install: - cd /ynh-build/; debconf-set-selections < debconf; export SUDO_FORCE_REMOVE=yes; gdebi /ynh-build/yunohost*.deb -n + cd /ynh-build/; debconf-set-selections < debconf; export SUDO_FORCE_REMOVE=yes; gdebi /ynh-build/metronome*.deb -n; gdebi /ynh-build/moulinette*.deb -n; gdebi /ynh-build/ssowat*.deb -n; gdebi /ynh-build/yunohost*.deb -n uninstall: apt remove slapd yunohost moulinette --purge -y diff --git a/install_yunohost b/install_yunohost index 02a5f36..d304d60 100755 --- a/install_yunohost +++ b/install_yunohost @@ -135,6 +135,7 @@ function main() function build_packages_locally() { + apt install make -y mkdir -p /ynh-build/ cp ./Makefile ./debconf /ynh-build/ cd /ynh-build From eac4d0dae0dd1e48c330b0a96beb4b285b40b942 Mon Sep 17 00:00:00 2001 From: Etienne Mollier Date: Sun, 11 Aug 2019 18:05:14 +0200 Subject: [PATCH 14/14] Many makefile / install improvement for buster experimental from E.Mollier --- Makefile | 54 ++++++++++++++++++++++++++++++++++++------------ install_yunohost | 2 ++ 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 70a96e4..34ac2df 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,57 @@ -BUILD_DEPS = dh-systemd dh-python python-all python-yaml python-psutil gdebi git git-buildpackage lua5.1 liblua5.1-dev libidn11-dev libssl-dev txt2man quilt postfix +# YUNoHost locations +YNH_BUILD_DIR = /ynh-build/ +YNH_SOURCE = https://github.com/yunohost -.PHONY: init metronome ssowat moulinette yunohost install uninstall +BUILD_DEPS = git git-buildpackage postfix python-setuptools +APT_OPTS = -o Dpkg::Options::="--force-confold" -y #--force-yes + +.PHONY: init metronome ssowat moulinette yunohost install uninstall mrproper init: - apt -o Dpkg::Options::="--force-confold" -y --force-yes install $(BUILD_DEPS) - mkdir -p /ynh-build/ - cd /ynh-build/; git clone https://github.com/yunohost/moulinette; - cd /ynh-build/; git clone https://github.com/yunohost/ssowat; - cd /ynh-build/; git clone https://github.com/yunohost/metronome; - cd /ynh-build/; git clone https://github.com/yunohost/yunohost; + apt $(APT_OPTS) install $(BUILD_DEPS) + mkdir -p "$(YNH_BUILD_DIR)" + cd "$(YNH_BUILD_DIR)"; \ + git clone "$(YNH_SOURCE)"/moulinette; \ + git clone "$(YNH_SOURCE)"/ssowat; \ + git clone "$(YNH_SOURCE)"/metronome; \ + git clone "$(YNH_SOURCE)"/yunohost; + apt $(APT_OPTS) build-dep \ + "$(YNH_BUILD_DIR)"/moulinette \ + "$(YNH_BUILD_DIR)"/ssowat \ + "$(YNH_BUILD_DIR)"/metronome \ + "$(YNH_BUILD_DIR)"/yunohost metronome: - cd /ynh-build/; rm -f metronome_*; cd metronome; dpkg-buildpackage -rfakeroot -uc -b -d + cd "$(YNH_BUILD_DIR)"; \ + rm -f metronome_*; \ + cd metronome; \ + dpkg-buildpackage -rfakeroot -uc -b -d ssowat: - cd /ynh-build/; rm -f ssowat_*; cd ssowat; debuild -us -uc + cd "$(YNH_BUILD_DIR)"; \ + rm -f ssowat_*; \ + cd ssowat; \ + debuild -us -uc moulinette: - cd /ynh-build/; rm -f moulinette_*; cd moulinette; debuild -us -uc + cd "$(YNH_BUILD_DIR)"; \ + rm -f moulinette_*; \ + cd moulinette; \ + debuild -us -uc yunohost: - cd /ynh-build/; rm -f yunohost_*; cd yunohost; debuild -us -uc + cd "$(YNH_BUILD_DIR)"; \ + rm -f yunohost_*; \ + cd yunohost; \ + debuild -us -uc install: - cd /ynh-build/; debconf-set-selections < debconf; export SUDO_FORCE_REMOVE=yes; gdebi /ynh-build/metronome*.deb -n; gdebi /ynh-build/moulinette*.deb -n; gdebi /ynh-build/ssowat*.deb -n; gdebi /ynh-build/yunohost*.deb -n + cd "$(YNH_BUILD_DIR)"; \ + debconf-set-selections < debconf; \ + SUDO_FORCE_REMOVE=yes apt install $(APT_OPTS) /ynh-build/*.deb; + +mrproper: + @ rm "$(YNH_BUILD_DIR)" -rfv uninstall: apt remove slapd yunohost moulinette --purge -y diff --git a/install_yunohost b/install_yunohost index d304d60..00a806d 100755 --- a/install_yunohost +++ b/install_yunohost @@ -140,6 +140,8 @@ function build_packages_locally() cp ./Makefile ./debconf /ynh-build/ cd /ynh-build make init + make moulinette + make ssowat make metronome make yunohost }