Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

setup.py 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #! /usr/bin/env python
  2. from os import path
  3. import os
  4. import shutil
  5. import subprocess
  6. from setuptools import setup, find_packages
  7. from setuptools.command.install import install
  8. install_requires = [
  9. 'argcomplete'
  10. ]
  11. here = path.abspath(path.dirname(__file__))
  12. class InstallCommand(install):
  13. def run(self):
  14. install.run(self)
  15. try:
  16. if path.isdir('/etc/bash_completion.d/'):
  17. shutil.copy('extra/bash/sitegen', '/etc/bash_completion.d/')
  18. except Exception as e:
  19. print(e)
  20. try:
  21. if not path.isdir('/etc/sitegen/'):
  22. shutil.copytree('extra/sitegen/', '/etc/sitegen/')
  23. os.mkdir('/etc/sitegen/hooks-enabled/')
  24. for hook_type in ['site', 'cert']:
  25. os.mkdir('/etc/sitegen/hooks-enabled/%1s' % hook_type)
  26. for file in os.listdir('/etc/sitegen/hooks-available/%1s/' % hook_type):
  27. os.symlink('../../hooks-available/%1s/%2s' % (hook_type, file),
  28. '/etc/sitegen/hooks-enabled/%1s/%2s' % (hook_type, file))
  29. except Exception as e:
  30. print(e)
  31. def package_files(directory):
  32. paths = []
  33. for (path, directories, filenames) in os.walk(directory):
  34. for filename in filenames:
  35. paths.append(os.path.join(path, filename))
  36. return paths
  37. setup(
  38. name='sitegencli',
  39. version="1.0.0",
  40. description="CLI tool to build web site configuration",
  41. long_description="""\
  42. CLI tool to build web site configuration and obtain SSL certificates from letsencrypt using certbot.
  43. Also provide a simpler way to request SSL certificate over certbot""",
  44. url='https://git.rthoni.com/robin.thoni/sitegen',
  45. author="Robin Thoni",
  46. author_email='robin@rthoni.com',
  47. license='MIT',
  48. classifiers=[
  49. # How mature is this project? Common values are
  50. # 3 - Alpha
  51. # 4 - Beta
  52. # 5 - Production/Stable
  53. 'Development Status :: 5 - Production/Stable',
  54. # Indicate who your project is intended for
  55. 'Intended Audience :: System Administrators',
  56. 'Topic :: Internet :: WWW/HTTP :: HTTP Servers',
  57. # Pick your license as you wish (should match "license" above)
  58. 'License :: OSI Approved :: MIT License',
  59. # Specify the Python versions you support here. In particular, ensure
  60. # that you indicate whether you support Python 2, Python 3 or both.
  61. 'Programming Language :: Python :: 3',
  62. 'Programming Language :: Python :: 3.3',
  63. 'Programming Language :: Python :: 3.4',
  64. 'Programming Language :: Python :: 3.5',
  65. ],
  66. keywords="certbot apache ssl",
  67. packages=find_packages(),
  68. install_requires=install_requires,
  69. extras_require={
  70. 'dev': [],
  71. 'test': [],
  72. },
  73. package_data={
  74. },
  75. data_files=[
  76. ('share/sitegen/bash_completion.d/', ['extra/bash/sitegen']),
  77. ('share/sitegen/', ['extra/apache/sitegen.conf']),
  78. ('etc/sitegen/', ['extra/sitegen/sitegen.json']),
  79. ('etc/sitegen/hooks-available/cert/', package_files('extra/sitegen/hooks-available/cert/')),
  80. ('etc/sitegen/hooks-available/site/', package_files('extra/sitegen/hooks-available/site/')),
  81. ('etc/sitegen/templates/', package_files('extra/sitegen/templates/'))
  82. ],
  83. entry_points={
  84. 'console_scripts': [
  85. 'sitegen=sitegencli.sitegen:main',
  86. ],
  87. },
  88. cmdclass={
  89. 'install': InstallCommand,
  90. }
  91. )