From 5e36478d54db9e8179e976e94cfd7a8b06569aba Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Fri, 21 Jul 2006 03:09:14 +0000 Subject: - added some extra checks to be able to detect whether a particular software is available. --- packages/dspam/pkg/dspam-pkgfunc.inc | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'packages/dspam/pkg') diff --git a/packages/dspam/pkg/dspam-pkgfunc.inc b/packages/dspam/pkg/dspam-pkgfunc.inc index 9f02669e..0ea5ba85 100644 --- a/packages/dspam/pkg/dspam-pkgfunc.inc +++ b/packages/dspam/pkg/dspam-pkgfunc.inc @@ -490,4 +490,57 @@ function custom_php_deinstall_command() { conf_mount_ro(); } +function checkForLDAPSupport() { + $pd = popen("ldd /usr/local/bin/dspam", "r"); + while (!feof($pd)) { + $dspamstr .= fgets($pd, 4096); + } + pclose($pd); + + if (strpos($dspamstr, "libldap") !== false && + file_exists("/usr/local/lib/libldap.so") && + file_exists("/usr/local/lib/liblber.so")) { + return true; + } + + return false; +} + +function checkForPgSQLSupport() { + if (file_exists("/usr/local/lib/libpgsql_drv.so") && + file_exists("/usr/local/lib/libpq.so")) { + return true; + } + + return false; +} + +function checkForMySQLSupport() { + if (file_exists("/usr/local/lib/libmysql_drv.so") && + file_exists("/usr/local/lib/mysql/libmysqlclient.so")) { + return true; + } + + return false; +} + +function checkForSQLiteSupport() { + if (file_exists("/usr/local/lib/libsqlite3_drv.so") && + file_exists("/usr/local/lib/mysql/libsqlite3.so")) { + return true; + } + + return false; +} + +function checkForClamAVSupport() { + if (file_exists("/usr/local/bin/clamdscan") && + file_exists("/usr/local/bin/clamscan") && + file_exists("/usr/local/sbin/clamd")) { + return true; + } + + return false; +} + ?> -- cgit v1.2.3