setup: rearrange constants

This commit is contained in:
tkl 2017-02-16 07:44:56 +00:00
parent 32a2408282
commit 50b54e6db6

View File

@ -1,36 +1,36 @@
#!/usr/bin/env python #!/usr/bin/env python
''' '''
Created on Feb 15, 2017 Created on Feb 15, 2017
Type 'python setup.py sdist' to create the distribution, Type 'python setup.py sdist' to create the distribution,
type 'python setup.py install' to install the distribution. type 'python setup.py install' to install the distribution.
@author: tkl @author: tkl
''' '''
from distutils.core import setup from distutils.core import setup
import shutil import shutil
import os import os
import stat import stat
import sys import sys
DAEMON_START_SCRIPT_SRC = 'mqtt_logger.service' PKG_NAME = 'mqtt_logger'
DAEMON_START_SCRIPT_DST = '/lib/systemd/system/mqtt_logger.service' PKG_VERSION = '0.1.0'
PKG_NAME = 'mqtt_logger' DAEMON_START_SCRIPT_SRC = PKG_NAME + '.service'
PKG_VERSION = '0.1.0' DAEMON_START_SCRIPT_DST = '/lib/systemd/system/' + DAEMON_START_SCRIPT_SRC
PKG_AUTHOR = 'tkl' PKG_AUTHOR = 'tkl'
PKG_AUTHOR_EMAIL = 'tkl@blackfinn.de' PKG_AUTHOR_EMAIL = 'tkl@blackfinn.de'
PKG_URL = 'files.blackfinn.de/python/' + PKG_NAME + '.py/' + PKG_NAME + '-' + \ PKG_URL = 'files.blackfinn.de/python/' + PKG_NAME + '.py/' + PKG_NAME + '-' + \
PKG_VERSION + '.tar.gz' PKG_VERSION + '.tar.gz'
PKG_PACKAGES = [PKG_NAME] PKG_PACKAGES = [PKG_NAME]
PKG_SCRIPTS = [DAEMON_START_SCRIPT_SRC] PKG_SCRIPTS = [DAEMON_START_SCRIPT_SRC]
if sys.argv[1] == 'install': if sys.argv[1] == 'install':
shutil.copyfile(DAEMON_START_SCRIPT_SRC, DAEMON_START_SCRIPT_DST) shutil.copyfile(DAEMON_START_SCRIPT_SRC, DAEMON_START_SCRIPT_DST)
os.chmod(DAEMON_START_SCRIPT_DST, stat.S_IRUSR | stat.S_IWUSR | \ os.chmod(DAEMON_START_SCRIPT_DST, stat.S_IRUSR | stat.S_IWUSR | \
stat.S_IRGRP | stat.S_IROTH) stat.S_IRGRP | stat.S_IROTH)
setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR, setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR,
author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES) author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES)
elif sys.argv[1] == 'sdist': elif sys.argv[1] == 'sdist':
setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR, setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR,
author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES, author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES,
scripts=PKG_SCRIPTS) scripts=PKG_SCRIPTS)