source: trunk/dports/mail/postgrey/Portfile

Last change on this file was 151863, checked in by mojca@…, 13 months ago

postgrey: switch to perl5.24 (#52081)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 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 151863 2016-08-23 12:32:35Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           perl5 1.0
6
7name                postgrey
8version             1.35
9revision            2
10categories          mail
11license             GPL-2
12maintainers         nomaintainer
13description         Postfix policy server implementing greylisting
14long_description    When a request for delivery of a mail is received by \
15                    Postfix via SMTP, the triplet CLIENT_IP / SENDER / RECIPIENT \
16                    is built. If it is the first time that this triplet is seen, \
17                    or if the triplet was first seen, less than 5 minutes ago, \
18                    then the mail gets rejected with a temporary error. Hopefully\
19                    spammers or viruses will not try again later, as it is \
20                    however required per RFC.
21platforms           darwin
22supported_archs     noarch
23homepage            http://postgrey.schweikert.ch/
24master_sites        ${homepage}pub \
25                    ${homepage}pub/old
26
27checksums           rmd160  7dc67fb3df37094da3039297d3885ccde5f08c06 \
28                    sha256  f6a6956630803e6f79ebff6ad0cc0d46ba32046ed6cc260e38e6f591de7bbdcf
29
30perl5.branches      5.24
31depends_lib-append  port:p${perl5.major}-berkeleydb \
32                    port:p${perl5.major}-io-multiplex \
33                    port:p${perl5.major}-net-server
34
35startupitem.create  yes
36startupitem.start   "${prefix}/share/postgrey/postgrey.sh start"
37startupitem.stop    "${prefix}/share/postgrey/postgrey.sh stop"
38
39configure {
40    system "echo all: > ${worksrcpath}/Makefile"
41    reinplace "s|/usr/bin/perl|${perl5.bin}|g" \
42        ${worksrcpath}/postgrey \
43        ${worksrcpath}/contrib/postgreyreport
44    reinplace -locale C "s|/etc/postfix|${prefix}/etc/postgrey|g" \
45        ${worksrcpath}/postgrey \
46        ${worksrcpath}/postgrey_whitelist_clients \
47        ${worksrcpath}/postgrey_whitelist_recipients \
48        ${worksrcpath}/contrib/postgreyreport
49    reinplace "s|/etc/main.cf|postfix's main.cf|g" \
50        ${worksrcpath}/postgrey
51    reinplace "s|/var/spool/postfix/postgrey|${prefix}/var/spool/postgrey|g" \
52        ${worksrcpath}/postgrey \
53        ${worksrcpath}/contrib/postgreyreport
54}
55
56build.target
57
58destroot {
59    adduser postgrey realname=Postgrey\ Server
60    addgroup postgrey
61    file mkdir ${destroot}${prefix}/etc/postgrey
62    file mkdir ${destroot}${prefix}/share/postgrey
63    file mkdir ${destroot}${prefix}/share/doc/postgrey
64    file mkdir ${destroot}${prefix}/share/man/man1
65    file mkdir ${destroot}${prefix}/share/man/man8
66    xinstall -d -o postgrey -g postgrey -m 750 \
67        ${destroot}${prefix}/var/spool/postgrey
68    xinstall -d -o postgrey -g postgrey -m 750 \
69        ${destroot}${prefix}/var/run/postgrey
70    destroot.keepdirs ${destroot}${prefix}/var/spool/postgrey \
71        ${destroot}${prefix}/var/run/postgrey \
72        ${destroot}${prefix}/etc/postgrey
73    system "${prefix}/bin/pod2man-${perl5.major} --section=8 ${worksrcpath}/postgrey > \
74        ${destroot}${prefix}/share/man/man8/postgrey.8"
75    system "${prefix}/bin/pod2man-${perl5.major} --section=1 ${worksrcpath}/contrib/postgreyreport > \
76        ${destroot}${prefix}/share/man/man1/postgreyreport.1"
77    xinstall -m 755 -c ${worksrcpath}/contrib/postgreyreport \
78        ${destroot}${prefix}/bin/postgreyreport
79    xinstall -m 644 -c ${worksrcpath}/README \
80        ${worksrcpath}/README.exim \
81        ${worksrcpath}/Changes \
82        ${worksrcpath}/COPYING \
83        ${destroot}${prefix}/share/doc/postgrey
84    xinstall -m 644 -c ${portpath}/files/postgrey.conf \
85        ${destroot}${prefix}/etc/postgrey/postgrey.conf.sample
86    xinstall -m 755 -c ${portpath}/files/postgrey.sh \
87        ${destroot}${prefix}/share/postgrey
88    reinplace "s|__PREFIX|${prefix}|g" \
89        ${destroot}${prefix}/share/postgrey/postgrey.sh
90    xinstall -m 4755 -o postgrey -g postgrey -c \
91        ${worksrcpath}/postgrey \
92        ${destroot}${prefix}/sbin/postgrey
93    xinstall -m 644 -c \
94        ${worksrcpath}/postgrey_whitelist_clients \
95        ${destroot}${prefix}/etc/postgrey
96    xinstall -m 644 -c \
97        ${worksrcpath}/postgrey_whitelist_recipients \
98        ${destroot}${prefix}/etc/postgrey/postgrey_whitelist_recipients.default
99}
100
101notes "
102Postgrey will be running with following default parameters:
103  user        : postgrey
104  group       : postgrey
105  tcp binding : localhost
106  tcp port    : 60000
107
108You will find configuration in ${prefix}/etc/postgrey
109  postgrey.conf                         : launch options
110  postgrey_whitelist_clients            : default clients whitelist
111  postgrey_whitelist_clients.local      : customisable clients whitelist
112  postgrey_whitelist_recipients         : customisable recipients whitelist
113  postgrey_whitelist_recipients.default : default recipients whitelist (unused)
114
115If you are using postfix, you should add to your main.cf a line:
116  check_policy_service inet:127.0.0.1:60000
117in the smtpd_recipient_restrictions configuration (after
118reject_unauth_destination and other rules) and reload postfix daemon.
119"
Note: See TracBrowser for help on using the repository browser.