4 Installation script for the geniwrapper module
7 import sys, os, os.path
9 from distutils.core import setup
11 bins = [ 'config/sfa-config-tty',
12 'sfa/plc/sfa-import-plc.py',
13 'sfa/plc/sfa-nuke-plc.py',
14 'sfa/server/sfa-server.py',
16 'sfa/client/getNodes.py',
17 'sfa/client/getRecord.py',
18 'sfa/client/setRecord.py',
19 'sfa/client/genidump.py',
21 remove_bins = [ '/usr/bin/' + os.path.basename(bin) for bin in bins ]
23 package_dirs = [ 'sfa',
31 'sfa/rspecs/aggregates',
32 'sfa/rspecs/aggregates/vini'
34 data_files = [ ('/etc/sfa/', [ 'config/aggregates.xml',
35 'config/registries.xml',
39 ('/etc/init.d/', ['sfa/init.d/sfa']),
41 initscripts = [ '/etc/init.d/sfa' ]
43 if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']:
44 python_path = sys.path
45 site_packages_path = [ path + os.sep + 'sfa' for path in python_path if path.endswith('site-packages')]
46 remove_dirs = ['/etc/sfa/'] + site_packages_path
47 remove_files = remove_bins + 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,