-
Notifications
You must be signed in to change notification settings - Fork 68
/
setup.py
57 lines (54 loc) · 1.74 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
"""
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()
setup(
name=NAME,
packages=PACKAGES,
package_dir=PACKAGE_DIR,
package_data=PACKAGE_DATA,
version=VERSION,
description=DESCRIPTION,
url=URL,
author=AUTHOR,
install_requires=[],
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))))
finally:
shutil.rmtree('tmp')