Thomas Klaehn b1e66c2af1 attenuation-control: Add scripts to control the attenuation
Xmlrpc client/server application to control the digital attenuators
installed in the lava testbed.

Implements AR_VUL-64.

Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
2018-04-17 17:01:48 +02:00

36 lines
1.2 KiB
Python
Executable File

#!/usr/bin/python3
'''
@author: Thomas Klaehn <thomas.klaehn@u-blox.com>
'''
from distutils.core import setup
import os
import shutil
import stat
import sys
NAME = 'attenuation-control'
VERSION = '1.0.0'
AUTHOR = 'Thomas Klaehn'
EMAIL = 'thomas.klaehn@u-blox.com'
SYSTEMD_SCRIPTS = ['attenuation-control.service']
EXEC_SCRIPTS = ['attenuation-control-client']
PACKAGES = ['attenuator', 'attenuation_control_srv', 'attenuation_control_client']
PACKAGE_DIRS = {
'attenuator':'source/attenuator',
'attenuation_control_srv':'source/attenuation_control_srv',
'attenuation_control_client':'source/attenuation_control_client'
}
SYSTEMD_PATH = '/lib/systemd/system/'
SRC_FILE = 'attenuation-control.service'
DST_FILE = SYSTEMD_PATH + SRC_FILE
if sys.argv[1] == 'install':
shutil.copyfile(SRC_FILE, DST_FILE)
os.chmod(DST_FILE, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES,
scripts=EXEC_SCRIPTS)
elif sys.argv[1] == 'sdist':
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES,
scripts=SYSTEMD_SCRIPTS)