-
Notifications
You must be signed in to change notification settings - Fork 41
/
setup.py
executable file
·43 lines (40 loc) · 1.28 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
#!/usr/bin/env python
#
# Copyright (c) 2016-2020, Dell Inc. or its subsidiaries.
# All rights reserved.
# See file LICENSE for licensing information.
#
import ctypes
import os
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError
_HERED = os.path.abspath(os.path.dirname(__file__))
try:
libgssapi_krb5 = ctypes.CDLL("libgssapi_krb5.so")
defines = [
("HAVE_GSS_SET_CRED_OPTION", hasattr(libgssapi_krb5, "gss_set_cred_option")),
(
"HAVE_GSSSPI_SET_CRED_OPTION",
hasattr(libgssapi_krb5, "gssspi_set_cred_option"),
),
]
lw_krb_module = Extension(
"pike.kerberos",
[
"pykerb/base64.c",
"pykerb/kerberosbasic.c",
"pykerb/kerberos.c",
"pykerb/kerberosgss.c",
"pykerb/kerberospw.c",
],
include_dirs=[os.path.join(_HERED, "pykerb", "vendor")],
libraries=["gssapi_krb5"],
define_macros=defines,
)
setup(ext_modules=[lw_krb_module])
except (OSError, CCompilerError, DistutilsExecError, DistutilsPlatformError):
print("libgssapi_krb5 not available, skipping kerberos module")
setup()