From 55eddd7accf2c5f9b0f52b22a010c4c4b7c130d1 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Fri, 6 Feb 2009 19:18:00 -0600 Subject: mv packages to config dir to match web layout --- packages/dspam/pkg/dspam-pkgfunc.inc | 548 ----------------------------------- 1 file changed, 548 deletions(-) delete mode 100644 packages/dspam/pkg/dspam-pkgfunc.inc (limited to 'packages/dspam/pkg/dspam-pkgfunc.inc') diff --git a/packages/dspam/pkg/dspam-pkgfunc.inc b/packages/dspam/pkg/dspam-pkgfunc.inc deleted file mode 100644 index 31a7fa06..00000000 --- a/packages/dspam/pkg/dspam-pkgfunc.inc +++ /dev/null @@ -1,548 +0,0 @@ - "dspam.sh", - "start" => $start, - "stop" => $stop - ) - ); - conf_mount_ro(); - config_unlock(); - - if (! file_exists("/usr/local/etc/dspam.conf")) { - mwexec("ln -s /etc/dspam.conf /usr/local/etc/dspam.conf"); - } - - mwexec("/usr/local/etc/rc.d/dspam.sh stop"); - mwexec("/usr/local/etc/rc.d/dspam.sh start"); - - return 0; -} - -function dspam_configure() { - global $config, $g; - - $dspamcfg = $config['installedpackages']['dspam']['config'][0]; - - if ($g['booting']) - echo "Starting DSPAM service... "; - else - sleep(1); - - /* write dhcpd.conf */ - $fd = fopen("/usr/local/etc/dspam.conf", "w"); - if (!$fd) { - printf("Error: cannot open dhcpd.conf in services_dhcpd_configure().\n"); - return 1; - } - - $dspamconf = << 0) { - $dspamconf .= "Algorithm\t\t"; - - foreach ($t_algos as $algo) { - $dspamconf .= "{$algo['name']} "; - } - - $dspamconf .= "\n"; - } - - $dspamconf .= "PValue\t\t\t{$dspamcfg['pvalue']}\n"; - isset($dspamcfg['improbability-drive']) ? $dspamconf .= "ImprobabilityDrive\ton\n" : $dspamconf .= "ImprobabilityDrive\toff\n"; - - $t_prefs = &$dspamcfg['preference']; - - foreach ($t_prefs as $pref) { - $dspamconf .= "Preference\t\t{$pref['value']}\n"; - } - - $t_overr = &$dspamcfg['override']; - - foreach ($t_overr as $over) { - $dspamconf .= "AllowOverride\t\t{$over['value']}\n"; - } - - if (isset($dspamcfg['ldap-enable'])) { - $dspamconf .= << "") { - $dspamconf .= << "") { - $dspamconf .= "ClientPort\t\t{$dspamcfg['dspam-client-port']}\n"; - } - } - - $dspamconf .= "## EOF\n"; - - fwrite($fd, $dspamconf); - fclose($fd); - - /* fire up dspam --daemon */ - mwexec("/usr/local/etc/rc.d/dspam.sh stop"); - mwexec("/usr/local/etc/rc.d/dspam.sh start"); - - if ($g['booting']) { - print "done.\n"; - } - - return 0; -} - -function custom_php_install_command() { - global $config, $g; - /* create a default config */ - sync_package_dspam(); -} - -function custom_php_deinstall_command() { - global $config, $g; - conf_mount_rw(); - unlink_if_exists("/usr/local/etc/rc.d/dspam.sh"); - unlink_if_exists("/usr/local/etc/dspam.conf"); - unlink_if_exists("/usr/local/bin/dspam_spamfeed"); - unlink_if_exists("/usr/local/bin/dspam_innocentfeed"); - 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