Ticket #23777: Portfile

File Portfile, 3.5 KB (added by pixilla (Bradley Giesbrecht), 14 years ago)
Line 
1# $Id$
2
3PortSystem              1.0
4
5name                    clamav-server
6version                 0.95.3
7homepage                http://www.clamav.net/
8categories              sysutils
9platforms               darwin
10maintainers             brad@pixilla
11license                 GPL
12distfiles
13
14description \
15    clamav antivirus software
16
17long_description \
18    Clam AntiVirus is a GPL anti-virus toolkit for UNIX. The \
19    main purpose of this software is the integration with mail \
20    servers (attachment scanning).
21
22depends_run \
23    port:clamav
24
25if {"darwin" == ${os.platform} && ${os.major} > 8} {
26    set clamavuser      _clamav
27} else {
28    set clamavuser      clamav
29}
30
31use_configure           no
32
33build {}
34
35destroot {
36    addgroup ${clamavuser}
37    set gid [existsgroup ${clamavuser}]
38    adduser ${clamavuser} gid=${gid} realname=clamav
39    set LaunchDaemonsPath ${destroot}/Library/LaunchDaemons
40    xinstall -d ${LaunchDaemonsPath}
41    xinstall -m 0644 -W ${filespath} \
42        org.macports.clamd.plist \
43        org.macports.freshclam.plist  \
44        ${LaunchDaemonsPath}
45    set dataPath ${prefix}/var/clamav
46    set logPath ${prefix}/var/log/clamav
47    set runPath ${prefix}/var/run/clamav
48    xinstall -m 0755 -o ${clamavuser} -g ${clamavuser} -d \
49        ${destroot}${dataPath} \
50        ${destroot}${logPath} \
51        ${destroot}${runPath}
52    touch ${destroot}${logPath}/clamav.log
53    destroot.keepdirs \
54        ${destroot}${dataPath} \
55        ${destroot}${runPath}
56
57    ui_msg "******************************************************"
58    ui_msg "* To configure clamd and freshclam look for the following files"
59    ui_msg "* ${prefix}/etc/clamd.conf"
60    ui_msg "* ${prefix}/etc/freshclam.conf"
61    ui_msg "**"
62    ui_msg "* If these files do not exist copy do the following to copy these files into place"
63    ui_msg "cp ${prefix}/etc/example-clamd.conf ${prefix}/etc/clamd.conf"
64    ui_msg "cp ${prefix}/etc/example-freshclam.conf ${prefix}/etc/freshclam.conf"
65    ui_msg "**"
66    ui_msg "* Alter/Add the following lines to your ${prefix}/etc/clamd.conf"
67    ui_msg "* Comment out 'Example' near the top like so '#Example'"
68    ui_msg "* LogFile ${logPath}/clamd.log"
69    ui_msg "* PidFile ${runPath}/clamd.pid"
70    ui_msg "* LocalSocket ${runPath}/clamd.socket"
71    ui_msg "**"
72    ui_msg "* Alter/Add the following lines to your ${prefix}/etc/freshclam.conf"
73    ui_msg "* Comment out 'Example' near the top like so '#Example'"
74    ui_msg "* UpdateLogFile ${logPath}/freshclam.log"
75    ui_msg "* PidFile ${runPath}/freshclam.pid"
76    ui_msg "* NotifyClamd ${prefix}/etc/clamd.conf"
77    ui_msg "**"
78    ui_msg "* Two launchd startup items have been installed"
79    ui_msg "**"
80    ui_msg "* To load clamd and freshclam do the following"
81    ui_msg "launchctl load -w /Library/LaunchDaemons/org.macports.clamd.plist"
82    ui_msg "launchctl load -w /Library/LaunchDaemons/org.macports.freshclam.plist"
83    ui_msg "**"
84    ui_msg "* To unload clamd and freshclam do the following"
85    ui_msg "launchctl unload -w /Library/LaunchDaemons/org.macports.clamd.plist"
86    ui_msg "launchctl unload -w /Library/LaunchDaemons/org.macports.freshclam.plist"
87    ui_msg "**"
88    ui_msg "* To try things out do"
89    ui_msg "freshclam"
90    ui_msg "* If all is well you should see your clamav database being updated"
91    ui_msg "******************************************************"
92}
93
94livecheck.type          regex
95livecheck.url           http://sourceforge.net/projects/clamav/files
96livecheck.regex         clamav-(\\d+.\\d+.\\d+)${extract.suffix}
97