source: trunk/dports/security/fail2ban/Portfile @ 128495

Last change on this file since 128495 was 128495, checked in by ryandesign@…, 5 years ago

fail2ban: fix livecheck (#45980)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.0 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 128495 2014-11-22 11:11:54Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup               github 1.0
6PortGroup               python 1.0
7
8github.setup            fail2ban fail2ban 0.8.10
9categories              security python
10license                 GPL-2+
11maintainers             free.fr:fclaire openmaintainer
12platforms               darwin
13supported_archs         noarch
14
15description             Fail2ban protects computer against brute-force attacks
16
17long_description        Fail2ban scans log files (e.g. /var/log/apache/error_log) and \
18                        bans IPs that show the malicious signs -- too many password failures, \
19                        seeking for exploits, etc. Generally Fail2Ban then used to update \
20                        firewall rules to reject the IP addresses for a specified amount \
21                        of time, although any arbitrary other action (e.g. sending an email, \
22                        or ejecting CD-ROM tray) could also be configured. Out of the box \
23                        Fail2Ban comes with filters for various services (apache, curier, ssh, etc).
24
25homepage                http://www.fail2ban.org/
26
27checksums               rmd160 17f3535a4b92740f5203dfdee874d71d2377e5c9 \
28                        sha256 7bed38372a24e35268d9c9ff5b272f7e88e91074f9bb24d5be5c70196f19e7be
29
30python.default_version  27
31
32set f2bconfdir          ${prefix}/etc/${name}
33set f2bbindir           ${prefix}/bin
34set f2brundir           ${prefix}/var/run/${name}
35set f2bsock             ${f2brundir}/${name}.sock
36set f2bpid              ${f2brundir}/${name}.pid
37
38python.link_binaries_suffix
39
40patchfiles              patch-setup.py.diff \
41                        patch-setup.cfg.diff \
42                        patch-fail2ban-client.diff \
43                        patch-fail2ban-regex.diff \
44                        patch-fail2ban-server.diff \
45                        patch-config-fail2ban.conf.diff \
46                        patch-config-jail.conf.diff \
47                        patch-client-csocket.py.diff \
48                        patch-server-server.py.diff
49
50post-patch   {
51    reinplace "s|@@PREFIX@@|${prefix}|g"    ${worksrcpath}/setup.py \
52                                            ${worksrcpath}/setup.cfg \
53                                            ${worksrcpath}/fail2ban-client \
54                                            ${worksrcpath}/fail2ban-regex \
55                                            ${worksrcpath}/fail2ban-server \
56                                            ${worksrcpath}/client/csocket.py \
57                                            ${worksrcpath}/config/fail2ban.conf \
58                                            ${worksrcpath}/server/server.py
59}
60
61startupitem.create      yes
62startupitem.start       "if \[ -r ${f2bsock} && ! -r ${f2bpid} \]; then rm ${f2bsock}; fi; ${f2bbindir}/${name}-client start"
63startupitem.stop        "${f2bbindir}/${name}-client stop"
64
65destroot.keepdirs       ${destroot}${f2brundir}
66
67post-destroot {
68    # Adding dedicated OSX pf-icefloor action file
69    xinstall -m 644 ${filespath}/pf-icefloor.conf ${destroot}${f2bconfdir}/action.d/
70    # Adding a suffix to config files
71    set cfgfiles [concat [glob ${destroot}${f2bconfdir}/*.conf] [glob ${destroot}${f2bconfdir}/action.d/*.conf] [glob ${destroot}${f2bconfdir}/filter.d/*.conf]]
72    foreach cfgfile ${cfgfiles} {
73        move ${cfgfile} ${cfgfile}.${version}
74    }
75}
76
77post-activate {
78    # If not already present we put default config files
79    set cfgfiles [concat [glob ${f2bconfdir}/*.conf.${version}] [glob ${f2bconfdir}/action.d/*.conf.${version}] [glob ${f2bconfdir}/filter.d/*.conf.${version}]]
80    foreach cfgfile ${cfgfiles} {
81        regsub "\.${version}" ${cfgfile} {} origcfgfile
82        if {![file exists ${origcfgfile}]} {
83            file copy ${cfgfile} ${origcfgfile}
84        }
85    }
86}
87
88livecheck.type          regexm
89livecheck.url           ${homepage}wiki/index.php/Downloads
90livecheck.regex         <i>stable</i>.*?>${name}-(\[0-9.\]+)<
Note: See TracBrowser for help on using the repository browser.