forked from kilda/MaxiNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
47 lines (45 loc) · 1.65 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
import sys, os, subprocess,distutils
from setuptools import setup, find_packages
setup(name='MaxiNet',
version='1.0',
description='Distributed Software Defined Network Emulation',
long_description="MaxiNet extends the famous Mininet emulation environment to span the emulation across several physical machines. This allows to emulate very large SDN networks.",
classifiers=[
'Programming Language :: Python :: 2.7',
],
keywords='mininet MaxiNet SDN Network OpenFlow openvswitch',
url='https://www.cs.uni-paderborn.de/?id=maxinet',
author_email='maxinet@lists.upb.de',
packages=find_packages(),
install_requires=[
'Pyro4',
],
include_package_data=True,
package_data={
"MaxiNet":["Scripts/*"],
},
entry_points={
'console_scripts': [
'MaxiNetWorker = MaxiNet.WorkerServer.server:main',
'MaxiNetFrontendServer = MaxiNet.FrontendServer.server:main',
'MaxiNetStatus = MaxiNet.WorkerServer.server:getFrontendStatus',
]
},
zip_safe=False)
if((__name__=="__main__") and (sys.argv[1] == "install")):
# We need to make package_data files executable...
# Ugly hack:
fn = os.tempnam() # need file in different folder as local subfolder MaxiNet would be used otherwise
f = open(fn,"w")
f.write("""
import os,subprocess
print "Setting executable bits..."
from MaxiNet.tools import Tools
d = Tools.get_script_dir()
for f in filter(lambda x: x[-3:]==".sh",os.listdir(d)):
print f
subprocess.call(["sudo","chmod","a+x",d+f])
""")
f.close()
subprocess.call(["python",fn])
os.remove(fn)