source: trunk/dports/mail/qmail-spamcontrol/Portfile

Last change on this file was 75061, checked in by ryandesign@…, 7 years ago

Remove wrong backslashes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.0 KB
Line 
1# $Id: Portfile 75061 2011-01-13 21:07:47Z ryandesign@macports.org $
2
3PortSystem      1.0
4
5name                            qmail-spamcontrol
6version                         2.5.19
7revision                        0
8categories                      mail
9maintainers                     yahoo.com:compconsultant
10platforms                       darwin
11
12description                     Qmail, enhanced Spamcontrol version
13
14long_description                Robust, popular mail system.
15
16extract.mkdir                   yes
17
18universal_variant               no
19
20variant relaymailfrom description {Relay based on sender email, not a good idea} {}
21variant noreqbrackets description {Do not require brackets in SMTP addresses} {}
22variant noverp description {Do not alow VERP addresses for recipients} {}
23variant moreipme description {Patch to account for certain NAT or load balance situations} {}
24variant bigtodo description {May make very large installations more efficient} {}
25
26homepage                        http://www.fehcom.de/qmail/spamcontrol.html
27
28master_sites                    http://www.fehcom.de/qmail/spamcontrol/:spamcontrol \
29                                http://cr.yp.to/software/:qmail \
30                                http://qmail.site2nd.org/:qmail \
31                                http://qmail-mirror.jms1.net/:qmail \
32                                http://www.qmail.org/:qmail
33
34distfiles                       qmail-1.03.tar.gz:qmail \
35                                spamcontrol-2519_tgz.bin:spamcontrol
36
37checksums                       qmail-1.03.tar.gz \
38                                        md5 622f65f982e380dbe86e6574f3abcb7c \
39                                        sha1 18fb960481291a0503e93a94df3f6094edb7f27a \
40                                        rmd160 b851f273f1d365d38efd949b1efcf35768ffa30f \
41                                spamcontrol-2519_tgz.bin \
42                                        md5 acca46cc48d8b5cfa9eb3de4d3fc90ad \
43                                        sha1 b259183cb9afd7a574ad598cb2399af5002226ec \
44                                        rmd160 8374835ade0656145ba15eded23c6f8ce0a1b936
45
46worksrcdir              qmail-1.03
47
48patchfiles              patch-dns.c.diff \
49                        patch-strerr_sys.c.diff \
50                        patch-qmail-lspawn.c.diff \
51                        patch-qmail-rspawn.c.diff \
52                        patch-qmail.c.diff \
53                        patch-Makefile.diff
54
55configure.cflags        -O2 -include /usr/include/errno.h -c
56build.target            setup-patch
57destroot.cmd            ./install-destroot
58
59post-extract {
60
61        # Merge Spamcontrol source with Qmail source
62        foreach file [glob ${worksrcpath}/qmail-1.03/*] {
63                file rename ${file} ${worksrcpath}/
64        }
65        file delete ${worksrcpath}/qmail-1.03
66
67        # Create an install file to install into destroot since
68        # destroot is not supported by qmail
69        file copy ${worksrcpath}/conf-qmail ${worksrcpath}/conf-destroot
70        reinplace "s|/var/qmail|${destroot}${prefix}/var/qmail|g" \
71                ${worksrcpath}/conf-destroot
72        file copy ${worksrcpath}/install.c ${worksrcpath}/install-destroot.c
73
74        # Change live install dir to reflect the prefix
75        reinplace "s|/var/qmail|${prefix}/var/qmail|g" \
76                ${worksrcpath}/conf-qmail
77}
78
79pre-patch {
80                # Apply Spamcontrol patches
81                foreach file [glob ${worksrcpath}/*.patch] {
82                        system "patch -d ${worksrcpath} -p2 <${file}"
83                }
84}
85
86post-patch {
87
88                # Handle the variants, disable via source code define change
89                foreach file [glob ${worksrcpath}/*c] {
90                        if {![variant_isset relaymailfrom]} {
91                                reinplace "s|^#define RELAYMAILFROM|\/* #define RELAYMAILFROM *\/|g" \
92                                        ${file}
93                        }
94                        if {[variant_isset noreqbrackets]} {
95                                reinplace "s|^#define REQBRACKETS|\/* #define REQBRACKETS *\/|g" \
96                                        ${file}
97                        }
98                        if {[variant_isset noverp]} {
99                                reinplace "s|^#define VERP|\/* #define VERP *\/|g" \
100                                        ${file}
101                        }
102                        if {![variant_isset moreipme]} {
103                                reinplace "s|^#define MOREIPME|\/* #define MOREIPME *\/|g" \
104                                        ${file}
105                        }
106                        if {![variant_isset bigtodo]} {
107                                reinplace "s|^#define BIGTODO|\/* #define BIGTODO *\/|g" \
108                                        ${file}
109                        }
110                }
111}
112
113configure {
114
115        # The qmail users and groups are required before compilation
116        addgroup qmail gid=2107
117        addgroup nofiles gid=2108
118        adduser alias uid=7790 gid=[existsgroup nofiles] realname=Qmail-alias-user home=${prefix}/var/qmail shell=/usr/bin/true
119        adduser qmaild uid=7791 gid=[existsgroup nofiles] realname=Qmail-SMTP-user home=${prefix}/var/qmail shell=/usr/bin/true
120        adduser qmaill uid=7792 gid=[existsgroup nofiles] realname=Qmail-log-user home=${prefix}/var/qmail shell=/usr/bin/true
121        adduser qmailp uid=7793 gid=[existsgroup nofiles] realname=Qmail-password-user home=${prefix}/var/qmail shell=/usr/bin/true
122        adduser qmailq uid=7794 gid=[existsgroup qmail] realname=Qmail-queue-user home=${prefix}/var/qmail shell=/usr/bin/true
123        adduser qmailr uid=7795 gid=[existsgroup qmail] realname=Qmail-remote-user home=${prefix}/var/qmail shell=/usr/bin/true
124        adduser qmails uid=7796 gid=[existsgroup qmail] realname=Qmail-send-user home=${prefix}/var/qmail shell=/usr/bin/true
125}
126
127pre-destroot {
128        # A whole lot of keepdirs, Qmail creates lots of required, empty directories
129        destroot.keepdirs \
130                ${destroot}${prefix}/var/log/qmail/smtpd \
131                ${destroot}${prefix}/var/qmail/control \
132                ${destroot}${prefix}/var/qmail/users \
133                ${destroot}${prefix}/var/qmail/queue/pid \
134                ${destroot}${prefix}/var/qmail/queue/bounce
135        if {![variant_isset bigtodo]} {
136                destroot.keepdirs-append \
137                        ${destroot}${prefix}/var/qmail/queue/todo \
138                        ${destroot}${prefix}/var/qmail/queue/intd
139        }
140       
141        for {set i 0} {$i <= 22} {incr i} {
142                destroot.keepdirs-append \
143                        ${destroot}${prefix}/var/qmail/queue/info/${i} \
144                        ${destroot}${prefix}/var/qmail/queue/remote/${i} \
145                        ${destroot}${prefix}/var/qmail/queue/local/${i} \
146                        ${destroot}${prefix}/var/qmail/queue/mess/${i}
147                if {[variant_isset bigtodo]} {
148                        destroot.keepdirs-append \
149                                ${destroot}${prefix}/var/qmail/queue/todo/${i} \
150                                ${destroot}${prefix}/var/qmail/queue/intd/${i}
151                }
152        }
153}
154
155post-destroot {
156        # Minimal requirements per Qmail install doc
157        touch ${destroot}${prefix}/var/qmail/alias/.qmail-postmaster
158        touch ${destroot}${prefix}/var/qmail/alias/.qmail-mailer-daemon
159        touch ${destroot}${prefix}/var/qmail/alias/.qmail-root
160
161        # Create the log directories
162        xinstall -d -o qmaill ${destroot}${prefix}/var/log/qmail/smtpd
163
164        # Copy example files
165        xinstall -d ${destroot}${prefix}/var/qmail/samples
166        xinstall -m 644 -W ${filespath} README.txt ${destroot}${prefix}/var/qmail/samples
167        foreach file {run qmailctl qmail-send-run qmail-send-log-run qmail-smtpd-run qmail-smtpd-log-run} {
168                xinstall -W ${filespath} ${file}.in ${destroot}${prefix}/var/qmail/samples/${file}
169                reinplace "s%@PREFIX@%${prefix}%g" ${destroot}${prefix}/var/qmail/samples/${file}
170        }
171       
172        # Additional Spamcontrol files
173        xinstall -d ${destroot}${prefix}/var/qmail/scripts
174        foreach file {qmail-alias2recipients qmail-users2recipients qmail-pwd2recipients qmail-vpopmail2recipients} {
175                xinstall -W ${worksrcpath} ${file} ${destroot}${prefix}/var/qmail/scripts
176        }
177        foreach file {conf-spamcontrol ucspi-ssl-0.70_ucspitls-0.4.patch_ clamav-0.90.1_output.patch_ Makefile.djbdns badmailfrom badmimetypes badloadertypes badrcptto INSTALL.spamcontrol HISTORY.spamcontrol FILES.spamcontrol LICENSE.spamcontrol TODO.spamcontrol LOGGING.spamcontrol SMTPREPLY.spamcontrol PROPOSAL.mav install_spamcontrol.sh} {
178                xinstall -m 644 -W ${worksrcpath} ${file} ${destroot}${prefix}/var/qmail/doc
179        }
180        foreach file [glob -directory ${worksrcpath} README* RELEASE*] {
181                xinstall -m 644 ${file} ${destroot}${prefix}/var/qmail/doc
182        }
183
184        # User must run this
185        xinstall -W ${worksrcpath} config-fast ${destroot}${prefix}/var/qmail/scripts/config-fast
186
187        # Per Qmail install doc
188        xinstall ${destroot}${prefix}/var/qmail/boot/home ${destroot}${prefix}/var/qmail/rc.sample
189}
190
191post-install {
192ui_msg "\n
193To control qmail, the daemontools and ucspi-tcp ports are highly recommended.
194A good reference for setting up qmail is http://www.lifewithqmail.org/ .
195This port includes some sample files based on the Life with Qmail web site.
196They can be found in ${prefix}/var/qmail/samples .
197Also look at http://www.fehcom.de/qmail/spamcontrol.html for further info.
198The fehcom site has docs for all the stuff added to the base qmail software.
199There are numerous configuration options to qmail. Please read all the docs!
200******************************
201NEW INSTALLS ONLY
202For now, you must run ${prefix}/var/qmail/scripts/config-fast your.domain.name
203to set up some files for your mail server. your.domain.name should point
204to this machine you are installing qmail on.
205******************************
206\n"
207}
208
209post-activate {
210
211        # Remove the turd files, it is not know if they cause a problem but
212        # people have recommended not having them there.
213        system "cd ${prefix}/var/qmail; find . -name .turd_${name} -delete"
214}
215
216livecheck.type                  regex
217livecheck.regex                 {SPAMCONTROL\sVersion\s([0-9.]+)}
Note: See TracBrowser for help on using the repository browser.