source: trunk/dports/mail/assp/Portfile

Last change on this file was 129114, checked in by jmr@…, 3 years ago

assp: use add_users, use extract.mkdir, use C locale to prevent reinplace failure, mark noarch

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 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 129114 2014-12-05 22:24:29Z ryandesign@macports.org $
3
4PortSystem              1.0
5
6name                    assp
7version                 1.1.0
8categories              mail
9license                 GPL-2
10maintainers             nomaintainer
11description             Anti-Spam SMTP Proxy (ASSP) Server
12long_description        The Anti-Spam SMTP Proxy (ASSP) Server is an open \
13                                        source, platform-independent SMTP Proxy server which \
14                                        implements whitelists and Bayesian filtering to rid \
15                                        the planet of the blight of unsolicited email (UCE). \
16                                        UCE must be stopped at the SMTP server.  Anti-spam \
17                                        tools must be adaptive to new spam and customized \
18                                        for each site?s mail patterns. This free, \
19                                        easy-to-use tool works with any mail transport and \
20                                        achieves these goals requiring no operator \
21                                        intervention after the initial setup phase.
22homepage                http://assp.sourceforge.net/
23master_sites    sourceforge
24use_zip                 yes
25checksums               md5 55be31bab3efacc6bd964adf8cd25c83
26platforms               darwin
27supported_archs noarch
28
29depends_run             port:perl5
30
31extract.mkdir   yes
32
33set assp_base   ${prefix}/var/assp
34
35pre-patch {
36        file rename "${worksrcpath}/ASSP Documentation.htm" ${worksrcpath}/ASSPDocumentation.htm
37        file rename "${worksrcpath}/Regular Expression Tutorial.htm" ${worksrcpath}/RegularExpressionTutorial.htm
38        foreach file [glob -directory ${worksrcpath} *.pl *.sh *.htm *.txt rc/*.dat] {
39                reinplace -locale C "s%\r%%" $file
40        }
41}
42patchfiles              patch-assp.pl.diff
43
44configure {
45        reinplace "s%^#!.*perl%#!${prefix}/bin/perl%" \
46                ${worksrcpath}/assp.pl \
47                ${worksrcpath}/move2num.pl \
48                ${worksrcpath}/rebuildspamdb.pl \
49                ${worksrcpath}/repair.pl \
50                ${worksrcpath}/stat.pl
51        reinplace -locale C "s%/usr/local/assp%${assp_base}%" \
52                ${worksrcpath}/ASSPDocumentation.htm \
53                ${worksrcpath}/stats.sh \
54                ${worksrcpath}/assp.pl \
55                ${worksrcpath}/rc/assp.dat \
56                ${worksrcpath}/rc/start.dat \
57                ${worksrcpath}/rc/stop.dat
58        reinplace -locale C "s%/usr/local%${prefix}%" \
59                ${worksrcpath}/ASSPDocumentation.htm
60}
61
62build {}
63
64add_users assp group=assp realname=ASSP\ Proxy home=${prefix}/var/assp
65
66destroot {
67        xinstall -d -m 0755 ${destroot}${prefix}/etc/rc.d
68        xinstall -m 0755 -W ${worksrcpath} rc/assp.dat ${destroot}${prefix}/etc/rc.d/assp.sh
69
70        xinstall -o assp -g assp -d -m 0755 ${destroot}${assp_base}
71        xinstall -o assp -g assp -m 0640 ${filespath}/assp.cfg.in \
72                ${destroot}${assp_base}/assp.cfg-dist
73        reinplace "s%__BASE%${assp_base}%" ${destroot}${assp_base}/assp.cfg-dist
74        xinstall -o assp -g assp -m 0755 -W ${worksrcpath} rc/start.dat ${destroot}${assp_base}/start
75        xinstall -o assp -g assp -m 0755 -W ${worksrcpath} rc/stop.dat ${destroot}${assp_base}/stop
76        xinstall -o assp -g assp -m 0755 -W ${worksrcpath} freshclam.sh stats.sh ${destroot}${assp_base}
77        xinstall -o assp -g assp -m 0755 -W ${worksrcpath} assp.pl move2num.pl rebuildspamdb.pl repair.pl stat.pl ${destroot}${assp_base}
78        xinstall -o assp -g assp -m 0644 -W ${worksrcpath} notspamreport.txt spamreport.txt whitereport.txt ${destroot}${assp_base}
79
80        xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
81        xinstall -m 0644 -W ${worksrcpath} changelog.txt ${destroot}${prefix}/share/doc/${name}
82        foreach file [glob -directory ${worksrcpath} *.htm] {
83                xinstall -m 0644 $file ${destroot}${prefix}/share/doc/${name}
84        }
85}
86
87post-activate {
88        if {![file exists ${assp_base}/assp.cfg]} {
89                xinstall -o assp -g assp -m 0640 ${assp_base}/assp.cfg-dist \
90                        ${assp_base}/assp.cfg
91                ui_msg "
92========================================================================
93After restarting your computer or manually starting ASSP:
94
95  sudo ${prefix}/etc/rc.d/assp.sh start
96
97Point your browser to http://127.0.0.1:55555/ -- put anything you like
98in the username and use the password nospam4me to connect. If everything
99is working correctly you will see a beautifully formatted configuration
100screen with all of ASSP's fabulous features spelled out for you in
101painful detail. Simply click the options you want, type a few
102customizations if you like and you're on your way.
103
104At a minimum you'll want to change values for 'Web Admin Password,'
105'Accept All Mail,' 'Local Domains,' 'Spam Error,' and 'Spam Addresses.'
106The password for your server is posted in bold on the internet for
107EVERYONE to see, so if you don't change it, you deserve what you get.
108Also remember to press Enter or click the button at the bottom to
109register your changes - simply clearing a checkbox doesn't send the
110change to ASSP.
111
112See ${homepage} for more information.
113========================================================================
114"
115        }
116}
Note: See TracBrowser for help on using the repository browser.