summaryrefslogtreecommitdiffstats
path: root/packaging/dpkg/default_files/postinst
blob: d90f2524e09fe02c8ba7ef0c4a1244c18be05252 (plain) (blame)
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
#!/bin/sh
set -e
#
if [ "$1" = "configure" ]; then
        # specific database modules are optional, but we tell the user if
        # support for a database is missing:
        DEFAULT_DB_TYPE=""; 
        if test -e ${SLX_CONFIG_PATH}/settings; then 
                echo "Reading local settings..."; 
                . ${SLX_CONFIG_PATH}/settings; 
        fi; 
        for m in ${SLX_DB_TYPE} SQLite mysql; do 
                perl -I/opt/openslx/lib -Ilib -Iconfig-db -e "use OpenSLX::MetaDB::$m";  
                if [ $? -gt 0 ] ; then 
                        echo -e "  'DBD::$m' not found (or too old), so $m-databases will not be \ 
supported."; 
                else 
                        if test "${DEFAULT_DB_TYPE}X" = "X"; then 
                                DEFAULT_DB_TYPE=$m; 
                                echo "  db-type => $m"; 
                        fi; 
                fi; 
        done; 
        if test "${DEFAULT_DB_TYPE}X" = "X"; then 
                echo "  None of the DB-modules is available! Please install one of them."; 
                echo "  For SQLite usage:";
                echo "   # aptitude install libdbd-sqlite3-perl";
                echo "  For MySQL usage:";
                echo "   # aptitude install libdbd-mysql-perl";
                echo "  or use CPAN to install the requred perl bindings"
        else 
                echo ${DEFAULT_DB_TYPE} >/opt/openslx/DEFAULT-DB-TYPE; 
        fi; 
        if ! which rsync >/dev/null 2>&1; then 
                echo "  rsync is required, please install it."; 
                echo "   # aptitude install rsync";
        fi;


  #
fi
exit 0;