Revision: 68364 http://trac.macports.org/changeset/68364 Author: jmr@macports.org Date: 2010-06-01 18:48:49 -0700 (Tue, 01 Jun 2010) Log Message: ----------- New port: clamav-server, launchdaemons for clamav (#23777) Added Paths: ----------- trunk/dports/sysutils/clamav-server/ trunk/dports/sysutils/clamav-server/Portfile trunk/dports/sysutils/clamav-server/files/ trunk/dports/sysutils/clamav-server/files/org.macports.clamd.plist trunk/dports/sysutils/clamav-server/files/org.macports.freshclam.plist Added: trunk/dports/sysutils/clamav-server/Portfile =================================================================== --- trunk/dports/sysutils/clamav-server/Portfile (rev 0) +++ trunk/dports/sysutils/clamav-server/Portfile 2010-06-02 01:48:49 UTC (rev 68364) @@ -0,0 +1,104 @@ +# $Id$ + +PortSystem 1.0 + +name clamav-server +version 0.95.3 +homepage http://www.clamav.net/ +categories sysutils +platforms darwin +if {[info exists supported_archs]} { + supported_archs noarch +} +maintainers pixilla.com:brad +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 {"darwin" == ${os.platform} && ${os.major} > 8} { + set clamavuser _clamav +} else { + set clamavuser clamav +} + +use_configure no + +build {} + +set dataPath ${prefix}/var/clamav +set logPath ${prefix}/var/log/clamav +set runPath ${prefix}/var/run/clamav + +destroot { + addgroup ${clamavuser} + set gid [existsgroup ${clamavuser}] + adduser ${clamavuser} gid=${gid} realname=clamav + 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} +} + +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 copy do the following to copy these files into place +cp ${prefix}/etc/example-clamd.conf ${prefix}/etc/clamd.conf +cp ${prefix}/etc/example-freshclam.conf ${prefix}/etc/freshclam.conf +** +* Alter/Add the following lines to your ${prefix}/etc/clamd.conf +* Comment out 'Example' near the top like so '#Example' +* LogFile ${logPath}/clamd.log +* PidFile ${runPath}/clamd.pid +* LocalSocket ${runPath}/clamd.socket +** +* Alter/Add the following lines to your ${prefix}/etc/freshclam.conf +* Comment out 'Example' near the top like so '#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 +launchctl load -w /Library/LaunchDaemons/org.macports.clamd.plist +launchctl load -w /Library/LaunchDaemons/org.macports.freshclam.plist +** +* To unload clamd and freshclam do the following +launchctl unload -w /Library/LaunchDaemons/org.macports.clamd.plist +launchctl unload -w /Library/LaunchDaemons/org.macports.freshclam.plist +** +* To try things out do +freshclam +* If all is well you should see your clamav database being updated +******************************************************" + +livecheck.type regex +livecheck.url http://sourceforge.net/projects/clamav/files +livecheck.regex clamav-(\\d+.\\d+.\\d+)${extract.suffix} Property changes on: trunk/dports/sysutils/clamav-server/Portfile ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: trunk/dports/sysutils/clamav-server/files/org.macports.clamd.plist =================================================================== --- trunk/dports/sysutils/clamav-server/files/org.macports.clamd.plist (rev 0) +++ trunk/dports/sysutils/clamav-server/files/org.macports.clamd.plist 2010-06-02 01:48:49 UTC (rev 68364) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>GroupName</key> + <string>_clamav</string> + <key>KeepAlive</key> + <true/> + <key>Label</key> + <string>org.macports.clamd</string> + <key>OnDemand</key> + <true/> + <key>ProgramArguments</key> + <array> + <string>__PREFIX__/sbin/clamd</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>UserName</key> + <string>root</string> +</dict> +</plist> + Added: trunk/dports/sysutils/clamav-server/files/org.macports.freshclam.plist =================================================================== --- trunk/dports/sysutils/clamav-server/files/org.macports.freshclam.plist (rev 0) +++ trunk/dports/sysutils/clamav-server/files/org.macports.freshclam.plist 2010-06-02 01:48:49 UTC (rev 68364) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>GroupName</key> + <string>_clamav</string> + <key>Label</key> + <string>org.macports.freshclam</string> + <key>ProgramArguments</key> + <array> + <string>__PREFIX__/bin/freshclam</string> + </array> + <key>StartInterval</key> + <integer>21600</integer> + <key>UserName</key> + <string>_clamav</string> +</dict> +</plist>