LIRC libraries: /home/mk/tmp/lirc/python-pkg/lirc/paths.py (ba530e4 2017-01-22 19:05:53 +0100) Source File

| LIRC libraries LinuxInfraredRemoteControl

paths.py
1 ''' Set up paths to components, including in-tree development. '''
2
3 import glob
4 import sys
5 import os.path
6
7
8 HERE = os.path.abspath(os.path.dirname(__file__))
9 if HERE not in sys.path:
10 sys.path.insert(0, HERE)
11 if os.path.exists(os.path.join(HERE, '_client.so')):
12 os.unlink(os.path.join(HERE, '_client.so'))
13 if os.path.exists(os.path.join(HERE, '..', 'lib', '.libs', '_client.so')):
14 # development tree Makefile.am creates lib/libs/_client.so
15 # after 'make install'; plain 'make' isn't enough.
16 os.symlink(os.path.join('..', 'lib', '.libs', '_client.so'),
17 os.path.join(HERE, '_client.so'))
18 else:
19 # 'python setup.py' artifact:
20 SRC = glob.glob(os.path.join(HERE, '../_client.cpython*.so'))
21 if len(SRC) == 1:
22 os.symlink(os.path.join(SRC[0]), os.path.join(HERE, '_client.so'))