-bins = [ 'config/sfa-config-tty',
- 'sfa/plc/sfa-import-plc.py',
- 'sfa/plc/sfa-nuke-plc.py',
- 'sfa/server/sfa-server.py',
- 'sfa/server/sfa-clean-peer-records.py',
- 'sfa/client/sfi.py',
- 'sfa/client/getNodes.py',
- 'sfa/client/getRecord.py',
- 'sfa/client/setRecord.py',
- 'sfa/client/genidump.py',
- 'sfatables/sfatables',
- ]
-
-package_dirs = [ 'sfa',
- 'sfa/client',
- 'sfa/methods',
- 'sfa/plc',
- 'sfa/server',
- 'sfa/trust',
- 'sfa/util',
- 'sfa/managers',
- 'sfa/rspecs',
- 'sfa/rspecs/aggregates',
- 'sfa/rspecs/aggregates/vini',
- 'sfatables',
- 'sfatables/commands',
- 'sfatables/processors',
- ]
-
-
-data_files = [('/etc/sfa/', [ 'config/aggregates.xml',
- 'config/registries.xml',
- 'config/default_config.xml',
- 'config/sfi_config']),
- ('/etc/sfatables/matches/', glob('sfatables/matches/*.xml')),
- ('/etc/sfatables/targets/', glob('sfatables/targets/*.xml')),
- ('/etc/init.d/', ['sfa/init.d/sfa'])]
-
-# add sfatables processors as data_files
-processor_files = [f for f in glob('sfatables/processors/*') if os.path.isfile(f)]
+# check for the correct version of python
+major, minor = sys.version_info [0:2]
+if major <= 2:
+ print ("Sorry, this version of SFA package requires python3")
+ exit(1)
+
+
+# while cleaning up we might not have this..
+try:
+ from sfa.util.version import version_tag
+except:
+ version_tag='cleaningup'
+
+scripts = glob("clientbin/*.py") + [
+ 'config/sfa-config-tty',
+ 'config/sfa-config',
+ 'sfa/server/sfa-start.py',
+ 'systemd/sfa-setup.sh',
+ 'sfatables/sfatables',
+ 'keyconvert/keyconvert.py',
+]
+
+packages = [
+ 'sfa',
+ 'sfa/trust',
+ 'sfa/storage',
+ 'sfa/util',
+ 'sfa/server',
+ 'sfa/methods',
+ 'sfa/generic',
+ 'sfa/managers',
+ 'sfa/importer',
+ 'sfa/rspecs',
+ 'sfa/rspecs/elements',
+ 'sfa/rspecs/elements/versions',
+ 'sfa/rspecs/versions',
+ 'sfa/client',
+ 'sfa/planetlab',
+ 'sfa/dummy',
+ 'sfa/iotlab',
+ 'sfatables',
+ 'sfatables/commands',
+ 'sfatables/processors',
+ ]
+
+data_files = [
+ ('/etc/sfa/',
+ [ 'config/aggregates.xml',
+ 'config/registries.xml',
+ 'config/default_config.xml',
+ 'config/api_versions.xml',
+ 'config/sfi_config',
+ 'config/topology',
+ 'sfa/managers/pl/pl.rng',
+ 'sfa/trust/credential.xsd',
+ 'sfa/trust/top.xsd',
+ 'sfa/trust/sig.xsd',
+ 'sfa/trust/xml.xsd',
+ 'sfa/trust/protogeni-rspec-common.xsd',
+ ]),
+ ('/etc/sfatables/matches/', glob('sfatables/matches/*.xml')),
+ ('/etc/sfatables/targets/', glob('sfatables/targets/*.xml')),
+ ('/usr/share/sfa/migrations', glob('sfa/storage/migrations/*.*') ),
+ ('/usr/share/sfa/migrations/versions', glob('sfa/storage/migrations/versions/*') ),
+ ('/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(
+ ('/lib/systemd/system',
+ ['systemd/{}.service'.format(service)
+ for service in services]))
+
+
+# sfatables processors
+processor_files = [f for f in glob('sfatables/processors/*')
+ if os.path.isfile(f)]