diff options
Diffstat (limited to 'packaging/dpkg/default_files/postinst')
-rwxr-xr-x | packaging/dpkg/default_files/postinst | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/packaging/dpkg/default_files/postinst b/packaging/dpkg/default_files/postinst index daa52770..d90f2524 100755 --- a/packaging/dpkg/default_files/postinst +++ b/packaging/dpkg/default_files/postinst @@ -2,8 +2,41 @@ set -e # if [ "$1" = "configure" ]; then - if [ -d /usr/doc -a ! -e /usr/doc/dxs -a -d /usr/share/doc/dxs ]; then - ln -sf ../share/doc/dxs /usr/doc/dxs - fi + # 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; |