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

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

fail2ban: use unified python portgroup

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