[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,12 +110,15 @@ 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/
# Store info about installation method
touch /etc/yunohost/from_script
# Create default configuration if not already there
if [[ ! -f /etc/yunohost/yunohost.conf ]] if [[ ! -f /etc/yunohost/yunohost.conf ]]
then then
mkdir -p /etc/yunohost/
touch /etc/yunohost/from_script
cat << EOF > /etc/yunohost/yunohost.conf 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"
@ -134,22 +137,6 @@ ssh=yes
ssowat=no ssowat=no
EOF EOF
fi 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() { confirm_installation() {
@ -174,9 +161,6 @@ 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
echo "deb http://repo.yunohost.org/ megusta main" > $CUSTOMAPT
else
# Check current system version and dependencies # Check current system version and dependencies
if [[ $(lsb_release -c | awk '{print $2}') != jessie ]]; then if [[ $(lsb_release -c | awk '{print $2}') != jessie ]]; then
echo "Current $DISTRIB only works on Debian Jessie for the moment." echo "Current $DISTRIB only works on Debian Jessie for the moment."
@ -186,7 +170,7 @@ setup_package_source() {
return 1 return 1
fi 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
@ -194,7 +178,6 @@ setup_package_source() {
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
wget -O- http://repo.yunohost.org/yunohost.asc -q | apt-key add - -qq > /dev/null wget -O- http://repo.yunohost.org/yunohost.asc -q | apt-key add - -qq > /dev/null
@ -205,8 +188,6 @@ apt_update() {
} }
register_debconf() { 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/password1 password yunohost
slapd slapd/password2 password yunohost slapd slapd/password2 password yunohost
@ -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" ]] \
&& [[ "$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 \ apt_get_wrapper \
-o Dpkg::Options::="--force-confold" \ -o Dpkg::Options::="--force-confold" \
-y --force-yes install \ -y --force-yes install \
yunohost postfix 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