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'
33 data_files = [ ('/etc/sfa/', [ 'config/aggregates.xml',
34 'config/registries.xml',
38 ('/etc/init.d/', ['sfa/init.d/sfa']),
40 initscripts = [ '/etc/init.d/sfa' ]
42 if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']:
43 python_path = sys.path
44 site_packages_path = [ path + os.sep + 'sfa' for path in python_path if path.endswith('site-packages')]
45 remove_dirs = ['/etc/sfa/'] + site_packages_path
46 remove_files = remove_bins + initscripts
49 for filepath in remove_files:
50 print "removing", filepath, "...",
54 except: print "failed"
56 for directory in remove_dirs:
57 print "removing", directory, "...",
59 shutil.rmtree(directory)
61 except: print "failed"
65 # avoid repeating what's in the specfile already
67 packages = package_dirs,
68 data_files = data_files,