github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/validator/setup.py (about)

     1  # Copyright 2016, 2017 Intel Corporation
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  # ------------------------------------------------------------------------------
    15  
    16  import os
    17  import subprocess
    18  import sys
    19  
    20  from setuptools import setup, find_packages
    21  
    22  bin_dir = "/usr/bin"
    23  lib_dir = "/usr/lib"
    24  conf_dir = "/etc/sawtooth"
    25  data_dir = "/var/lib/sawtooth"
    26  log_dir = "/var/log/sawtooth"
    27  
    28  data_files = [
    29      (bin_dir, ['bin/sawtooth-validator']),
    30      (lib_dir, ['lib/libsawtooth_validator.so']),
    31      (conf_dir, ['packaging/path.toml.example',
    32                  'packaging/log_config.toml.example',
    33                  'packaging/validator.toml.example']),
    34      (os.path.join(conf_dir, "keys"), []),
    35      (data_dir, []),
    36      (log_dir, []),
    37  ]
    38  
    39  if os.path.exists("/etc/default"):
    40      data_files.append(
    41          ('/etc/default', ['packaging/systemd/sawtooth-validator']))
    42  
    43  if os.path.exists("/lib/systemd/system"):
    44      data_files.append(('/lib/systemd/system',
    45                         ['packaging/systemd/sawtooth-validator.service']))
    46  
    47  setup(
    48      name='sawtooth-validator',
    49      version=subprocess.check_output(
    50          ['../bin/get_version']).decode('utf-8').strip(),
    51      description='Sawtooth Validator',
    52      author='Hyperledger Sawtooth',
    53      url='https://github.com/hyperledger/sawtooth-core',
    54      packages=find_packages(),
    55      install_requires=[
    56          "cbor>=0.1.23",
    57          "colorlog",
    58          "protobuf",
    59          "lmdb",
    60          "requests",
    61          "sawtooth-signing",
    62          "toml",
    63          "PyYAML",
    64          "pyzmq",
    65          "netifaces",
    66          "pyformance"
    67      ],
    68      data_files=data_files,
    69      entry_points={})