Ticket #24474: Portfile.4

File Portfile.4, 2.9 KB (added by pixilla (Bradley Giesbrecht), 14 years ago)

dovecot-antispam-signature

Line 
1# $Id$
2
3PortSystem          1.0
4
5name                dovecot-antispam-signature
6set name_plugin     [join [lrange [split ${name} -] 0 1] -]
7set backend         [join [lrange [split ${name} -] 2 2] -]
8array set backend_options {
9    crm114      "crm114-exec"
10    dspam       "dspam-exec"
11    mailtrain   "mailtrain"
12    signature   "signature-log"
13    spool2dir   "spool2dir"
14}
15set backend_option  $backend_options(${backend})
16epoch               20100411
17version             1.3
18set branch          [join [lrange [split ${version} .] 0 1] .]
19categories          mail
20maintainers         pixilla.com:brad
21platforms           darwin
22
23description         Anti-spam plugin for dovecot
24long_description    ${description} configured for ${backend_option} backend
25
26homepage            http://johannes.sipsolutions.net/Projects/dovecot-antispam
27
28distname            dovecot-antispam-${version}
29
30master_sites        http://johannes.sipsolutions.net/download/dovecot-antispam/
31
32livecheck.type      regex
33livecheck.url       ${master_sites}
34livecheck.regex     "${name}-(\\d+\\.\\d+(\\.\\d+)?)${extract.suffix}"
35
36use_bzip2           yes
37
38checksums           md5     04a0bb49fcb19a6f78c21d982a99d34f \
39                    sha1    e6203cb79907b16632dc6a117faa254c6b975df3 \
40                    rmd160  1c570b7934577abee11b5659e69a00db9573016e
41
42depends_build       port:dovecot
43
44patchfiles          patch-config.diff
45
46set config_file     ${worksrcpath}/.config
47set debug_facility  ""
48set debug_verbose   ""
49
50post-extract {
51    xinstall ${worksrcpath}/defconfig ${config_file}
52}
53
54configure {
55    reinplace "s|@@BACKEND@@|BACKEND=${backend_option}|g" \
56                    ${config_file}
57    reinplace "s|@@DOVECOT@@|DOVECOT=${prefix}/include/dovecot|g" \
58                    ${config_file}
59    reinplace "s|@@INSTALLDIR@@|# INSTALLDIR=${destroot}/lib/dovecot/imap|g" \
60                    ${config_file}
61    reinplace "s|@@DEBUG@@|${debug_facility}|g" \
62                    ${config_file}
63    reinplace "s|@@DEBUG_VERBOSE@@|${debug_verbose}|g" \
64                    ${config_file}
65    reinplace "s|@@PLUGINNAME@@|PLUGINNAME=antispam_${backend}|g" \
66                    ${config_file}
67    reinplace "s|@@EXTRA_CFLAGS@@|CFLAGS += -undefined dynamic_lookup|g" \
68                    ${config_file}
69}
70
71destroot {
72    xinstall -m 755 -d ${destroot}${prefix}/lib/dovecot/imap
73    xinstall -m 755 ${worksrcpath}/lib90_antispam_${backend}_plugin.so ${destroot}${prefix}/lib/dovecot/imap
74    xinstall -m 444 ${worksrcpath}/antispam.7 ${destroot}${prefix}/share/man/man7/antispam_${backend}.7
75}
76
77variant debug_syslog conflicts {debug_stderr} description {Log to syslog} {
78    set debug_facility "DEBUG=syslog"
79}
80
81variant debug_stderr conflicts {debug_syslog} description {Log to stderr} {
82    set debug_facility "DEBUG=stderr"
83}
84
85variant debug_verbose description {Verbose debugging, lots of output!} {
86    set debug_verbose "DEBUG_VERBOSE=1"
87}