X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=setup.py;h=412b401016c36481b366d5239e3050b76620ce50;hb=f27128bd33db08114f264c4028ae667c962b64c5;hp=770dace7f5c797eb5a3ff2e1d80cdcaa626e58c4;hpb=74d9063333e7f5f4cd699ef574915e2f4ff204e9;p=sfa.git diff --git a/setup.py b/setup.py index 770dace7..412b4010 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 + -from __future__ import print_function """ Installation script for the sfa module @@ -32,10 +32,9 @@ scripts = glob("clientbin/*.py") + [ 'config/sfa-config-tty', 'config/sfa-config', 'sfa/server/sfa-start.py', - 'systemd/sfa-db-init.sh', + 'systemd/sfa-setup.sh', 'sfatables/sfatables', 'keyconvert/keyconvert.py', - 'flashpolicy/sfa_flashpolicy.py', ] packages = [ @@ -54,10 +53,7 @@ packages = [ 'sfa/rspecs/versions', 'sfa/client', 'sfa/planetlab', - 'sfa/nitos', 'sfa/dummy', - 'sfa/openstack', - 'sfa/federica', 'sfa/iotlab', 'sfatables', 'sfatables/commands', @@ -78,7 +74,6 @@ data_files = [ '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')), @@ -87,18 +82,12 @@ data_files = [ ('/usr/share/sfa/examples/', glob('sfa/examples/*' ) + [ 'cron.d/sfa.cron' ] ), ] - -initscripts = [ 'sfa' ] -if not os.path.isfile('/etc/redhat-release'): - initscripts.append('functions.sfa') -data_files.append( - ('/etc/init.d/', - [ "init.d/%s"%x for x in initscripts ])) - - +# 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])) @@ -122,9 +111,7 @@ if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']: 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 - + ["/etc/init.d/{}}".format(x) - for x in initscripts ] - + ["/usr/lib/systemd/system/{}".format(x) + + ["/lib/systemd/system/{}".format(x) for x in services]) # remove files