# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id$ PortSystem 1.0 name clamav-server version 0.98.4 homepage http://www.clamav.net/ categories sysutils platforms darwin supported_archs noarch maintainers pixilla openmaintainer license BSD distfiles description \ launchdaemons for clamav antivirus software long_description \ Clam AntiVirus is a GPL anti-virus toolkit for UNIX. The \ main purpose of this software is the integration with mail \ servers (attachment scanning). This port installs launchdaemons \ that can be used to manage clamav. depends_run \ port:clamav if {${os.platform} eq "darwin" && ${os.major} > 8} { set clamavuser _clamav } else { set clamavuser clamav } add_users ${clamavuser} group=${clamavuser} realname=clamav use_configure no build {} set dataPath ${prefix}/var/clamav set logPath ${prefix}/var/log/clamav set runPath ${prefix}/var/run/clamav destroot { set LaunchDaemonsPath ${destroot}/Library/LaunchDaemons xinstall -d ${LaunchDaemonsPath} xinstall -m 0644 -W ${filespath} \ org.macports.clamd.plist \ org.macports.freshclam.plist \ ${LaunchDaemonsPath} reinplace "s|__PREFIX__|${prefix}|g" \ ${LaunchDaemonsPath}/org.macports.clamd.plist \ ${LaunchDaemonsPath}/org.macports.freshclam.plist xinstall -m 0755 -o ${clamavuser} -g ${clamavuser} -d \ ${destroot}${dataPath} \ ${destroot}${logPath} \ ${destroot}${runPath} touch ${destroot}${logPath}/clamav.log destroot.keepdirs \ ${destroot}${dataPath} \ ${destroot}${runPath} } post-activate { if {![file exists ${prefix}/etc/clamd.conf]} { copy ${prefix}/etc/clamd.conf.sample \ ${prefix}/etc/clamd.conf reinplace "s,#Foreground,Foreground," \ ${prefix}/etc/clamd.conf } if {![file exists ${prefix}/etc/freshclam.conf]} { copy ${prefix}/etc/freshclam.conf.sample \ ${prefix}/etc/freshclam.conf reinplace "s,#Foreground,Foreground," \ ${prefix}/etc/freshclam.conf } } notes " To configure clamd and freshclam look for the following files: ${prefix}/etc/clamd.conf ${prefix}/etc/freshclam.conf If these files do not exist you can copy the sample conf files into place: sudo cp ${prefix}/etc/clamd.conf.sample ${prefix}/etc/clamd.conf sudo cp ${prefix}/etc/freshclam.conf.sample ${prefix}/etc/freshclam.conf Edit ${prefix}/etc/clamd.conf to your liking, example: # Comment out 'Example' near the top if it exists #Example LogFile ${logPath}/clamd.log PidFile ${runPath}/clamd.pid LocalSocket ${runPath}/clamd.socket Foreground yes Edit ${prefix}/etc/freshclam.conf to your liking, example: # Comment out 'Example' near the top if it exists #Example UpdateLogFile ${logPath}/freshclam.log PidFile ${runPath}/freshclam.pid NotifyClamd ${prefix}/etc/clamd.conf Two launchd startup items have been installed. To load clamd and freshclam do the following: sudo launchctl load -w /Library/LaunchDaemons/org.macports.clamd.plist sudo launchctl load -w /Library/LaunchDaemons/org.macports.freshclam.plist To unload clamd and freshclam do the following: sudo launchctl unload -w /Library/LaunchDaemons/org.macports.clamd.plist sudo launchctl unload -w /Library/LaunchDaemons/org.macports.freshclam.plist To try things out do sudo freshclam If all is well you should see your clamav database being updated " livecheck.type regex livecheck.url http://www.clamav.net/lang/en/download/sources/ livecheck.regex "clamav-(\\d+(?:\\.\\d+)*)${extract.suffix}"