Install actual scripts stubs

Since core-admin no longer install them, this package finally can
provide them without conflicts.
This commit is contained in:
Marek Marczykowski-Górecki 2017-05-12 00:16:26 +02:00
parent 6c47765884
commit cf0cf57e7c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 16 additions and 0 deletions

View File

@ -61,6 +61,8 @@ make -C doc DESTDIR=$RPM_BUILD_ROOT \
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc LICENSE %doc LICENSE
%config /etc/xdg/autostart/qvm-start-gui.desktop %config /etc/xdg/autostart/qvm-start-gui.desktop
%{_bindir}/qubes-*
%{_bindir}/qvm-*
%{_mandir}/man1/qvm-*.1* %{_mandir}/man1/qvm-*.1*
%{_mandir}/man1/qubes*.1* %{_mandir}/man1/qubes*.1*

View File

@ -1,5 +1,6 @@
# vim: fileencoding=utf-8 # vim: fileencoding=utf-8
import os
import setuptools import setuptools
import sys import sys
@ -9,6 +10,18 @@ if sys.version_info[0:2] < (3, 4):
if sys.version_info[0:2] < (3, 5): if sys.version_info[0:2] < (3, 5):
exclude += ['qubesadmin.events'] 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__': if __name__ == '__main__':
setuptools.setup( setuptools.setup(
name='qubesadmin', name='qubesadmin',
@ -20,6 +33,7 @@ if __name__ == '__main__':
url='https://www.qubes-os.org/', url='https://www.qubes-os.org/',
packages=setuptools.find_packages(exclude=exclude), packages=setuptools.find_packages(exclude=exclude),
entry_points={ entry_points={
'console_scripts': list(get_console_scripts()),
'qubesadmin.vm': [ 'qubesadmin.vm': [
'AppVM = qubesadmin.vm:AppVM', 'AppVM = qubesadmin.vm:AppVM',
'TemplateVM = qubesadmin.vm:TemplateVM', 'TemplateVM = qubesadmin.vm:TemplateVM',