source: trunk/dports/mail/dspam/Portfile

Last change on this file was 109054, checked in by pixilla@…, 4 years ago

mail/dspam:

  • Add startupitem. Closes #40033
  • Set maintainers to pixilla and openmaintainer.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.2 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 109054 2013-08-07 14:03:45Z ryandesign@macports.org $
3
4PortSystem 1.0
5
6name            dspam
7version         3.10.2
8revision        2
9categories      mail net
10license         AGPL-3
11maintainers     pixilla openmaintainer
12description     Scalable, open-source statistical anti-spam filter
13long_description Open-source anti-spam filter with multiple algorithms and \
14                 useful admin tools and cgi quarantine interface.
15
16homepage        http://dspam.sourceforge.net/
17platforms       darwin freebsd
18master_sites    sourceforge:project/dspam/dspam/dspam-${version}
19
20checksums       md5 0e0e405d3284485b2a43f47eaf6b09bb \
21                sha1 21133e0ee1880f3e8c849365b7e27a73f6d0413a \
22                rmd160 7e112981e45e483350b9afc056ebfa4c5561036c
23
24configure.args  --sysconfdir='${prefix}/etc' \
25                --mandir='${prefix}/share/man' \
26                --with-logdir=${prefix}/var/log/dspam \
27                --enable-daemon
28
29destroot.keepdirs       ${destroot}${prefix}/var/log/dspam
30
31set storage-driver "hash_drv"
32if {[variant_isset mysql5]} {
33    set storage-driver   "${storage-driver},mysql_drv"
34}
35if {[variant_isset sqlite]} {
36    set storage-driver   "${storage-driver},sqlite3_drv"
37}
38if {[variant_isset postgres]} {
39    set storage-driver   "${storage-driver},pgsql_drv"
40}
41configure.args-append \
42                    --with-storage-driver=${storage-driver}
43if {[variant_isset mysql5] || [variant_isset postgres]} {
44
45    configure.args-append \
46                    --enable-preferences-extension \
47                    --enable-virtual-users
48}
49
50variant vpopmail description {Configure dspam to work with vpopmail} {
51                configure.args-append --with-dspam-home-owner=vpopmail \
52                                      --with-dspam-home-group=vchkpw \
53                                      --with-dspam-owner=vpopmail \
54                                      --with-dspam-group=vchkpw
55                depends_lib     port:vpopmail
56}
57
58variant mysql5 description {Configure dspam to work with mysql5} {
59                depends_lib     path:bin/mysql_config5:mysql5
60                configure.args-append --with-mysql-includes=${prefix}/include/mysql5/mysql \
61                                      --with-mysql-libraries=${prefix}/lib/mysql5/mysql
62}
63
64variant sqlite description {Configure dspam to work with sqlite} {
65                depends_lib     port:sqlite3
66                configure.args-append --with-sqlite-libraries=${prefix}/lib
67}
68variant postgres description {Configure dspam to work with postgresql80} {
69                depends_lib     port:postgresql80
70                configure.args-append --with-pgsql-includes=${prefix}/include/postgresql80 \
71                                      --with-pgsql-libraries=${prefix}/lib/postgresql80
72}
73
74variant debug description {add debug capabilities} {
75                configure.args-append --enable-debug \
76                                      --enable-verbose-debug
77}
78
79post-destroot {
80        file rename ${destroot}${prefix}/etc/dspam.conf ${destroot}${prefix}/etc/dspam.conf.sample
81        file mkdir ${destroot}${prefix}/var/dspam/samples
82        file mkdir ${destroot}${prefix}/share/doc/dspam
83        file mkdir ${destroot}${prefix}/var/dspam/mysql
84        file mkdir ${destroot}${prefix}/var/dspam/pgsql
85        file mkdir ${destroot}${prefix}/var/dspam/sqlite
86        file mkdir ${destroot}${prefix}/var/dspam/webui
87        file mkdir ${destroot}${prefix}/var/dspam/webui/cgi-bin
88        file mkdir ${destroot}${prefix}/var/dspam/webui/htdocs
89        file copy ${worksrcpath}/README ${destroot}${prefix}/share/doc/dspam/
90        file copy ${worksrcpath}/UPGRADING ${destroot}${prefix}/share/doc/dspam/
91        file copy ${worksrcpath}/RELEASE.NOTES ${destroot}${prefix}/share/doc/dspam/
92        file copy ${worksrcpath}/CHANGELOG ${destroot}${prefix}/share/doc/dspam/
93        system "cp -R ${worksrcpath}/webui/cgi-bin/* ${destroot}${prefix}/var/dspam/webui/cgi-bin/"
94        system "rm ${destroot}${prefix}/var/dspam/webui/cgi-bin/Make*"
95        system "cp -R ${worksrcpath}/webui/htdocs/* ${destroot}${prefix}/var/dspam/webui/htdocs/"
96        system "rm ${destroot}${prefix}/var/dspam/webui/htdocs/Make*"
97        system "cp ${worksrcpath}/txt/*.txt ${destroot}${prefix}/var/dspam/samples/"
98        system "cp ${worksrcpath}/doc/*.txt ${destroot}${prefix}/share/doc/dspam/"
99        system "cp -R ${worksrcpath}/src/tools.mysql_drv/*sql ${destroot}${prefix}/var/dspam/mysql"
100        system "cp -R ${worksrcpath}/src/tools.pgsql_drv/*sql ${destroot}${prefix}/var/dspam/pgsql"
101        system "cp -R ${worksrcpath}/src/tools.sqlite_drv/*sql ${destroot}${prefix}/var/dspam/sqlite"
102        if {[variant_isset vpopmail]} {
103                system "chown -R vpopmail:vchkpw ${destroot}${prefix}/var/dspam"
104                system "chown -R vpopmail:vchkpw ${destroot}${prefix}/var/log/dspam"
105        }
106}
107
108startupitem.create      yes
109startupitem.executable  ${prefix}/bin/dspam --daemon --nofork
110
111notes "
112Please create the dspam configuration file ${prefix}/etc/dspam.conf\
113by using the sample file ${prefix}/etc/dspam.conf.sample as a reference
114"
115
116livecheck.url   http://sourceforge.net/projects/dspam/files/dspam/
117livecheck.regex "${name}-((?!.*${name}.*|\\${extract.suffix}).*)\\${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.