This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
setup.py
78 lines (68 loc) · 3.08 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
#!/bin/env python3
# Copyright (c) 2022 Seagate Technology LLC and/or its Affiliates
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# For any questions about this software or licensing,
# please email [email protected] or [email protected].
import os
import glob
from setuptools import setup
import sys
RGW_INSTALL_PATH="/opt/seagate/cortx/rgw"
if not os.path.isfile("./VERSION"):
print("error: VERSION file not found!!", file=sys.stderr)
sys.exit(1)
# Get version info.
with open("VERSION") as v_file:
rgw_intg_version = v_file.read().strip()
# Get rpm description.
with open('README.md', 'r') as rf:
long_description = rf.read()
# Get list of mini-provisioner classes
mini_prov_files = glob.glob('./src/setup/*.py')
logrotate_tmpl_file = 'src/rgw/setup/templates/rgw.logrotate.tmpl'
logrotate_service_tmpl = 'src/rgw/setup/templates/logrotate.service.tmpl'
core_file_logrotate_tmpl = 'src/rgw/setup/templates/rgw_core_logrotate.sh'
data_file_list=[ ('%s/mini-provisioner' % RGW_INSTALL_PATH, mini_prov_files),
('%s/bin' % RGW_INSTALL_PATH,
['src/rgw/setup/rgw_setup', 'src/rgw/support/rgw_support_bundle',
'src/rgw/setup/radosgw_start']),
('%s/mini-provisioner' % RGW_INSTALL_PATH,['VERSION']),
('%s/conf' % RGW_INSTALL_PATH,['conf/cortx_rgw.conf',
logrotate_tmpl_file, 'src/rgw/support/support.yaml',
logrotate_service_tmpl, core_file_logrotate_tmpl])
]
# Add addb plugin to rpm if its generated duirng build process.
addb_plugin_file="src/addb_plugin/rgw_addb_plugin.so"
if os.path.exists(addb_plugin_file):
print("Adding addb plugin file to rpm.")
addb_plugin_tuple=('%s/bin' % RGW_INSTALL_PATH, [addb_plugin_file])
data_file_list.append(addb_plugin_tuple)
setup(name='cortx-rgw-integration',
version=rgw_intg_version,
url='https://github.com/Seagate/cortx-rgw-integration',
license='Seagate',
description='RGW integration code for CORTX',
package_dir={'cortx': 'src'},
packages=['cortx.rgw',
'cortx.rgw.setup', 'cortx.rgw.support',
],
long_description=long_description,
zip_safe=False,
python_requires='>=3.6',
entry_points={
'console_scripts': [
'rgw_setup = cortx.rgw.setup.rgw_setup:main',
'rgw_support_bundle = cortx.rgw.support.rgw_support_bundle:main',
]
},
data_files =data_file_list,
)