forked from OISF/suricata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
69 lines (64 loc) · 2.1 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from __future__ import print_function
import os
import re
import sys
import shutil
from distutils.core import setup
from distutils.command.build_py import build_py
version = None
if os.path.exists("../configure.ac"):
with open("../configure.ac", "r") as conf:
for line in conf:
m = re.search("AC_INIT\(suricata,\s+(\d.+)\)", line)
if m:
version = m.group(1)
break
if version is None:
print("error: failed to parse Suricata version, will use 0.0.0",
file=sys.stderr)
version = "0.0.0"
class do_build(build_py):
def run(self):
build_py.run(self)
defaults_py_out = os.path.join(
self.build_lib, "suricata", "config", "defaults.py")
if not os.path.exists(defaults_py_out):
# Must be an out of tree build, find defaults.py.
defaults_py_in = os.path.join(
self.build_lib, "..", "suricata", "config", "defaults.py")
if os.path.exists(defaults_py_in):
shutil.copy(defaults_py_in, defaults_py_out)
else:
print("error: failed to find defaults.py")
sys.exit(1)
setup(
name="suricata",
description="Suricata control tools",
version=version,
author='OISF Developers, Eric Leblond',
author_email='[email protected], [email protected]',
url='https://www.suricata-ids.org/',
packages=[
"suricata",
"suricata.config",
"suricata.ctl",
"suricata.sc",
"suricatasc",
],
scripts=[
"bin/suricatactl",
"bin/suricatasc",
],
provides=['suricatactl', 'suricatasc'],
requires=['argparse','simplejson'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: System :: Systems Administration',
],
cmdclass={'build_py': do_build},
)