source: trunk/dports/sysutils/clamav-server/Portfile

Last change on this file was 127197, checked in by pixilla@…, 3 years ago

sysutils/clamav-server:

  • Update version to 0.98.4.
  • Add conf files on activate if they do not exist. Closes #35113
  • White space edits to notes.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1# -*- 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
2# $Id: Portfile 127197 2014-10-22 19:58:32Z ryandesign@macports.org $
3
4PortSystem              1.0
5
6name                    clamav-server
7version                 0.98.4
8homepage                http://www.clamav.net/
9categories              sysutils
10platforms               darwin
11supported_archs         noarch
12maintainers             pixilla openmaintainer
13license                 BSD
14distfiles
15
16description \
17    launchdaemons for clamav antivirus software
18
19long_description \
20    Clam AntiVirus is a GPL anti-virus toolkit for UNIX. The \
21    main purpose of this software is the integration with mail \
22    servers (attachment scanning). This port installs launchdaemons \
23    that can be used to manage clamav.
24
25depends_run \
26    port:clamav
27
28if {${os.platform} eq "darwin" && ${os.major} > 8} {
29    set clamavuser      _clamav
30} else {
31    set clamavuser      clamav
32}
33add_users ${clamavuser} group=${clamavuser} realname=clamav
34
35use_configure           no
36
37build {}
38
39set dataPath ${prefix}/var/clamav
40set logPath ${prefix}/var/log/clamav
41set runPath ${prefix}/var/run/clamav
42
43destroot {
44    set LaunchDaemonsPath ${destroot}/Library/LaunchDaemons
45    xinstall -d ${LaunchDaemonsPath}
46    xinstall -m 0644 -W ${filespath} \
47        org.macports.clamd.plist \
48        org.macports.freshclam.plist \
49        ${LaunchDaemonsPath}
50    reinplace "s|__PREFIX__|${prefix}|g" \
51        ${LaunchDaemonsPath}/org.macports.clamd.plist \
52        ${LaunchDaemonsPath}/org.macports.freshclam.plist
53    xinstall -m 0755 -o ${clamavuser} -g ${clamavuser} -d \
54        ${destroot}${dataPath} \
55        ${destroot}${logPath} \
56        ${destroot}${runPath}
57    touch ${destroot}${logPath}/clamav.log
58    destroot.keepdirs \
59        ${destroot}${dataPath} \
60        ${destroot}${runPath}
61}
62
63post-activate {
64    if {![file exists ${prefix}/etc/clamd.conf]} {
65        copy ${prefix}/etc/clamd.conf.sample \
66            ${prefix}/etc/clamd.conf
67        reinplace "s,#Foreground,Foreground," \
68            ${prefix}/etc/clamd.conf
69    }
70    if {![file exists ${prefix}/etc/freshclam.conf]} {
71        copy ${prefix}/etc/freshclam.conf.sample \
72            ${prefix}/etc/freshclam.conf
73        reinplace "s,#Foreground,Foreground," \
74            ${prefix}/etc/freshclam.conf
75    }
76}
77
78notes "
79To configure clamd and freshclam look for the following files:
80    ${prefix}/etc/clamd.conf
81    ${prefix}/etc/freshclam.conf
82
83If these files do not exist you can copy the sample conf files into place:
84    sudo cp ${prefix}/etc/clamd.conf.sample ${prefix}/etc/clamd.conf
85    sudo cp ${prefix}/etc/freshclam.conf.sample ${prefix}/etc/freshclam.conf
86
87Edit ${prefix}/etc/clamd.conf to your liking, example:
88# Comment out 'Example' near the top if it exists
89    #Example
90    LogFile ${logPath}/clamd.log
91    PidFile ${runPath}/clamd.pid
92    LocalSocket ${runPath}/clamd.socket
93    Foreground yes
94
95Edit ${prefix}/etc/freshclam.conf to your liking, example:
96# Comment out 'Example' near the top if it exists
97    #Example
98    UpdateLogFile ${logPath}/freshclam.log
99    PidFile ${runPath}/freshclam.pid
100    NotifyClamd ${prefix}/etc/clamd.conf
101
102Two launchd startup items have been installed.
103
104To load clamd and freshclam do the following:
105    sudo launchctl load -w /Library/LaunchDaemons/org.macports.clamd.plist
106    sudo launchctl load -w /Library/LaunchDaemons/org.macports.freshclam.plist
107
108To unload clamd and freshclam do the following:
109    sudo launchctl unload -w /Library/LaunchDaemons/org.macports.clamd.plist
110    sudo launchctl unload -w /Library/LaunchDaemons/org.macports.freshclam.plist
111
112To try things out do
113    sudo freshclam
114
115If all is well you should see your clamav database being updated
116"
117
118livecheck.type    regex
119livecheck.url     http://www.clamav.net/lang/en/download/sources/
120livecheck.regex   "clamav-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.