]> git.donarmstrong.com Git - roundcube.git/blob - debian/roundcube-core.config
Imported Debian patch 0.1~rc2-2
[roundcube.git] / debian / roundcube-core.config
1 #!/bin/sh
2
3 set -e
4
5 . /usr/share/debconf/confmodule
6
7 db_input medium roundcube/hosts || true
8 db_go || true
9
10 # Retrieve all available languages
11 instd_langs=$(echo /usr/share/roundcube/program/localization/*/messages.inc | \
12     sed 's+[^ ]*/\([^ ]*\)/messages.inc+\1,+g' | sed 's+,$++')
13 # Retrieve the old list
14 db_metaget roundcube/language languages && oldchoices="$RET"
15 if [ ! "$oldchoices" ] || [ "$instd_langs" != "$oldchoices" ]; then
16        db_subst roundcube/language languages $instd_langs
17        db_fset roundcube/language seen false
18        # Try to guess the locale
19        locale=$(echo $LANG | sed 's/[@\.].*//')
20        if [ -d /usr/share/roundcube/program/localization/$locale ]; then
21            db_set roundcube/language $locale
22        else
23            locale=$(echo $locale | sed 's/_.*//')
24            if [ -d /usr/share/roundcube/program/localization/$locale ]; then
25                db_set roundcube/language $locale
26            else
27                db_set roundcube/language en_US
28            fi
29        fi
30 fi
31 # Ask the question
32 db_input medium roundcube/language || true
33 db_go || true
34
35 if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
36         dbc_dbtypes="mysql, pgsql, sqlite"
37         dbc_authmethod_user="password"
38         . /usr/share/dbconfig-common/dpkg/config 
39         dbc_go roundcube $@
40 fi
41
42 db_input medium roundcube/reconfigure-webserver || true
43 db_go || true
44 db_input medium roundcube/restart-webserver || true
45 db_go || true