source: trunk/dports/mail/pflogsumm/Portfile @ 30236

Last change on this file since 30236 was 30236, checked in by jmpp@…, 12 years ago

nomaintainer address abstraction in mail category.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1# $Id: Portfile 30236 2007-10-22 23:15:10Z jmpp@macports.org $
2PortSystem 1.0
3
4name                    pflogsumm
5version                 1.1.0
6categories              mail
7maintainers             nomaintainer
8description             Produce Postfix MTA logfile summary
9long_description        Pflogsumm is a log analyzer/summarizer for the \
10                                        Postfix MTA.  It is designed to provide an over-view \
11                                        of Postfix activity, with just enough detail to give \
12                                        the administrator a "heads up" for potential trouble \
13                                        spots. \
14                                        Pflogsumm generates summaries and, in some cases, \
15                                        detailed reports of mail server traffic volumes, \
16                                        rejected and bounced email, and server warnings, \
17                                        errors and panics. \
18                                        Also installs Chris Cappuccio's CGI script for \
19                                        browser access to the Pflogsumm output.
20homepage                http://jimsun.linxnet.com/postfix_contrib.html
21master_sites    http://jimsun.linxnet.com/downloads/ \
22                                http://www.nmedia.net/~chris/mail/:cgi
23distfiles-append        mail-cgi.txt:cgi
24checksums               ${distname}.tar.gz md5 1f78fcaf2a36ec3520ecff286a45251a \
25                                mail-cgi.txt md5 352451388eed3d1f7255dc07fc411d97
26extract.only    ${distname}.tar.gz
27platforms               darwin freebsd
28
29set perl5.bin   ${prefix}/bin/perl
30
31depends_run             bin:${perl5.bin}:perl5.8 \
32                                port:p5-date-calc
33
34set cgi_path            ""
35set maillog_path        ""
36
37platform darwin {
38        global cgi_path maillog_path
39        set cgi_path "/Library/WebServer/CGI-Executables"
40        set maillog_path "/var/log/mail.log"
41
42        # MacPorts Apache interoperability
43        if {[file exists ${prefix}/sbin/httpd]} {
44                set cgi_path "${prefix}/www/cgi-bin"
45        }
46}
47
48platform freebsd {
49        global cgi_path maillog_path
50        set cgi_path "/usr/local/www/cgi-bin"
51        set maillog_path "/var/log/maillog"
52
53        # MacPorts Apache interoperability
54        if {[file exists ${prefix}/sbin/httpd]} {
55                set cgi_path "${prefix}/www/cgi-bin"
56        }
57}
58
59post-extract {
60        file copy -force ${distpath}/mail-cgi.txt ${worksrcpath}/${name}.cgi
61}
62
63use_configure   no
64
65build {
66        cd ${worksrcpath}
67        reinplace "s|^#!.*perl|#!${perl5.bin}|" ${name}.pl
68        reinplace "s|mail.empnet.com|[exec hostname]|" ${name}.cgi
69        reinplace "s|/var/log/maillog|${maillog_path}|" ${name}.cgi
70        reinplace "s|${maillog_path}\[.\]\[0-3\]|&.gz|" ${name}.cgi
71        reinplace "s|/usr/ucb/ps|[binaryInPath ps]|" ${name}.cgi
72        reinplace "s|zcat=\"/bin/cat|zcat=\"[binaryInPath zcat]|" ${name}.cgi
73        reinplace "s|/bin/cat|[binaryInPath cat]|" ${name}.cgi
74        reinplace "s|/usr/local/bin/${name}.pl|${prefix}/bin/${name}|" ${name}.cgi
75        reinplace "s|^opts=|# &|" ${name}.cgi
76        reinplace "s|^#opts=|opts=|" ${name}.cgi
77        reinplace "s|mail.cgi|${name}.cgi|" ${name}.cgi
78        reinplace "s|\$pflog \$opts.*$|& 2>\\&1|" ${name}.cgi
79}
80
81destroot {
82        xinstall -m 0755 ${worksrcpath}/${name}.pl \
83                ${destroot}${prefix}/bin/${name}
84        xinstall -m 0644 ${worksrcpath}/${name}.1 \
85                ${destroot}${prefix}/share/man/man1
86        xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
87        xinstall -m 0644 ${worksrcpath}/${name}-faq.txt \
88                ${destroot}${prefix}/share/doc/${name}
89        xinstall -d -m 0755 ${destroot}${cgi_path}
90        set maillog_group [file attributes ${maillog_path} -group]
91        xinstall -m 02755 -g ${maillog_group} ${worksrcpath}/${name}.cgi \
92                ${destroot}${cgi_path}
93}
94
Note: See TracBrowser for help on using the repository browser.