-#!/usr/bin/env python
+#!/usr/bin/env python3
+
-from __future__ import print_function
"""
Installation script for the sfa module
# check for the correct version of python
major, minor = sys.version_info [0:2]
-if (major, minor) != (2, 7):
- print ("Sorry, the SFA package is currently available only with python-2.7")
+if major <= 2:
+ print ("Sorry, this version of SFA package requires python3")
exit(1)
'systemd/sfa-setup.sh',
'sfatables/sfatables',
'keyconvert/keyconvert.py',
- 'flashpolicy/sfa_flashpolicy.py',
]
packages = [
'sfa/rspecs/versions',
'sfa/client',
'sfa/planetlab',
- 'sfa/nitos',
'sfa/dummy',
- 'sfa/openstack',
- 'sfa/federica',
'sfa/iotlab',
'sfatables',
'sfatables/commands',
'sfa/trust/sig.xsd',
'sfa/trust/xml.xsd',
'sfa/trust/protogeni-rspec-common.xsd',
- 'flashpolicy/sfa_flashpolicy_config.xml',
]),
('/etc/sfatables/matches/', glob('sfatables/matches/*.xml')),
('/etc/sfatables/targets/', glob('sfatables/targets/*.xml')),
('/usr/share/sfa/examples/', glob('sfa/examples/*' ) + [ 'cron.d/sfa.cron' ] ),
]
-
+# use /lib/systemd instead of /usr/lib/systemd
+# the latter would work on fedora only, the former
+# will work on both fedora and ubuntu
services = ['sfa-db', 'sfa-aggregate', 'sfa-registry']
data_files.append(
- ('/usr/lib/systemd/system',
+ ('/lib/systemd/system',
['systemd/{}.service'.format(service)
for service in services]))
remove_dirs = ['/etc/sfa/', '/etc/sfatables'] + site_packages_path
remove_bins = [ '/usr/bin/' + os.path.basename(bin) for bin in scripts ]
remove_files = (remove_bins
- + ["/usr/lib/systemd/system/{}".format(x)
+ + ["/lib/systemd/system/{}".format(x)
for x in services])
# remove files