Uh oh!
There was an error while loading. Please reload this page.
forked from balloob/python-openzwave
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-lib.py
More file actions
Latest commit
executable file
·122 lines (109 loc) · 4.88 KB
/
Copy pathsetup-lib.py
File metadata and controls
executable file
·122 lines (109 loc) · 4.88 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of **python-openzwave** project https://github.com/bibi21000/python-openzwave.
:platform: Unix, Windows, MacOS X
.. moduleauthor:: bibi21000 aka Sébastien GALLET <bibi21000@gmail.com>
License : GPL(v3)
**python-openzwave** is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
**python-openzwave** is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with python-openzwave. If not, see http://www.gnu.org/licenses.
"""
fromosimportnameasos_name
#from distutils.core import setup
fromsetuptoolsimportsetup, find_packages
fromdistutils.extensionimportExtension
#from Cython.Distutils import build_ext
fromCython.Distutilsimportbuild_ext
fromCython.Buildimportcythonize
fromplatformimportsystemasplatform_system
importglob
importos
importsys
frompyozw_versionimportpyozw_version
DEBIAN_PACKAGE=False
filtered_args= []
forarginsys.argv:
ifarg=="--debian-package":
DEBIAN_PACKAGE=True
else:
filtered_args.append(arg)
sys.argv=filtered_args
def_getDirs(base):
return [xforxinglob.iglob(os.path.join( base, '*')) ifos.path.isdir(x) ]
defdata_files_config(target, source, pattern):
ret=list()
tup=list()
tup.append(target)
tup.append(glob.glob(os.path.join(source,pattern)))
#print tup
ret.append(tup)
dirs=_getDirs(source)
iflen(dirs):
fordindirs:
#print os.path.abspath(d)
rd=d.replace(source+os.sep, "", 1)
#print target,rd
#print os.path.join(target,rd)
ret.extend(data_files_config(os.path.join(target,rd), \
os.path.join(source,rd), pattern))
returnret
data_files=data_files_config('config','openzwave/config','*.xml')
data_files.extend(data_files_config('config','openzwave/config','*.xsd'))
cmdclass= { }
ext_modules= [ ]
ifos_name=='nt':
ext_modules= [Extension("libopenzwave",
sources=["src-lib/libopenzwave/libopenzwave.pyx"],
libraries=['setupapi', 'stdc++'],
language="c++",
extra_objects=['openzwave/libopenzwave.a'],
include_dirs=['openzwave/cpp/src', 'openzwave/cpp/src/value_classes', 'openzwave/cpp/src/platform', 'openzwave/cpp/build/windows', "src-lib/libopenzwave"]
)]
elifplatform_system() =='Darwin':
ext_modules= [Extension("libopenzwave",
sources=["src-lib/libopenzwave/libopenzwave.pyx"],
libraries=['stdc++'],
language="c++",
extra_link_args=['-framework', 'CoreFoundation', '-framework', 'IOKit'],
extra_objects=['openzwave/libopenzwave.a'],
include_dirs=['openzwave/cpp/src', 'openzwave/cpp/src/value_classes', 'openzwave/cpp/src/platform', 'openzwave/cpp/build/mac', "src-lib/libopenzwave"]
)]
elifDEBIAN_PACKAGE==True:
ext_modules= [Extension("libopenzwave",
sources=["src-lib/libopenzwave/libopenzwave.pyx"],
libraries=['udev', 'stdc++', 'openzwave'],
language="c++",
extra_objects=['/usr/libopenzwave.a'],
include_dirs=['/usr/include/openzwave', '/usr/include/openzwave/value_classes', '/usr/include/openzwave/platform', "src-lib/libopenzwave"]
)]
else:
ext_modules= [Extension("libopenzwave",
sources=["src-lib/libopenzwave/libopenzwave.pyx"],
libraries=['udev', 'stdc++'],
language="c++",
extra_objects=['openzwave/libopenzwave.a'],
include_dirs=['openzwave/cpp/src/', 'openzwave/cpp/src/value_classes/', 'openzwave/cpp/src/platform/', 'openzwave/cpp/build/linux/']
)]
setup(
name='libopenzwave',
author='Sébastien GALLET aka bibi2100 <bibi21000@gmail.com>',
author_email='bibi21000@gmail.com',
version=pyozw_version,
zip_safe=False,
url='https://github.com/bibi21000/python-openzwave',
cmdclass= {'build_ext': build_ext},
ext_modules=ext_modules,
#ext_modules = cythonize(ext_modules),
package_dir= {'' : 'src-lib'},
#The following line install config drectory in share/python-openzwave
data_files=data_files,
packages=find_packages('src-lib', exclude=["scripts"]),
)