2017-01-20 12:40:00 +01:00
|
|
|
#!/usr/bin/python3 -O
|
2015-09-28 17:44:59 +02:00
|
|
|
# vim: fileencoding=utf-8
|
|
|
|
|
|
|
|
import os
|
2016-03-20 20:29:46 +01:00
|
|
|
|
2015-09-28 17:44:59 +02:00
|
|
|
import setuptools
|
2018-01-18 22:13:37 +01:00
|
|
|
import setuptools.command.install
|
2015-09-28 17:44:59 +02:00
|
|
|
|
2016-03-20 20:29:46 +01:00
|
|
|
|
2015-09-28 17:44:59 +02:00
|
|
|
# don't import: import * is unreliable and there is no need, since this is
|
|
|
|
# compile time and we have source files
|
|
|
|
def get_console_scripts():
|
2018-01-18 22:13:37 +01:00
|
|
|
yield 'qrexec-policy', 'qubespolicy.cli'
|
|
|
|
yield 'qrexec-policy-agent', 'qubespolicy.agent'
|
|
|
|
yield 'qrexec-policy-graph', 'qubespolicy.graph'
|
2015-09-28 17:44:59 +02:00
|
|
|
for filename in os.listdir('./qubes/tools'):
|
|
|
|
basename, ext = os.path.splitext(os.path.basename(filename))
|
|
|
|
if basename == '__init__' or ext != '.py':
|
|
|
|
continue
|
2018-01-18 22:13:37 +01:00
|
|
|
yield basename.replace('_', '-'), 'qubes.tools.{}'.format(basename)
|
2015-09-28 17:44:59 +02:00
|
|
|
|
2018-01-18 22:13:37 +01:00
|
|
|
# create simple scripts that run much faster than "console entry points"
|
|
|
|
class CustomInstall(setuptools.command.install.install):
|
|
|
|
def run(self):
|
|
|
|
bin = os.path.join(self.root, "usr/bin")
|
|
|
|
try:
|
|
|
|
os.makedirs(bin)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
for file, pkg in get_console_scripts():
|
|
|
|
path = os.path.join(bin, file)
|
|
|
|
with open(path, "w") as f:
|
|
|
|
f.write(
|
|
|
|
"""#!/usr/bin/python3
|
|
|
|
from {} import main
|
|
|
|
import sys
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|
|
|
|
""".format(pkg))
|
|
|
|
|
|
|
|
os.chmod(path, 0o755)
|
|
|
|
setuptools.command.install.install.run(self)
|
2016-03-20 20:29:46 +01:00
|
|
|
|
2015-09-28 17:44:59 +02:00
|
|
|
if __name__ == '__main__':
|
|
|
|
setuptools.setup(
|
|
|
|
name='qubes',
|
|
|
|
version=open('version').read().strip(),
|
|
|
|
author='Invisible Things Lab',
|
|
|
|
author_email='woju@invisiblethingslab.com',
|
|
|
|
description='Qubes core package',
|
|
|
|
license='GPL2+',
|
|
|
|
url='https://www.qubes-os.org/',
|
|
|
|
packages=setuptools.find_packages(exclude=('core*', 'tests')),
|
2017-03-24 01:44:52 +01:00
|
|
|
package_data = {
|
|
|
|
'qubespolicy': ['glade/*.glade'],
|
|
|
|
},
|
2018-01-18 22:13:37 +01:00
|
|
|
cmdclass={
|
|
|
|
'install': CustomInstall,
|
|
|
|
},
|
2015-09-28 17:44:59 +02:00
|
|
|
entry_points={
|
2016-03-04 13:03:43 +01:00
|
|
|
'qubes.vm': [
|
|
|
|
'AppVM = qubes.vm.appvm:AppVM',
|
|
|
|
'TemplateVM = qubes.vm.templatevm:TemplateVM',
|
2016-03-13 12:43:26 +01:00
|
|
|
'StandaloneVM = qubes.vm.standalonevm:StandaloneVM',
|
2016-03-04 13:03:43 +01:00
|
|
|
'AdminVM = qubes.vm.adminvm:AdminVM',
|
2016-05-20 03:58:57 +02:00
|
|
|
'DispVM = qubes.vm.dispvm:DispVM',
|
2016-03-04 13:03:43 +01:00
|
|
|
],
|
|
|
|
'qubes.ext': [
|
2017-06-14 11:47:52 +02:00
|
|
|
'qubes.ext.admin = qubes.ext.admin:AdminExtension',
|
2017-06-12 12:22:39 +02:00
|
|
|
'qubes.ext.core_features = qubes.ext.core_features:CoreFeatures',
|
2016-03-04 13:03:43 +01:00
|
|
|
'qubes.ext.qubesmanager = qubes.ext.qubesmanager:QubesManager',
|
2016-03-05 10:57:58 +01:00
|
|
|
'qubes.ext.gui = qubes.ext.gui:GUI',
|
2016-03-07 01:32:40 +01:00
|
|
|
'qubes.ext.r3compatibility = qubes.ext.r3compatibility:R3Compatibility',
|
2016-09-03 02:16:28 +02:00
|
|
|
'qubes.ext.pci = qubes.ext.pci:PCIDeviceExtension',
|
2017-05-29 21:20:06 +02:00
|
|
|
'qubes.ext.block = qubes.ext.block:BlockDeviceExtension',
|
2017-08-14 02:30:52 +02:00
|
|
|
'qubes.ext.services = qubes.ext.services:ServicesExtension',
|
2016-03-04 13:03:43 +01:00
|
|
|
],
|
2016-03-17 13:06:13 +01:00
|
|
|
'qubes.devices': [
|
2016-09-03 02:16:28 +02:00
|
|
|
'pci = qubes.ext.pci:PCIDevice',
|
2017-05-29 21:20:06 +02:00
|
|
|
'block = qubes.ext.block:BlockDevice',
|
2016-06-26 04:07:15 +02:00
|
|
|
'testclass = qubes.tests.devices:TestDevice',
|
2016-03-17 13:06:13 +01:00
|
|
|
],
|
2016-03-20 20:29:46 +01:00
|
|
|
'qubes.storage': [
|
2016-04-30 20:42:46 +02:00
|
|
|
'file = qubes.storage.file:FilePool',
|
2016-04-01 15:10:44 +02:00
|
|
|
'linux-kernel = qubes.storage.kernels:LinuxKernel',
|
2016-07-12 18:44:05 +02:00
|
|
|
'lvm_thin = qubes.storage.lvm:ThinPool',
|
2017-04-26 01:01:52 +02:00
|
|
|
],
|
|
|
|
'qubes.tests.storage': [
|
|
|
|
'test = qubes.tests.storage:TestPool',
|
|
|
|
'file = qubes.storage.file:FilePool',
|
|
|
|
'linux-kernel = qubes.storage.kernels:LinuxKernel',
|
|
|
|
'lvm_thin = qubes.storage.lvm:ThinPool',
|
|
|
|
],
|
2016-03-20 20:29:46 +01:00
|
|
|
})
|