Ticket #38856: Portfile-dansguardian.4.diff

File Portfile-dansguardian.4.diff, 3.7 KB (added by mroman@…, 12 years ago)
  • (a) Portfile.orig vs. (b) /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/dansguardian/Portfile

    a b  
    44PortSystem 1.0
    55
    66name            dansguardian
    7 version         2.10.1.1
    8 revision        1
     7version         2.12.0.3
    98categories      net
    109platforms       darwin
     10license         GPL-2
    1111maintainers     nomaintainer
    1212description     web content filter
    1313long_description        DansGuardian is content-control software: software \
     
    1515                        It also includes virus filtering and usage monitoring features.
    1616
    1717homepage        http://dansguardian.org/
    18 master_sites    http://dansguardian.org/downloads/2/Stable/ \
    19                 http://usmirror.dansguardian.org/downloads/2/Stable/ \
    20                 http://mirrors.evis.net.ph/dansguardian/downloads/2/Stable/
    21 
    22 checksums       md5     0987a1c9bfbdf398118386f10279611a \
    23                 sha1    ff3012e01130b2269582c21c3eeb4ea013dc9679 \
    24                 rmd160  dc15ca9779a5084c5e4248545c730f25fff241a3
     18master_sites    sourceforge:dansguardian
     19
     20checksums           md5     2a88d0392cd28eaec02b7ee727b2e253 \
     21                    sha1    c5d8175910310f9a03efc2e6cb440ea418adb896 \
     22                    rmd160  312db0ce2db9d1b2ed537807f9b2eca5d76a4123
     23
     24use_bzip2       yes
    2525
    2626depends_build   port:pkgconfig
    2727depends_lib     port:zlib \
    28                 port:pcre                               
     28                port:pcre \
     29                port:libiconv
    2930                               
    3031configure.args  --enable-pcre \
    31                 --disable-ntlm \
    32                 --disable-clamav
    33 
    34 use_parallel_build  yes
     32                --enable-avastd \
     33                --enable-kavd \
     34                --enable-clamd \
     35                --enable-ntlm
    3536
    3637startupitem.create      yes
    3738startupitem.name        dansguardian
    3839startupitem.executable  ${prefix}/sbin/dansguardian -N
    3940
    40 variant clamav description {Enable support for libclamav av scanner} {
    41         depends_lib-append      port:clamav
    42        
    43         # enable --enable-clamav in the next version if it works with >=clamav-0.95
    44         #configure.args-delete  --disable-clamav
    45         #configure.args-append  --enable-clamav
    46        
    47         configure.args-append   --enable-clamd \
    48                                 --with-proxyuser=clamav \
    49                                 --with-proxygroup=clamav
    50 }
    51 
    52 variant ntlm description {Enable support for the NTLM auth plugin} {
    53         depends_lib-append      port:libntlm \
    54                                 port:libiconv
    55         configure.args-delete   --disable-ntlm
    56         configure.args-append   --enable-ntlm
    57 }
    58 
    59 post-destroot {
     41post-activate {
    6042        set runas_user nobody
    6143        set runas_group nobody
    6244
    63         if { [variant_isset clamav]} {
    64                 if { [existsuser clamav] && [existsgroup clamav] } {
    65                         set runas_user clamav
    66                         set runas_group clamav
     45        set log_path ${prefix}/var/log/dansguardian/
     46        xinstall -d ${prefix}/var/log/
     47        xinstall -d -o ${runas_user} -g ${runas_group} -m 755 ${log_path}
     48        fs-traverse file ${log_path} {
     49                if { [file isdirectory ${file}] } {
     50                        file attributes ${file} -group ${runas_group} -owner ${runas_user} -permissions 00755
     51                } else {
     52                        file attributes ${file} -group ${runas_group} -owner ${runas_user} -permissions 00644
    6753                }
    68 
    69                 ui_msg "\n DansGuardian and clamd must run with either the same group or user ID. \n\
    70                         Don't forget to set clamd socket in etc/dansguardian/contentscanners/clamdscan.conf.\n"
    7154        }
    72                
    73         # by default dansguardian runs as nobody and writes log to /var/log/dansguardian/access.log
    74         # !!! when user rebuilds dansguardian with clamav variant var/log/dansguardian/access.log has old owner and access is denied
    75         # the solution is to rm -rf ${prefix}/var/log/dansguardian and port activate dansguardian
    76         xinstall -d -o ${runas_user} -g ${runas_group} -m 755 ${destroot}${prefix}/var/log/dansguardian
    77         destroot.keepdirs-append ${destroot}${prefix}/var/log/dansguardian
    78 }
    79 
    80 livecheck.type  regex
    81 livecheck.url   "http://dansguardian.org/?page=news"
    82 livecheck.regex "DansGuardian (.*) is.*released!"
    8355
     56}