-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
86 lines (68 loc) · 2.22 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
#!/usr/bin/env python
#
# Setup prog for vc3core
#
import commands
import os
import re
import sys
release_version="0.9.1"
from distutils.core import setup
from distutils.command.install import install as install_org
from distutils.command.install_data import install_data as install_data_org
#libexec_files = ['libexec/%s' %file for file in os.listdir('libexec') if os.path.isfile('libexec/%s' %file)]
systemd_files = [ 'etc/vc3-infoservice.service'
]
etc_files = ['etc/vc3-core.conf'
]
logrotate_files = ['etc/logrotate/vc3-core',]
initd_files = ['etc/vc3-core.init', ]
rpm_data_files=[
#('/usr/libexec', libexec_files),
('/etc/vc3', etc_files),
('/etc/logrotate.d', logrotate_files),
('/etc/init.d', initd_files),
('/usr/lib/systemd/system', systemd_files),
]
home_data_files=[
#('etc', libexec_files),
('etc', etc_files),
('etc', initd_files),
]
def choose_data_files():
rpminstall = True
userinstall = False
if 'bdist_rpm' in sys.argv:
rpminstall = True
elif 'install' in sys.argv:
for a in sys.argv:
if a.lower().startswith('--home'):
rpminstall = False
userinstall = True
if rpminstall:
return rpm_data_files
elif userinstall:
return home_data_files
else:
# Something probably went wrong, so punt
return rpm_data_files
# ===========================================================
# setup for distutils
setup(
name="vc3-core",
version=release_version,
description='vc3-core package',
long_description='''This package contains the VC3 Core Service''',
license='GPL',
author='John Hover',
author_email='[email protected]',
maintainer='John Hover',
maintainer_email='[email protected]',
url='https://github.com/vc3-project',
packages=['vc3core'
],
scripts = [ # Utilities and main script
'scripts/vc3-core',
],
data_files = choose_data_files()
)