forked from tuomasjjrasanen/python-uinput
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
73 lines (65 loc) · 2.61 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -*- coding: utf-8 -*-
import errno
import subprocess
from distutils.core import setup, Extension
libudev_so = "libudev.so.1"
# Because libsuinput can be linked against both libudev.so.0 and
# libudev.so.1, we try to use ldconfig to find out which one is
# available. Preferably libudev.so.1.
try:
ldconfig_output = subprocess.check_output(["ldconfig", "-p"])
for line in ldconfig_output.splitlines():
try:
lib = line.split()[0]
except IndexError:
# An unexpected line, but let's proceed.
continue
if lib == "libudev.so.0":
libudev_so = lib
# We are quite happy, but let's look if there's something
# better.
if lib == "libudev.so.1":
libudev_so = lib
break # We are really happy, no reason to look further.
except:
# We don't care if something goes wrong while we scan through all
# the available libraries. The whole scan operation is just
# best-effort, we can always fall back to the default, hard-coded,
# library.
pass
setup(name='python-uinput',
version='0.11.2',
description='Pythonic API to Linux uinput kernel module.',
author='Tuomas Räsänen',
author_email='tuomasjjrasanen@tjjr.fi',
url='http://tjjr.fi/sw/python-uinput/',
package_dir={'uinput': 'src'},
packages=['uinput'],
license='GPLv3+',
platforms=['Linux'],
download_url='http://tjjr.fi/sw/python-uinput/releases/python-uinput-0.11.2.tar.gz',
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: POSIX :: Linux",
"Topic :: System :: Operating System Kernels :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.4",
],
long_description="""
Python-uinput is Python interface to Linux uinput kernel module which
allows attaching userspace device drivers into kernel. In practice,
Python-uinput makes it dead simple to create virtual joysticks,
keyboards and mice for generating arbitrary input events
programmatically.
""",
ext_modules=[Extension('_libsuinput', ['libsuinput/src/suinput.c'],
libraries=[":%s" % libudev_so])]
)