From 4955359b2cbec1a0f555d9359aaaf6747cc781fc Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Wed, 14 Jun 2017 22:16:25 +0200 Subject: [PATCH] use old install method --- install | 1 + manifest.json | 2 +- scripts/_common.sh | 31 +++++++++++++++++++++++++++---- scripts/install | 3 ++- 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 install diff --git a/install b/install new file mode 100644 index 0000000..d80b2d8 --- /dev/null +++ b/install @@ -0,0 +1 @@ +yunohost app install /vagrant/monica_ynh/ --debug -n -a "domain=ynh2.dev&path=/&admin=basti&is_public=0&language=en" diff --git a/manifest.json b/manifest.json index 60ccf15..b7c6bd5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name": "YunoHost monica app", + "name": "Monica", "id": "monica", "packaging_format": 1, "description": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 3fa00b8..9abf3ec 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,6 +15,19 @@ PKGDIR=$(cd ../; pwd) # Common helpers # +# Download and extract monica sources to the given directory +# usage: extract_monica_to DESTDIR +extract_monica() { + local DESTDIR=$1 + + # retrieve and extract monica tarball + rc_tarball="${DESTDIR}/monica.tar.gz" + wget -q -O "$rc_tarball" "$MONICA_SOURCE_URL" \ + || ynh_die "Unable to download monica tarball" + tar xf "$rc_tarball" -C "$DESTDIR" --strip-components 1 \ + || ynh_die "Unable to extract monica tarball" + sudo rm "$rc_tarball" +} # Remove a file or a directory securely # @@ -182,8 +195,18 @@ ynh_remove_nodejs () { # ynh_install_php7 () { - echo "deb https://packages.dotdeb.org jessie all" | sudo tee --append "/etc/apt/sources.list.d/dotdeb.list" - curl http://www.dotdeb.org/dotdeb.gpg | sudo apt-key add - + architecture=$(uname -m) + if [ $architecture == "armv7l" ]; then + # arm package + echo "deb http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free" | sudo tee --append "/etc/apt/sources.list.d/php7.list" + sudo gpg --keyserver pgpkeys.mit.edu --recv-key CCD91D6111A06851 + sudo gpg --armor --export CCD91D6111A06851 | sudo apt-key add - + else + # x86 package + echo "deb https://packages.dotdeb.org jessie all" | sudo tee --append "/etc/apt/sources.list.d/php7.list" + curl http://www.dotdeb.org/dotdeb.gpg | sudo apt-key add - + fi + ynh_package_update ynh_package_install apt-transport-https --no-install-recommends ynh_package_install php7.0 php7.0-fpm php7.0-mysql php7.0-xml php7.0-intl php7.0-mbstring --no-install-recommends @@ -191,9 +214,9 @@ ynh_install_php7 () { } ynh_remove_php7 () { - sudo rm -f /etc/apt/sources.list.d/dotdeb.list + sudo rm -f /etc/apt/sources.list.d/php7.list sudo apt-key del 4096R/89DF5277 - ynh_package_update + sudo apt-key del 2048R/11A06851 ynh_package_remove php7.0 php7.0-fpm php7.0-mysql php7.0-xml php7.0-intl php7.0-mbstring } diff --git a/scripts/install b/scripts/install index c550245..35a496d 100755 --- a/scripts/install +++ b/scripts/install @@ -58,7 +58,8 @@ ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass" ynh_install_nodejs 6.10.3 # extract monica into $final_path -ynh_setup_source $final_path +extract_monica $final_path +#ynh_setup_source $final_path # install composer init_composer $final_path