Newer
Older
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# This file is part of Mentat system (https://mentat.cesnet.cz/).
#
# Copyright (C) since 2011 CESNET, z.s.p.o (http://www.ces.net/)
# Author: Jan Mach <jan.mach@cesnet.cz>
# Use of this source is governed by the MIT license, see LICENSE file.
#-------------------------------------------------------------------------------
"""
Usage
--------------------------------------------------------------------------------
Install package locally for development:
pip install -e .[dev]
Resources:
--------------------------------------------------------------------------------
* https://packaging.python.org/en/latest/
* https://python-packaging.readthedocs.io/en/latest/index.html
* https://setuptools.readthedocs.io/en/latest/setuptools.html
"""
import sys
import os
# To use a consistent encoding
from codecs import open
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.abspath('lib'))
import mentat
#-------------------------------------------------------------------------------
def read_file(file_name):
"""Read file and return its contents."""
with open(file_name, 'r') as fhd:
return fhd.read()
def read_requirements(file_name):
"""Read requirements file as a list."""
reqs = read_file(file_name).splitlines()
if not reqs:
raise RuntimeError(
"Unable to read requirements from the {} file.".format(
file_name
)
)
reqs = [req.split(' ')[0] for req in reqs]
return reqs
#-------------------------------------------------------------------------------
# Get the long description from the README file
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as fhnd:
long_description = fhnd.read()
setup(
name = 'mentat-ng',
version = mentat.__version__,
description = 'Distributed modular SIEM system designed to monitor networks of all sizes',
long_description = long_description,
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3 :: Only'
],
keywords = 'library',
url = 'https://homeproj.cesnet.cz/git/mentat-ng.git',
author = 'CESNET-CERTS Development Team',
author_email = 'csirt@cesnet.cz',
license = 'MIT',
package_dir = {'': 'lib'},
packages = find_packages('lib'),
test_suite = 'nose.collector',
tests_require = [
'nose'
],
install_requires = read_requirements('conf/requirements.pip'),
# Add development requirements as extras. This way it is possible to install
# the package for development locally with following command:
#
# pip install -e .[dev]
#
# Resources:
# https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
# https://stackoverflow.com/a/28842733
extras_require = {
'dev': read_requirements('conf/requirements-dev.pip'),
},
scripts = [
'bin/mentat-backup.py',
'bin/mentat-cleanup.py',
'bin/mentat-controller.py',
'bin/mentat-dbmngr.py',
'bin/mentat-detmngr.py',
'bin/mentat-enricher.py',
'bin/mentat-hawat.wsgi',
'bin/mentat-hawat-dev.wsgi',
'bin/mentat-ideagen.py',
'bin/mentat-informant.py',
'bin/mentat-inspector.py',
'bin/mentat-netmngr.py',
'bin/mentat-precache.py',
'bin/mentat-reporter.py',
'bin/mentat-sampler.py',
'bin/mentat-statistician.py',
'bin/mentat-storage.py'
],
# Add entry point to custom command line interface.
#
# Resources:
# http://flask.pocoo.org/docs/1.0/cli/#custom-commands
entry_points={
'console_scripts': [
'hawat-cli=hawat:cli'
],
},
include_package_data = True,
zip_safe = False
)