Hi,
I have made a clamav package, it's not complete as yet and I have not added any web gui for starting or stopping or for other options in config files. As of now you can just test it from command line by running clamscan. The actual use for clamscan is for havp. As of now havp has experimental FreeBSD support and I am working on packaging it for FreeBSD. In the mean time pl test the clamav package. This is my first stab at packaging some thing for pfSense, so there will be lot's of things that can be improved.
raj
I am posting the clamav section from pkg_config.xml and the package configuration files.
<package><name>clamav</name>
<website>http://www.clamav.net/</website>
<descr>Opensource anti virus</descr>
<category>Services</category>
<config_file>http://agni.linuxense.com/packages/config/clamav.xml</config_file>
<depends_on_package_base_url>http://ftp13.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/All</depends_on_package_base_url>
<depends_on_package>clamav-0.87.tbz</depends_on_package>
<version>0.1</version>
<status>BETA</status>
<maintainer>raj@linuxense.com</maintainer>
<configurationfile>clamav.xml</configurationfile>
<logging><facilityname>clamav</facilityname>
<logfilename>clamav.log</logfilename></logging></package>
config.xml
<packagegui><name>clamav</name>
<version>0.1</version>
<title>ClamAV: Settings</title>
<include_file>/usr/local/pkg/clamav.inc</include_file>
<service><name>clamav</name>
<rcfile>/usr/local/etc/rc.d/clamav.sh</rcfile></service>
<additional_files_needed><prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
http://agni.linuxense.com/packages/config/clamav.inc</additional_files_needed>
<custom_php_install_command>clamav_install_command();</custom_php_install_command>
<custom_php_deinstall_command>clamav_deinstall_command();</custom_php_deinstall_command>
<custom_delete_php_command>sync_package_clamav();</custom_delete_php_command>
<custom_php_resync_config_command>sync_package_clamav();</custom_php_resync_config_command>
<custom_add_php_command>sync_package_clamav();</custom_add_php_command></packagegui>
clamav.inc
function sync_package_clamav() {
conf_mount_rw();
config_lock();
global $config;
$start = "/usr/local/sbin/clamd &\n";
$stop = "/usr/bin/killall clamd\n" .
"sleep 2";
write_rcfile(array(
"file" => "clamav.sh",
"start" => $start,
"stop" => $stop
)
);
conf_mount_ro();
config_unlock();
mwexec("killall -HUP cron");
mwexec("/usr/local/etc/rc.d/clamav.sh stop");
mwexec("/usr/local/etc/rc.d/clamav.sh start");
}
function clamav_install_command() {
global $config, $g;
mwexec ("mkdir -p /var/db/clamav");
mwexec ("/usr/local/bin/freshclam");
sync_package_clamav();
}
function clamav_deinstall_command() {
global $config, $g;
conf_mount_rw();
unlink_if_exists("/usr/local/etc/rc.d/clamav.sh");
unlink_if_exists("/var/db/clamav/daily.cvd");
unlink_if_exists("/var/db/clamav/main.cvd");
unlink_if_exists("/var/db/clamav");
conf_mount_ro();
}
?>