-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
71 lines (64 loc) · 2.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
# Copyright 2016, 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------------
import os
import subprocess
# from distutils.core import setup, Extension, find_packages
from setuptools import setup, Extension, find_packages
if os.name == 'nt':
conf_dir = "C:\\Program Files (x86)\\Intel\\sawtooth\\conf"
data_dir = "C:\\Program Files (x86)\\Intel\\sawtooth\\data"
log_dir = "C:\\Program Files (x86)\\Intel\\sawtooth\\logs"
else:
conf_dir = "/etc/sawtooth"
data_dir = "/var/lib/sawtooth"
log_dir = "/var/log/sawtooth"
data_files = [
(conf_dir, ['packaging/path.toml.example', 'packaging/log_config.toml.example', 'packaging/validator.toml.example']),
(os.path.join(conf_dir, "keys"), []),
(data_dir, []),
(log_dir, []),
]
if os.path.exists("/etc/default"):
data_files.append(('/etc/default', ['packaging/systemd/sawtooth-validator']))
if os.path.exists("/lib/systemd/system"):
data_files.append(('/lib/systemd/system',
['packaging/systemd/sawtooth-validator.service']))
setup(
name='sawtooth-validator',
version=subprocess.check_output(
['../bin/get_version']).decode('utf-8').strip(),
description='Sawtooth Lake Validator',
author='Intel Corporation',
url='https://github.com/hyperledger/sawtooth-core',
packages=find_packages(),
install_requires=[
"cbor>=0.1.23",
"colorlog",
"protobuf",
"lmdb",
"requests",
"sawtooth-signing",
"toml",
"PyYAML",
"pyzmq",
"netifaces",
"pyformance"
],
data_files=data_files,
entry_points={
'console_scripts': [
'sawtooth-validator = sawtooth_validator.server.cli:main'
]
})