forked from wifiphisher/roguehostapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (63 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
"""
Module for setup hostapd shared library
"""
import shutil
try:
from setuptools import setup
from setuptools.command.install import install
except ImportError:
from distutils.core import setup
from distutils.command.install import install
from distutils.command.build_ext import build_ext
import roguehostapd.buildutil.buildcommon as buildcommon
import roguehostapd.buildutil.buildexception as buildexception
from roguehostapd.config.hostapdconfig import WHITE, RED
# define project information
NAME = 'roguehostapd'
PACKAGES = ['roguehostapd',
'examples',
'roguehostapd.config',
'roguehostapd.buildutil']
PACKAGE_DIR = {'roguehostapd': 'roguehostapd'}
PACKAGE_DATA = {'roguehostapd': ['config/hostapd.conf', 'config/config.ini']}
VERSION = '1.1.2'
DESCRIPTION = 'Hostapd wrapper for hostapd'
URL = 'https://github.com/wifiphisher/roguehostapd'
AUTHOR = 'Anakin'
try:
EXT_MODULE = buildcommon.get_extension_module()
with buildcommon.nostdout():
setup(
name=NAME,
packages=PACKAGES,
package_dir=PACKAGE_DIR,
package_data=PACKAGE_DATA,
version=VERSION,
description=DESCRIPTION,
url=URL,
author=AUTHOR,
zip_safe=False,
cmdclass={'build_ext': build_ext,
'install': install},
ext_modules=EXT_MODULE
)
except buildexception.SharedLibMissError as exobj:
print ("[" + RED + "!" + WHITE + "] " +
("The development package for " + exobj.libname +
" is missing. Please download it and restart the compilation."
"If you are on Debian-based system: \'apt-get install{}\'.".format(
"".join(" " + package for package in exobj.packages))))
with buildcommon.nostdout():
setup(
name=NAME,
packages=PACKAGES,
package_dir=PACKAGE_DIR,
package_data=PACKAGE_DATA,
version=VERSION,
description=DESCRIPTION,
zip_safe=False,
url=URL,
author=AUTHOR,
)
finally:
shutil.rmtree('tmp')