Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 627870 - net-analyzer/fail2ban-0.10.1 version bump
Summary: net-analyzer/fail2ban-0.10.1 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-08-14 18:35 UTC by Joe
Modified: 2019-03-27 10:32 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch series (fail2ban-0.10.1.patch,4.68 KB, patch)
2017-12-26 17:40 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe 2017-08-14 18:35:22 UTC
https://github.com/fail2ban/fail2ban/releases/tag/0.10.0

IPv6 support for fail2ban

Thank you.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2017-08-14 19:13:38 UTC
There are some problems running the new code with python3.4 so that needs to be resolved upstream before we can add the ebuild.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2017-08-14 19:14:28 UTC
writing byte-compilation script '/home/jer/portage/net-analyzer/fail2ban-0.10.0/temp/tmpha_3qkx_.py'
/usr/bin/python3.4 -OO /home/jer/portage/net-analyzer/fail2ban-0.10.0/temp/tmpha_3qkx_.py
  File "/usr/lib64/python3.4/site-packages/fail2ban/server/ipdns.py", line 272
    mask = ~(0xFFFFFFFFL >> cidr)
                       ^
SyntaxError: invalid syntax

  File "/usr/lib64/python3.4/site-packages/fail2ban/server/server.py", line 99
    os.umask(0077)
                ^
SyntaxError: invalid token

  File "/usr/lib64/python3.4/site-packages/fail2ban/tests/filtertestcase.py", line 1385
    % m for m in 53, 54, 57, 58])
                   ^
SyntaxError: invalid syntax

  File "/usr/lib64/python3.4/site-packages/fail2ban/tests/misctestcase.py", line 193
    print deep_function(3)
                      ^
SyntaxError: invalid syntax

removing /home/jer/portage/net-analyzer/fail2ban-0.10.0/temp/tmpha_3qkx_.py
Comment 3 Louis Sautier (sbraz) gentoo-dev 2017-09-10 19:58:17 UTC
I don't think the code is supposed to be Python3-compatible since their travis build runs "./fail2ban-2to3" before setup.py for Python 3.
If we run 2to3 during python_prepare_all, the build completes without any errors with Python 3.4, 3.5 and 3.6.
Comment 4 Nico Baggus 2017-12-04 03:28:45 UTC
there are some enumeration that still use v2 naming (thus are different.)

 * Starting fail2ban ...
Traceback (most recent call last):
  File "/usr/bin/fail2ban-client", line 34, in <module>
    from fail2ban.client.fail2banclient import exec_command_line, sys
  File "/usr/lib/python3.5/site-packages/fail2ban/client/fail2banclient.py", line 39, in <module>
    from ..server.utils import Utils
  File "/usr/lib/python3.5/site-packages/fail2ban/server/utils.py", line 54, in <module>
    for name, num in signal.__dict__.iteritems() if name.startswith("SIG"))
AttributeError: 'dict' object has no attribute 'iteritems'
 * start-stop-daemon: failed to start `/usr/bin/fail2ban-client'
 * Failed to start fail2ban                                                                                                                                    [ !! ]
 * ERROR: fail2ban failed to start

fixing this ends with another ...
..

fail2ban works when the following useflags are in effect:
(all on one line in package.use)

net-analyzer/fail2ban -python_single_target_python3_5 -python_single_target_python3_4  python_single_target_python2_7
Comment 5 Nico Baggus 2017-12-04 21:09:40 UTC
renaming fail2ban-0.9.7.ebuild to fail2ban-0.10.ebuild fails
here:

old:
python_install_all() {
        distutils-r1_python_install_all

        rm -rf "${D}"/usr/share/doc/${PN} "${D}"/run || die

        # not FILESDIR
        newconfd files/gentoo-confd ${PN}
        newinitd files/gentoo-initd ${PN}
        systemd_dounit files/${PN}.service      #<--- fails here on non-systemd
        systemd_dotmpfilesd files/${PN}-tmpfiles.conf
        doman man/*.{1,5}

        # Use INSTALL_MASK  if you do not want to touch /etc/logrotate.d.
        # See http://thread.gmane.org/gmane.linux.gentoo.devel/35675
        insinto /etc/logrotate.d
        newins files/${PN}-logrotate ${PN}
}

after change into:
python_install_all() {
        distutils-r1_python_install_all

        rm -rf "${D}"/usr/share/doc/${PN} "${D}"/run || die

        # not FILESDIR
        newconfd files/gentoo-confd ${PN}
        newinitd files/gentoo-initd ${PN}
        if use systemd ; 
        then
            systemd_dounit files/${PN}.service
            systemd_dotmpfilesd files/${PN}-tmpfiles.conf
        fi
        doman man/*.{1,5}

        # Use INSTALL_MASK  if you do not want to touch /etc/logrotate.d.
        # See http://thread.gmane.org/gmane.linux.gentoo.devel/35675
        insinto /etc/logrotate.d
        newins files/${PN}-logrotate ${PN}
}

Does install (& work) on a non-systemd and is a LOT faster during shutdown and startup (difference of 30+ minutes wait during shutdown vs. a few seconds).
Comment 6 Leho Kraav (:macmaN @lkraav) 2017-12-24 06:06:46 UTC
Curious, is `python_targets_python3_6` also in the cards here?
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2017-12-26 14:18:02 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #6)
> Curious, is `python_targets_python3_6` also in the cards here?

Sure, probably as soon as someone figures out how python eclasses are supposed to be used. Which is why NeedPatch and why python@ is CC'd.
Comment 8 Mike Gilbert gentoo-dev 2017-12-26 16:49:22 UTC
(In reply to Jeroen Roovers from comment #7)

I'll take a look. At a first glance, I can't determine why the fail2ban devs have reinvented the 2to3 functionality that ships with setuptools...
Comment 9 Mike Gilbert gentoo-dev 2017-12-26 17:40:15 UTC
Created attachment 511676 [details, diff]
Patch series

Here's a patch series to resolve the obvious issues and to add python3_6.

Also available as a PR on github.
Comment 10 Mike Gilbert gentoo-dev 2017-12-26 17:45:41 UTC
> Which is why NeedPatch and why python@ is CC'd.

The python mail alias gets a LOT of email; if you would like us to look at something, a ping in #gentoo-python is usually more effective.
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2017-12-27 11:02:40 UTC
(In reply to Mike Gilbert from comment #10)
> > Which is why NeedPatch and why python@ is CC'd.

Apparently doing this in a single submission isn't very visible:

"""
Jeroen Roovers 2017-09-11 00:15:17 CEST
CC: python@gentoo.org
Keywords: NeedPatch
"""

> The python mail alias gets a LOT of email; if you would like us to look at
> something, a ping in #gentoo-python is usually more effective.

I'm sorry about that.
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2017-12-27 11:10:46 UTC
Comment on attachment 511676 [details, diff]
Patch series

Thanks.
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2017-12-27 11:28:24 UTC
Fixed. Thanks everyone.