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$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup github 1.0 |
---|
6 | PortGroup python27 1.0 |
---|
7 | |
---|
8 | github.setup fail2ban fail2ban 0.8.6 |
---|
9 | categories security python |
---|
10 | license GPL-2+ |
---|
11 | maintainers free.fr:fclaire openmaintainer |
---|
12 | platforms darwin |
---|
13 | homepage http://www.fail2ban.org |
---|
14 | description Fail2ban protects computer against brute-force attacks |
---|
15 | |
---|
16 | long_description Fail2ban scans log files (e.g. /var/log/apache/error_log) and \ |
---|
17 | bans IPs that show the malicious signs -- too many password failures, \ |
---|
18 | seeking for exploits, etc. Generally Fail2Ban then used to update \ |
---|
19 | firewall rules to reject the IP addresses for a specified amount \ |
---|
20 | of time, although any arbitrary other action (e.g. sending an email, \ |
---|
21 | or ejecting CD-ROM tray) could also be configured. Out of the box \ |
---|
22 | Fail2Ban comes with filters for various services (apache, curier, ssh, etc). |
---|
23 | |
---|
24 | checksums sha256 24d02422c55f1b7d92bea30a7dde6f72f280eadf09d478fcca8b1dd40fb4e914 \ |
---|
25 | rmd160 70678ca46849a462367603fb3d0e2c6c2f3b75cf |
---|
26 | |
---|
27 | set f2bconfdir ${prefix}/etc/${name} |
---|
28 | set f2bbindir ${prefix}/bin |
---|
29 | |
---|
30 | python.link_binaries_suffix |
---|
31 | |
---|
32 | patchfiles patch-setup.py.diff \ |
---|
33 | patch-setup.cfg.diff \ |
---|
34 | patch-fail2ban-client.diff \ |
---|
35 | patch-fail2ban-regex.diff \ |
---|
36 | patch-fail2ban-server.diff \ |
---|
37 | patch-config-fail2ban.conf.diff \ |
---|
38 | patch-client-csocket.py.diff \ |
---|
39 | patch-server-server.py.diff |
---|
40 | |
---|
41 | post-patch { |
---|
42 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/setup.py |
---|
43 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/setup.cfg |
---|
44 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/fail2ban-client |
---|
45 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/fail2ban-regex |
---|
46 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/fail2ban-server |
---|
47 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/client/csocket.py |
---|
48 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/config/fail2ban.conf |
---|
49 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/server/server.py |
---|
50 | } |
---|
51 | |
---|
52 | startupitem.create yes |
---|
53 | startupitem.start "${f2bbindir}/${name}-client start" |
---|
54 | startupitem.stop "${f2bbindir}/${name}-client stop" |
---|
55 | |
---|
56 | destroot.keepdirs ${destroot}${prefix}/var/run/fail2ban |
---|
57 | |
---|
58 | post-destroot { |
---|
59 | # Adding a suffix to config files |
---|
60 | set cfgfiles [concat [glob ${destroot}${f2bconfdir}/*.conf] [glob ${destroot}${f2bconfdir}/action.d/*.conf] [glob ${destroot}${f2bconfdir}/filter.d/*.conf]] |
---|
61 | foreach cfgfile ${cfgfiles} { |
---|
62 | move ${cfgfile} ${cfgfile}.${version} |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | post-activate { |
---|
67 | # If not already present we put default config files |
---|
68 | set cfgfiles [concat [glob ${f2bconfdir}/*.conf.${version}] [glob ${f2bconfdir}/action.d/*.conf.${version}] [glob ${f2bconfdir}/filter.d/*.conf.${version}]] |
---|
69 | foreach cfgfile ${cfgfiles} { |
---|
70 | regsub "\.${version}" ${cfgfile} {} origcfgfile |
---|
71 | if {![file exists ${origcfgfile}]} { |
---|
72 | file copy ${cfgfile} ${origcfgfile} |
---|
73 | } |
---|
74 | } |
---|
75 | } |
---|