4 Installation script for the geniwrapper module
9 from distutils.core import setup
11 scripts = [ 'config/sfa-config-tty',
12 'geni/sfa-import-plc.py',
15 'cmdline/getNodes.py',
16 'cmdline/getRecord.py',
17 'cmdline/setRecord.py',
18 'cmdline/genidump.py',
20 package_dirs = [ 'geni',
24 data_files = [ ('/etc/sfa/', [ 'config/aggregates.xml',
25 'config/registries.xml',
29 ('/etc/init.d/', ['geni/init.d/sfa']),
30 ('/var/www/html/wsdl', [ 'wsdl/sfa.wsdl' ] ),
32 symlinks = [ '/usr/share/geniwrapper' ]
33 initscripts = [ '/etc/init.d/geni' ]
35 if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']:
36 python_path = sys.path
37 site_packages_path = [ path + os.sep + 'geni' for path in python_path if path.endswith('site-packages')]
38 remove_dirs = ['/etc/sfa/'] + site_packages_path
39 remove_files = [ '/usr/bin/sfa-config-tty',
40 '/usr/bin/sfa-import-plc.py',
41 '/usr/bin/sfa-plc.py',
43 '/usr/bin/getNodes.py',
44 '/usr/bin/getRecord.py',
45 '/usr/bin/setRecord.py',
46 '/usr/bin/genidump.py',
47 ] + symlinks + initscripts
50 for filepath in remove_files:
51 print "removing", filepath, "...",
55 except: print "failed"
57 for directory in remove_dirs:
58 print "removing", directory, "...",
60 shutil.rmtree(directory)
62 except: print "failed"
66 # avoid repeating what's in the specfile already
68 packages = package_dirs,
69 data_files = data_files,
75 # create symlink to geniwrapper source in /usr/share
76 python_path = sys.path
77 site_packages_path = [ path + os.sep + 'geni' for path in python_path if path.endswith('site-packages')]
78 # python path usualy has /usr/local/lib/ path , filter this out
79 site_packages_path = [x for x in site_packages_path if 'local' not in x]
81 # we can not do this here as installation root might change paths
84 # for src in site_packages_path:
85 # for dst in symlinks:
87 # os.symlink(src, dst)
89 # for initscript in initscripts:
90 # os.chmod(initscript, 00744)