-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
66 lines (61 loc) · 1.95 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
#!/usr/bin/env python3
import os
from setuptools import setup, Extension
from pathlib import Path
import re
import subprocess
VERSION = '1.0.0'
with open('pysysdc/__version__.py', 'r') as f:
VERSION = f.read().strip()
VERSION = re.sub(r'[^0-9.]+', '', VERSION)
long_description = ''
with open('README.md', 'r') as f:
long_description = f.read()
libsystemd_ver = 'unknown'
try:
libsystemd_ver = subprocess.check_output(['pkg-config', '--modversion', 'libsystemd'], stderr=subprocess.STDOUT, shell=False, universal_newlines=True).strip()
except Exception as e:
print("Failed to detect libsystemd version")
print(str(e))
setup(
name="pysysdc",
version=VERSION,
description="Python C library for SD-Bus communication",
long_description=long_description,
include_package_data=True,
author_email="andrey@bagrintsev.me, 1timkill@gmail.com, avdieev@gmail.com",
#long_description_content_type='text/markdown',
author="Andrey Bagrintsev, Anatolii Cheban, Oleksandr Avdieiev",
maintainer="Andrey Bagrintsev",
maintainer_email="andrey@bagrintsev.me",
url="https://github.com/sb0y/pysysdc",
license="BSD",
packages=["pysysdc"],
classifiers=[
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Development Status :: 5 - Production/Stable",
"Operating System :: Unix",
"Programming Language :: C",
],
ext_modules=[
Extension(
"_pysysdc",
[
"pysysdc/pysysdc.c",
"pysysdc/sdbus.c",
"pysysdc/python_runner.c",
"pysysdc/systemd_methods.c",
"pysysdc/dc_error_handling.c",
"pysysdc/helpers.c",
"pysysdc/connect.c"
],
libraries=['systemd'],
extra_compile_args=["-std=c99", "-O3", "-Werror=implicit-function-declaration", "-D_SVID_SOURCE", "-D_DEFAULT_SOURCE", "-D_LIBSYSTEMD_VERSION=%s" % libsystemd_ver] # match systemd
)
],
scripts=['scripts/dcbus'],
data_files=[("/etc/dbus-1/",
["etc/dbus-1/system-local.conf"])]
)