|
|
|
@ -22,7 +22,13 @@ __author__ = "Cyril Jaquier"
|
|
|
|
|
__copyright__ = "Copyright (c) 2004 Cyril Jaquier" |
|
|
|
|
__license__ = "GPL" |
|
|
|
|
|
|
|
|
|
from distutils.core import setup |
|
|
|
|
try: |
|
|
|
|
import setuptools |
|
|
|
|
from setuptools import setup |
|
|
|
|
except ImportError: |
|
|
|
|
setuptools = None |
|
|
|
|
from distutils.core import setup |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
# python 3.x |
|
|
|
|
from distutils.command.build_py import build_py_2to3 as build_py |
|
|
|
@ -36,7 +42,23 @@ from os.path import isfile, join, isdir
|
|
|
|
|
import sys |
|
|
|
|
from glob import glob |
|
|
|
|
|
|
|
|
|
from fail2ban.version import version |
|
|
|
|
if setuptools and "test" in sys.argv: |
|
|
|
|
import logging |
|
|
|
|
logSys = logging.getLogger("fail2ban") |
|
|
|
|
hdlr = logging.StreamHandler(sys.stdout) |
|
|
|
|
fmt = logging.Formatter("%(asctime)-15s %(message)s") |
|
|
|
|
hdlr.setFormatter(fmt) |
|
|
|
|
logSys.addHandler(hdlr) |
|
|
|
|
if set(["-q", "--quiet"]) & set(sys.argv): |
|
|
|
|
logSys.setLevel(logging.FATAL) |
|
|
|
|
logging.captureWarnings(True) |
|
|
|
|
elif set(["-v", "--verbose"]) & set(sys.argv): |
|
|
|
|
logSys.setLevel(logging.DEBUG) |
|
|
|
|
else: |
|
|
|
|
logSys.setLevel(logging.INFO) |
|
|
|
|
elif "test" in sys.argv: |
|
|
|
|
print("python distribute required to execute fail2ban tests") |
|
|
|
|
print("") |
|
|
|
|
|
|
|
|
|
longdesc = ''' |
|
|
|
|
Fail2Ban scans log files like /var/log/pwdfail or |
|
|
|
@ -45,9 +67,17 @@ too many password failures. It updates firewall rules
|
|
|
|
|
to reject the IP address or executes user defined |
|
|
|
|
commands.''' |
|
|
|
|
|
|
|
|
|
if setuptools: |
|
|
|
|
setup_extra = { |
|
|
|
|
'test_suite': "fail2ban.tests.utils.gatherTests", |
|
|
|
|
'use_2to3': True, |
|
|
|
|
} |
|
|
|
|
else: |
|
|
|
|
setup_extra = {} |
|
|
|
|
|
|
|
|
|
setup( |
|
|
|
|
name = "fail2ban", |
|
|
|
|
version = version, |
|
|
|
|
version = "0.9.0a", |
|
|
|
|
description = "Ban IPs that make too many password failures", |
|
|
|
|
long_description = longdesc, |
|
|
|
|
author = "Cyril Jaquier", |
|
|
|
@ -88,7 +118,8 @@ setup(
|
|
|
|
|
('/usr/share/doc/fail2ban', |
|
|
|
|
['README', 'DEVELOP', 'doc/run-rootless.txt'] |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
**setup_extra |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# Do some checks after installation |
|
|
|
|