This file is indexed.

config is in sympa 6.2.24~dfsg-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/sh

set -e

# Source debconf library
. /usr/share/debconf/confmodule

db_version 2.0

sympa_conf_get() {
    key="${1}"
    if [ -e "${conf}" ]; then
        sed -r -n "s/^\s*${key}\s+(.*)\$/\1/p" "${conf}"
    fi
}

if [ -f "/etc/sympa/sympa/sympa.conf" ] || [ ! -f "/etc/sympa/sympa.conf" ]; then
    conf=/etc/sympa/sympa/sympa.conf
else
    conf=/etc/sympa/sympa.conf
fi

# Default values
default_lang="en"
domain="$(head -n 1 /etc/mailname || hostname -fqdn || echo localhost)"
listmaster="listmaster@${domain}"
wwsympa_url="http://${domain}/wws"
use_fast_cgi="true"


# Get current config settings
if [ -e "${conf}" ]; then
    db_set sympa/language "$(sympa_conf_get 'lang')"
    db_set sympa/hostname "$(sympa_conf_get 'domain')"
    db_set sympa/listmaster "$(sympa_conf_get 'listmaster')"
    db_set wwsympa/wwsympa_url "$(sympa_conf_get 'wwsympa_url')"
    case "$(sympa_conf_get 'use_fast_cgi')" in
        0)
            db_set wwsympa/fastcgi "false"
            ;;
        1)
            db_set wwsympa/fastcgi "true"
            ;;
        *)
            ;;
    esac
else
    db_set sympa/language "${default_lang}"
    db_set sympa/hostname "${domain}"
    db_set sympa/listmaster "${listmaster}"
    db_set wwsympa/wwsympa_url "${wwsympa_url}"
    db_set wwsympa/fastcgi "${use_fast_cgi}"
fi

# Ask for language
locales="$(locale -a)"
possible_langs="ar bg br ca cs de el en en_US es et eu fi fr gl hu id it ja ko la ml nb_NO nl oc pl pt_BR pt ro ru sv tr vi zh_CN zh_TW"
supported_langs="${default_lang}"
for lang in ${possible_langs} ; do
    if echo "${locales}" | grep -q "^${lang}" ; then
        supported_langs="${supported_langs}, ${lang}"
    fi
done
if [ "${supported_langs}" != "en" ]; then
    db_subst sympa/language supported_langs ${supported_langs}
    db_input medium sympa/language || [ $? -eq 30 ]
    db_go
else
    db_set sympa/language "${default_lang}"
fi

# Ask for hostname / domain
db_get sympa/hostname
if [ -z "${RET}" ]; then
    db_set sympa/hostname "${domain}"
fi
db_input medium sympa/hostname || [ $? -eq 30 ]
db_go

# Ask for listmaster
db_get sympa/listmaster
if [ -z "${RET}" ]; then
    db_get sympa/hostname
    db_set sympa/listmaster "listmaster@${RET}"
fi
db_input medium sympa/listmaster || [ $? -eq 30 ]
db_go

# Ask for database settings
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
    dbc_dbtypes="mysql, pgsql, sqlite3"
    dbc_authmethod_user="password"
    . /usr/share/dbconfig-common/dpkg/config
    dbc_first_version="5.3.4-6~"
    dbctmpfile=$(tempfile -p sympa)
    if [ -e "${conf}" ] && [ -e "${dbctmpfile}" ]; then
        # Extract sympa.conf options parsable by dbconfig-common
        sed -r -n 's/^\s*(db_[a-z]+)\s+(.*)$/\1="\2"/p' "${conf}" > "${dbctmpfile}"
        dbc_load_include="sh:${dbctmpfile}"
        dbc_load_include_args="-d db_name -p db_passwd -s db_host -P db_port -u db_user -t db_type"
    fi
    dbc_go sympa $@
    rm -f -- "${dbctmpfile}"
fi

# Ask for WWSympa url
db_get wwsympa/wwsympa_url
if [ -z "${RET}" ]; then
    db_get sympa/hostname
    db_set wwsympa/wwsympa_url "http://${RET}/wws"
fi
db_input medium wwsympa/wwsympa_url || [ $? -eq 30 ]
db_go

# Fastcgi usage
db_get wwsympa/fastcgi
if [ -z "${RET}" ] ; then
    db_set wwsympa/fastcgi "${use_fast_cgi}"
fi

# Ask for the installed web server
db_input high wwsympa/webserver_type || [ $? -eq 30 ]
db_go
db_get wwsympa/webserver_type
webserver="${RET}"
if [ "${webserver}" != "none" ]; then
    # Ask for fastcgi usage
    db_input low wwsympa/fastcgi || [ $? -eq 30 ]
    db_go
    # Ask for soap usage
    db_input medium sympa/use_soap || [ $? -eq 30 ]
    db_go
fi

# Ask for spool directories removal
db_input medium wwsympa/remove_spool || [ $? -eq 30 ]
db_go