forked from motioneye-project/motioneye
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
91 lines (65 loc) · 2.44 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
import os.path
from codecs import open
from setuptools import setup
from setuptools.command.sdist import sdist
import motioneye
here = os.path.abspath(os.path.dirname(__file__))
name = 'motioneye'
version = motioneye.VERSION
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
class SdistCommand(sdist):
def make_release_tree(self, base_dir, files):
sdist.make_release_tree(self, base_dir, files)
self.apply_patches(base_dir)
def apply_patches(self, base_dir):
dropbox_keys_file = os.path.join(os.getcwd(), base_dir, 'extra', 'dropbox.keys')
if os.path.exists(dropbox_keys_file):
g = {}
execfile(dropbox_keys_file, g)
upload_services_file = os.path.join(os.getcwd(), base_dir, 'motioneye', 'uploadservices.py')
if os.system("sed -i 's/dropbox_client_id_placeholder/%s/' %s" % (g['CLIENT_ID'], upload_services_file)):
raise Exception('failed to patch uploadservices.py')
if os.system("sed -i 's/dropbox_client_secret_placeholder/%s/' %s" % (g['CLIENT_SECRET'], upload_services_file)):
raise Exception('failed to patch uploadservices.py')
setup(
name=name,
version=version,
description='motionEye server',
long_description=long_description,
url='https://github.com/ccrisan/motioneye/',
author='Calin Crisan',
author_email='ccrisan@gmail.com',
license='GPLv3',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: End Users/Desktop',
'Topic :: Multimedia :: Video',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7'
],
keywords='motion video surveillance frontend',
packages=['motioneye'],
install_requires=['tornado>=3.1,<6', 'jinja2', 'pillow', 'pycurl'],
package_data={
'motioneye': [
'static/*.*',
'static/*/*',
'templates/*',
'scripts/*'
]
},
data_files=[
(os.path.join('share/%s' % name, root), [os.path.join(root, f) for f in files])
for (root, dirs, files) in os.walk('extra')
],
entry_points={
'console_scripts': [
'meyectl=motioneye.meyectl:main',
],
},
cmdclass={
'sdist': SdistCommand
}
)