-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
107 lines (90 loc) · 2.66 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
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
try:
from setuptools import setup, Extension
except ImportError as ex:
from distutils.core import setup, Extension
import struct
import os
import sys
pin_home = os.environ.get('PIN_HOME')
if not pin_home:
print('Please set PIN_HOME environment variable; e.g.:')
print('export PIN_HOME=/apps/BRM/portal/brmdev/webexBRM/opt/portal/7.5/')
sys.exit(1)
if not os.path.isdir(pin_home):
print('Cannot find the directory in $PIN_HOME. Please set it correctly; e.g.:')
print('export PIN_HOME=/apps/BRM/portal/brmdev/webexBRM/opt/portal/7.5/')
sys.exit(1)
bits = struct.calcsize("P") * 8
assert bits in (32, 64)
include_dirs = [
os.path.join(pin_home, 'include')
]
libraries_32 = [
'portal',
'pcmext',
]
libraries_64 = [
'portal64',
'pcmext64',
]
if bits == 32:
libraries = libraries_32
else:
libraries = libraries_64
library_dirs = [
os.path.join(pin_home, 'lib')
]
extra_objects = []
extra_compile_args = []
if bits == 32:
extra_compile_args.append('-m32')
extra_link_args = []
if bits == 32:
extra_link_args.append('-m32')
with open('README.md') as f:
long_description = f.read()
__version__ = None
exec(open('pybrm/_version.py', 'r').read())
setup(
name='pybrm',
version=__version__,
description="A Python library for Oracle BRM",
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/mkmoisen/pybrm',
author='Matthew Moisen',
author_email='[email protected]',
license='MIT',
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: Telecommunications Industry',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: C',
'Operating System :: POSIX :: Linux',
'Natural Language :: English',
],
keywords='brm',
project_urls={
'Documentation': 'https://github.com/mkmoisen/pybrm',
'Source': 'https://github.com/mkmoisen/pybrm',
},
python_requires='>=3.6',
ext_modules=[
Extension(
'pybrm.cbrm', ['src/pybrm.c'],
include_dirs=include_dirs,
libraries=libraries,
library_dirs=library_dirs,
runtime_library_dirs=library_dirs,
extra_objects=extra_objects,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
),
],
packages=['pybrm']
)