[enh] Stable is 2.4 now, Jessie only.

This commit is contained in:
opi 2016-05-09 13:49:12 +02:00
parent a32f28d007
commit aa493b5697

View file

@ -110,13 +110,16 @@ installscript_dependencies() {
} }
create_custom_config() { create_custom_config() {
if [[ "$DISTRIB" != "daily" ]] && [[ "$DISTRIB" != "unstable" ]] \ # Create YunoHost configuration folder
&& [[ "$DISTRIB" != "test" ]] && [[ "$DISTRIB" != "testing" ]] ; then mkdir -p /etc/yunohost/
if [[ ! -f /etc/yunohost/yunohost.conf ]]
then # Store info about installation method
mkdir -p /etc/yunohost/ touch /etc/yunohost/from_script
touch /etc/yunohost/from_script
cat << EOF > /etc/yunohost/yunohost.conf # Create default configuration if not already there
if [[ ! -f /etc/yunohost/yunohost.conf ]]
then
cat << EOF > /etc/yunohost/yunohost.conf
# Yunohost custom config # Yunohost custom config
# If you want to keep a custom service configuration replace "no" by "yes" # If you want to keep a custom service configuration replace "no" by "yes"
# for the concerned service # for the concerned service
@ -133,25 +136,9 @@ slapd=no
ssh=yes ssh=yes
ssowat=no ssowat=no
EOF EOF
fi
else
mkdir -p /etc/yunohost/
touch /etc/yunohost/from_script
fi fi
} }
set_domain() {
# No amavis in testing/unstable anymore
[[ "$DISTRIB" != "stable" ]] && return 0
dpkg -l | grep amavisd-new | grep -e "^ii" > /dev/null 2>&1 \
|| [[ "$(hostname -d 2>/dev/null)" != "" ]] \
|| hostname yunohost.yunohost.org > /dev/null 2>&1 \
|| (echo "Unable to set an fully-qualified domain name to this \
container, amavisd installation will fail. Please set a fqdn \
manually before launching the installation." && exit 1)
}
confirm_installation() { confirm_installation() {
[[ "$AUTOMODE" == "1" ]] && return 0 [[ "$AUTOMODE" == "1" ]] && return 0
@ -174,26 +161,22 @@ Are you sure you want to proceed with the installation of Yunohost?
setup_package_source() { setup_package_source() {
local CUSTOMAPT=/etc/apt/sources.list.d/yunohost.list local CUSTOMAPT=/etc/apt/sources.list.d/yunohost.list
if [[ "$DISTRIB" == "megusta" ]] || [[ "$DISTRIB" == "stable" ]] ; then # Check current system version and dependencies
echo "deb http://repo.yunohost.org/ megusta main" > $CUSTOMAPT if [[ $(lsb_release -c | awk '{print $2}') != jessie ]]; then
else echo "Current $DISTRIB only works on Debian Jessie for the moment."
# Check current system version and dependencies return 1
if [[ $(lsb_release -c | awk '{print $2}') != jessie ]]; then elif [ ! -d /run/systemd/system ]; then
echo "Current $DISTRIB only works on Debian Jessie for the moment." echo "Current $DISTRIB only works with systemd for the moment."
return 1 return 1
elif [ ! -d /run/systemd/system ]; then fi
echo "Current $DISTRIB only works with systemd for the moment."
return 1
fi
# Make use of new repository # Debian repository
local CUSTOMDEB="deb http://repo.yunohost.org/debian/ jessie stable" local CUSTOMDEB="deb http://repo.yunohost.org/debian/ jessie stable"
if [[ "$DISTRIB" == "test" ]] || [[ "$DISTRIB" == "testing" ]] ; then if [[ "$DISTRIB" == "test" ]] || [[ "$DISTRIB" == "testing" ]] ; then
echo "$CUSTOMDEB testing" >> $CUSTOMAPT echo "$CUSTOMDEB testing" >> $CUSTOMAPT
elif [[ "$DISTRIB" == "daily" ]] || [[ "$DISTRIB" == "unstable" ]] ; then elif [[ "$DISTRIB" == "daily" ]] || [[ "$DISTRIB" == "unstable" ]] ; then
echo "$CUSTOMDEB testing unstable" > $CUSTOMAPT echo "$CUSTOMDEB testing unstable" > $CUSTOMAPT
fi
fi fi
# Add YunoHost repository key to the keyring # Add YunoHost repository key to the keyring
@ -205,9 +188,7 @@ apt_update() {
} }
register_debconf() { register_debconf() {
if [[ $(lsb_release -c | awk '{print $2}') == jessie ]]; debconf-set-selections << EOF
then
debconf-set-selections << EOF
slapd slapd/password1 password yunohost slapd slapd/password1 password yunohost
slapd slapd/password2 password yunohost slapd slapd/password2 password yunohost
slapd slapd/domain string yunohost.org slapd slapd/domain string yunohost.org
@ -229,25 +210,6 @@ nslcd nslcd/ldap-binddn string
nslcd nslcd/ldap-base string dc=yunohost,dc=org nslcd nslcd/ldap-base string dc=yunohost,dc=org
libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow
EOF EOF
else
debconf-set-selections << EOF
slapd slapd/password1 password yunohost
slapd slapd/password2 password yunohost
slapd slapd/domain string yunohost.org
slapd shared/organization string yunohost.org
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
nslcd nslcd/ldap-bindpw password
nslcd 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
EOF
fi
} }
workaround_avahi_installation() { workaround_avahi_installation() {
@ -291,21 +253,10 @@ workaround_avahi_installation() {
} }
install_yunohost_packages() { install_yunohost_packages() {
if [[ "$DISTRIB" != "daily" ]] && [[ "$DISTRIB" != "unstable" ]] \ apt_get_wrapper \
&& [[ "$DISTRIB" != "test" ]] && [[ "$DISTRIB" != "testing" ]] ; then -o Dpkg::Options::="--force-confold" \
apt_get_wrapper \ -y --force-yes install \
-o Dpkg::Options::="--force-confold" \ yunohost postfix
-y --force-yes install \
yunohost yunohost-config \
yunohost-config-postfix \
postfix postfix-ldap \
postfix-policyd-spf-perl
else
apt_get_wrapper \
-o Dpkg::Options::="--force-confold" \
-y --force-yes install \
yunohost postfix
fi
} }
restart_services() { restart_services() {
@ -426,9 +377,9 @@ if ! step create_custom_config ; then
die "Creating custom configuration file /etc/yunohost/yunohost.conf failed" 4 die "Creating custom configuration file /etc/yunohost/yunohost.conf failed" 4
fi fi
if ! step set_domain ; then # if ! step set_domain ; then
die "Setting hostname failed" 5 # die "Setting hostname failed" 5
fi # fi
if ! step confirm_installation ; then if ! step confirm_installation ; then
die "Installation cancelled at your request" 6 die "Installation cancelled at your request" 6