-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
76 lines (59 loc) · 2.14 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
#!/usr/bin/env python
#
# Setup prog for infoservice
import sys
import re
import time
from setuptools import setup
def choose_data_file_locations():
local_install = False
if '--user' in sys.argv:
local_install = True
elif any([re.match('--home(=|\s)', arg) for arg in sys.argv]):
local_install = True
elif any([re.match('--prefix(=|\s)', arg) for arg in sys.argv]):
local_install = True
if local_install:
return home_data_files
else:
return rpm_data_files
current_time = time.gmtime()
#release_version = "{0}.{1:0>2}.{2:0>2}".format(current_time.tm_year, current_time.tm_mon, current_time.tm_mday)
release_version = '1.0.0'
systemd_files = ['etc/vc3-infoservice.service']
etc_files = ['etc/vc3-infoservice.conf',
'etc/vc3-infoclient.conf',]
sysconfig_files = ['etc/sysconfig/vc3-infoservice', ]
logrotate_files = ['etc/logrotate/vc3-infoservice', ]
initd_files = ['etc/vc3-infoservice.init.DONTUSE', ]
rpm_data_files = [('/etc/vc3', etc_files),
('/etc/sysconfig', sysconfig_files),
('/etc/logrotate.d', logrotate_files),
('/etc/init.d', initd_files),
('/usr/lib/systemd/system', systemd_files), ]
home_data_files = [('etc', etc_files),
('etc', initd_files),
('etc', sysconfig_files), ]
data_files = choose_data_file_locations()
# ===========================================================
setup(
name="vc3-infoservice",
version=release_version,
description='vc3-info-service package',
long_description='''This package contains the VC3 Information Service''',
license='GPL',
author='John Hover',
author_email='[email protected]',
maintainer='John Hover',
maintainer_email='[email protected]',
url='https://github.com/vc3-project',
packages=['vc3infoservice',
'vc3infoservice.plugins',
'vc3infoservice.plugins.persist'
],
scripts=['scripts/vc3-infoservice',
'scripts/vc3-infoclient',
],
data_files=data_files,
install_requires=['cherrypy','pyopenssl','pluginmanager']
)