Ticket #21485: Portfile

File Portfile, 2.7 KB (added by mroman@…, 15 years ago)
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$
3
4PortSystem 1.0
5
6name            dansguardian
7version         2.10.1.1
8categories      net
9platforms       darwin
10maintainers     nomaintainer
11description     web content filter
12long_description        DansGuardian is content-control software: software \
13                        designed to control which websites users can access.\
14                        It also includes virus filtering and usage monitoring features.
15
16homepage        http://dansguardian.org/ 
17master_sites    http://dansguardian.org/downloads/2/Stable/ \
18                http://usmirror.dansguardian.org/downloads/2/Stable/ \
19                http://mirrors.evis.net.ph/dansguardian/downloads/2/Stable/
20
21distname        ${name}-${version}
22checksums       md5     0987a1c9bfbdf398118386f10279611a \
23                sha1    ff3012e01130b2269582c21c3eeb4ea013dc9679 \
24                rmd160  dc15ca9779a5084c5e4248545c730f25fff241a3
25
26depends_lib     port:zlib \
27                port:pcre                               
28                               
29configure.args  --enable-pcre \
30                --disable-ntlm \
31                --disable-clamav
32
33use_parallel_build  yes
34
35startupitem.create      yes
36startupitem.name        dansguardian
37startupitem.executable  ${prefix}/sbin/dansguardian -N
38
39variant clamav description {Enable support for libclamav av scanner} {
40        depends_lib-append      port:clamav
41       
42        # enable --enable-clamav in the next version if it works with >=clamav-0.95
43        #configure.args-delete  --disable-clamav
44        #configure.args-append  --enable-clamav
45       
46        configure.args-append   --enable-clamd \
47                                --with-proxyuser=clamav \
48                                --with-proxygroup=clamav
49}
50
51variant ntlm description {Enable support for the NTLM auth plugin} {
52        depends_lib-append      port:libntlm \
53                                port:libiconv
54        configure.args-delete   --disable-ntlm
55        configure.args-append   --enable-ntlm
56}
57
58post-destroot {
59        set runas_user nobody
60        set runas_group nobody
61
62        if { [variant_isset clamav]} {
63                if { [existsuser clamav] && [existsgroup clamav] } {
64                        set runas_user clamav
65                        set runas_group clamav
66                }
67
68                ui_msg "\n DansGuardian and clamd must run with either the same group or user ID. \n\
69                        Don't forget to set clamd socket in etc/dansguardian/contentscanners/clamdscan.conf.\n"
70        }
71               
72        # by default dansguardian runs as nobody and writes log to /var/log/dansguardian/access.log
73        # !!! when user rebuilds dansguardian with clamav variant var/log/dansguardian/access.log has old owner and access is denied
74        # the solution is to rm -rf ${prefix}/var/log/dansguardian and port activate dansguardian
75        xinstall -d -o ${runas_user} -g ${runas_group} -m 755 ${destroot}${prefix}/var/log/dansguardian
76        destroot.keepdirs-append ${destroot}${prefix}/var/log/dansguardian
77}
78
79livecheck.type  regex
80livecheck.url   "http://dansguardian.org/?page=news"
81livecheck.regex "DansGuardian (.*) is.*released!"
82