-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
86 lines (71 loc) · 2.13 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import os
import subprocess
import setuptools
from setuptools.command.install import install
from setuptools.command.develop import develop
from setuptools.command.egg_info import egg_info
with open('README.md', 'r') as fh:
long_description = fh.read()
data_files = []
if os.getuid() == 0: # Installation as superuser
data_files = [
('/etc/bash_completion.d/', ['extra/completions/bash/pallium']),
('/etc/pallium/profiles', [])
]
def build_helpers():
project_root = os.path.dirname(os.path.abspath(__file__))
gvisor_init_dir = os.path.join(project_root, 'pallium/gvisor-init')
subprocess.check_call(['make'], cwd=gvisor_init_dir)
class PalliumInstall(install):
def run(self):
build_helpers()
install.run(self)
class PalliumDevelop(develop):
def run(self):
build_helpers()
develop.run(self)
class PalliumEggInfo(egg_info):
def run(self):
build_helpers()
egg_info.run(self)
setuptools.setup(
name='pallium-sandbox',
version='0.1.0dev',
author='B. Blechschmidt',
author_email='[email protected]',
description='Linux Network and Security Sandbox',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/blechschmidt/pallium',
packages=setuptools.find_packages(),
data_files=data_files,
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
'Topic :: Internet :: Proxy Servers',
'Topic :: Security',
'Topic :: System :: Networking',
'Topic :: Utilities'
],
entry_points={
'console_scripts': ['pallium=pallium.cmd:main']
},
install_requires=[
'pyroute2',
'pyseccomp',
],
python_requires='>=3.6.0',
package_data={
'pallium': [
'gvisor-init/gvisor-init'
]
},
include_package_data=True,
cmdclass={
'install': PalliumInstall,
'egg_info': PalliumEggInfo,
'develop': PalliumDevelop
}
)