source: trunk/dports/mail/pflogsumm/Portfile

Last change on this file was 151866, checked in by mojca@…, 11 months ago

pflogsumm: switch to perl5.24 (#52081)

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