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