From cf0cf57e7c37613df0d36ba901cb3ca78a7b9286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 12 May 2017 00:16:26 +0200 Subject: [PATCH] Install actual scripts stubs Since core-admin no longer install them, this package finally can provide them without conflicts. --- rpm_spec/qubes-core-admin-client.spec | 2 ++ setup.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/rpm_spec/qubes-core-admin-client.spec b/rpm_spec/qubes-core-admin-client.spec index f3ae2ca..6d08d60 100644 --- a/rpm_spec/qubes-core-admin-client.spec +++ b/rpm_spec/qubes-core-admin-client.spec @@ -61,6 +61,8 @@ make -C doc DESTDIR=$RPM_BUILD_ROOT \ %defattr(-,root,root,-) %doc LICENSE %config /etc/xdg/autostart/qvm-start-gui.desktop +%{_bindir}/qubes-* +%{_bindir}/qvm-* %{_mandir}/man1/qvm-*.1* %{_mandir}/man1/qubes*.1* diff --git a/setup.py b/setup.py index f4194e5..1df7133 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ # vim: fileencoding=utf-8 +import os import setuptools import sys @@ -9,6 +10,18 @@ if sys.version_info[0:2] < (3, 4): if sys.version_info[0:2] < (3, 5): exclude += ['qubesadmin.events'] +# 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(): + if sys.version_info[0:2] >= (3, 4): + for filename in os.listdir('./qubesadmin/tools'): + basename, ext = os.path.splitext(os.path.basename(filename)) + if basename in ['__init__', 'dochelpers'] or ext != '.py': + continue + yield '{} = qubesadmin.tools.{}:main'.format( + basename.replace('_', '-'), basename) + + if __name__ == '__main__': setuptools.setup( name='qubesadmin', @@ -20,6 +33,7 @@ if __name__ == '__main__': url='https://www.qubes-os.org/', packages=setuptools.find_packages(exclude=exclude), entry_points={ + 'console_scripts': list(get_console_scripts()), 'qubesadmin.vm': [ 'AppVM = qubesadmin.vm:AppVM', 'TemplateVM = qubesadmin.vm:TemplateVM',