This repository has been archived by the owner on Nov 30, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
110 lines (100 loc) · 3.29 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
107
108
109
110
#!/usr/bin/env python3
"""
Python setuptools script for ``ocspd`` application.
"""
import os
from setuptools import setup
from setuptools import find_packages
from setuptools.command.install import install
import ocspd.deprecation
# pylint: disable=invalid-name
# Disable superfluous-parens, because we want py3 compatibility
# pylint: disable=superfluous-parens
version = '0.1'
install_requires = [
'certvalidator>=0.11.1',
'ocspbuilder>=0.10.2',
'oscrypto>=0.17.2',
'python-daemon>=1.5.5',
'requests>=2.4.3',
'future>=0.15.0',
'configargparse>=0.10.0',
]
docs_extras = [
'Sphinx>=1.0', # autodoc_member_order = 'bysource', autodoc_default_flags
'sphinx-argparse>=0.1.15',
'sphinx_rtd_theme',
]
long_description = (
"Update OCSP staples from CA's and store the result so "
"they can be served to clients."
)
class CustomInstallCommand(install):
"""
Installs systemd service to /lib/systemd/system/ocspd.service. Note that
this is not installed when installing with --editable or setup.py develop.
"""
CREATE_DIRS = [
os.path.join('/lib', 'systemd', 'system'),
os.path.join('/etc', 'ocspd'),
os.path.join('/var', 'log', 'ocspd'),
]
def run(self):
"""
Installs and then copies the service file to the systemd directory
"""
ocspd.deprecation.run(True)
install.run(self)
print("Creating needed directories")
for directory in self.CREATE_DIRS:
if not os.path.exists(directory):
try:
os.makedirs(directory)
except OSError as exc:
if exc.errno == 13:
print("WARNING! Failed to create directory '{}'. This "
"might cause problems.".format(directory))
else:
raise
setup(
name='ocspd',
version=version,
description='Daemon for updating OCSP staples',
long_description=long_description,
author='Greenhost BV',
author_email='[email protected]',
url='https://code.greenhost.net/open/ocspd',
packages=find_packages(),
include_package_data=True,
install_requires=install_requires,
extras_require={
'docs': docs_extras,
},
license='MIT License',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: Proxy Servers',
'Topic :: Security',
'Topic :: System :: Networking',
'Topic :: System :: Systems Administration',
'Topic :: Utilities',
],
entry_points={
'console_scripts': [
'ocspd = ocspd.__main__:init'
]
},
data_files=[('/lib/systemd/system', ['scripts/ocspd.service'])],
cmdclass={'install': CustomInstallCommand},
)