setup.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ##
  2. # Copyright (c) 2006-2018 Apple Inc. All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ##
  16. from os.path import dirname, join as joinpath
  17. from setuptools import setup, Extension
  18. try:
  19. from subprocess import getoutput
  20. except ImportError:
  21. from commands import getoutput
  22. #
  23. # Options
  24. #
  25. project_name = "kerberos"
  26. version_string = "1.3.0"
  27. description = "Kerberos high-level interface"
  28. long_description = open(joinpath(dirname(__file__), "README.rst")).read()
  29. url = "https://github.com/apple/ccs-pykerberos"
  30. classifiers = [
  31. "Development Status :: 5 - Production/Stable",
  32. "Intended Audience :: Developers",
  33. "License :: OSI Approved :: Apache Software License",
  34. "Operating System :: OS Independent",
  35. "Programming Language :: Python :: 2",
  36. "Programming Language :: Python :: 3",
  37. "Topic :: Software Development :: Libraries :: Python Modules",
  38. "Topic :: System :: Systems Administration :: Authentication/Directory",
  39. ]
  40. author = "Apple Inc."
  41. author_email = "calendarserver-dev@lists.macosforge.org"
  42. license = "Apache License, Version 2.0"
  43. platforms = ["all"]
  44. #
  45. # Entry points
  46. #
  47. entry_points = {
  48. "console_scripts": [],
  49. }
  50. #
  51. # Dependencies
  52. #
  53. setup_requirements = []
  54. install_requirements = []
  55. extras_requirements = {}
  56. extra_link_args = getoutput("krb5-config --libs gssapi").split()
  57. extra_compile_args = getoutput("krb5-config --cflags gssapi").split()
  58. #
  59. # Set up Extension modules that need to be built
  60. #
  61. extensions = [
  62. Extension(
  63. "kerberos",
  64. extra_link_args=extra_link_args,
  65. extra_compile_args=extra_compile_args,
  66. sources=[
  67. "src/base64.c",
  68. "src/kerberos.c",
  69. "src/kerberosbasic.c",
  70. "src/kerberosgss.c",
  71. "src/kerberospw.c",
  72. ],
  73. ),
  74. ]
  75. #
  76. # Run setup
  77. #
  78. def doSetup():
  79. setup(
  80. name=project_name,
  81. version=version_string,
  82. description=description,
  83. long_description=long_description,
  84. url=url,
  85. classifiers=classifiers,
  86. author=author,
  87. author_email=author_email,
  88. license=license,
  89. platforms=platforms,
  90. ext_modules=extensions,
  91. setup_requires=setup_requirements,
  92. install_requires=install_requirements,
  93. extras_require=extras_requirements,
  94. )
  95. #
  96. # Main
  97. #
  98. if __name__ == "__main__":
  99. doSetup()