From 1ee0e6953aae9047d995ca25f9e8c1ab4cbc4777 Mon Sep 17 00:00:00 2001 From: sezanzeb Date: Sun, 29 Nov 2020 10:42:20 +0100 Subject: [PATCH] wip debian package --- MANIFEST.in | 4 ++++ README.md | 6 ++---- build.sh | 13 +++++++++++++ deb/DEBIAN/control | 6 ++++++ keymapper/dev/injector.py | 2 +- setup.py | 26 ++++++++++++++++++++++---- 6 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 MANIFEST.in create mode 100755 build.sh create mode 100644 deb/DEBIAN/control diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..3ac1fc46 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +# for `python3 setup.py sdist` +recursive-include data * +include bin/key-mapper-gtk +include bin/key-mapper-service diff --git a/README.md b/README.md index 25aea50e..22802ed0 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@

-

- -

+


## Usage @@ -56,7 +54,7 @@ usermod -a -G plugdev $USER Depending on how those packages are called in your distro, you need the following dependencies: -`python3-distutils-extra` `python3-evdev` `python3-dbus` +`python3-evdev` `python3-dbus` It works with both Wayland and X11. diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..c0be4c7d --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# build the .deb and .appimage files +# https://ubuntuforums.org/showthread.php?t=1002909 +dist=dist +name=key-mapper-0.1.0 + +python3 setup.py sdist --dist-dir $dist +tar -C deb -xzf $dist/$name.tar.gz +cp $dist/DEBIAN $dist/$name -r +dpkg-deb -b $dist/$name $name.deb +rm $dist/$name -r + diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control new file mode 100644 index 00000000..1a4ac411 --- /dev/null +++ b/deb/DEBIAN/control @@ -0,0 +1,6 @@ +Package: key-mapper +Version: 0.1.0 +Architecture: all +Maintainer: Sezanzeb +Depends: python3, python3-setuptools, python3-evdev, python3-dbus +Description: A tool to change the mapping of your input device buttons diff --git a/keymapper/dev/injector.py b/keymapper/dev/injector.py index 8685ad32..0dbf16b8 100644 --- a/keymapper/dev/injector.py +++ b/keymapper/dev/injector.py @@ -245,7 +245,7 @@ class KeycodeInjector: logger.debug('Parsing macros') macros = {} for keycode, output in self.mapping: - if '(' in output and ')' in output and len(output) > 4: + if '(' in output and ')' in output and len(output) >= 4: # probably a macro macros[keycode] = parse( output, diff --git a/setup.py b/setup.py index c4c0ea77..14afb778 100644 --- a/setup.py +++ b/setup.py @@ -19,16 +19,34 @@ # along with key-mapper. If not, see . -import DistUtilsExtra.auto +import glob +from setuptools import setup +with open('README.md', 'r') as f: + long_description = f.read() -DistUtilsExtra.auto.setup( +setup( name='key-mapper', version='0.1.0', - description='GUI for device specific keyboard mappings', + description='A tool to change the mapping of your input device buttons', + author='Sezanzeb', + author_email='proxima@hip70890b.de', + url='https://github.com/sezanzeb/key-mapper', license='GPL-3.0', + packages=[ + 'keymapper', + 'keymapper.dev', + 'keymapper.gtk' + ], data_files=[ + ('share/key-mapper/', glob.glob('data/*')), ('share/applications/', ['data/key-mapper.desktop']), ('/etc/xdg/autostart/', ['data/key-mapper-service.desktop']), - ] + ], + scripts=[ + 'bin/key-mapper-gtk', + 'bin/key-mapper-service' + ], + long_description=long_description, + long_description_content_type='text/markdown' )