2016-09-12 05:22:53 +02:00
|
|
|
# vim: fileencoding=utf-8
|
|
|
|
|
2020-01-23 14:25:54 +01:00
|
|
|
import os
|
|
|
|
|
2016-09-12 05:22:53 +02:00
|
|
|
import setuptools
|
2020-01-23 14:25:54 +01:00
|
|
|
import setuptools.command.install
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
|
|
CONSOLE_SCRIPTS = [
|
|
|
|
('qubes-firewall', 'qubesagent.firewall'),
|
|
|
|
('qubes-vmexec', 'qubesagent.vmexec'),
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# 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 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-09-12 05:22:53 +02:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
setuptools.setup(
|
|
|
|
name='qubesagent',
|
|
|
|
version=open('version').read().strip(),
|
|
|
|
author='Invisible Things Lab',
|
|
|
|
author_email='marmarek@invisiblethingslab.com',
|
|
|
|
description='Qubes core-agent-linux package',
|
|
|
|
license='GPL2+',
|
|
|
|
url='https://www.qubes-os.org/',
|
|
|
|
|
|
|
|
packages=('qubesagent',),
|
|
|
|
|
2020-01-23 14:25:54 +01:00
|
|
|
cmdclass={
|
|
|
|
'install': CustomInstall,
|
|
|
|
},
|
2016-09-12 05:22:53 +02:00
|
|
|
)
|