2019-04-08 15:26:45 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
'''
|
|
|
|
@author: Thomas Klaehn <tkl@blackfinn.de>
|
|
|
|
'''
|
2019-08-13 12:37:03 +00:00
|
|
|
from setuptools import setup
|
2019-04-08 15:26:45 +00:00
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import stat
|
|
|
|
import sys
|
|
|
|
|
|
|
|
NAME = 'greenhouse'
|
|
|
|
VERSION = '1.0.0'
|
|
|
|
AUTHOR = 'Thomas Klaehn'
|
|
|
|
EMAIL = 'tkl@blackfinn.de'
|
|
|
|
SYSTEMD_SCRIPTS = ['greenhouse.service']
|
|
|
|
PACKAGES = ['greenhouse']
|
|
|
|
PACKAGE_DIRS = {'greenhouse':'greenhouse'}
|
2019-08-13 12:37:03 +00:00
|
|
|
REQUIRES = ['RPi.GPIO', 'Adafruit_DHT', 'paho-mqtt']
|
2019-04-08 15:26:45 +00:00
|
|
|
|
|
|
|
SYSTEMD_PATH = '/lib/systemd/system/'
|
|
|
|
|
|
|
|
if sys.argv[1] == 'install':
|
|
|
|
for script in SYSTEMD_SCRIPTS:
|
|
|
|
shutil.copyfile(script, os.path.join(SYSTEMD_PATH, script))
|
|
|
|
os.chmod(os.path.join(SYSTEMD_PATH, script), stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
|
2019-08-13 12:37:03 +00:00
|
|
|
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES, install_requires=REQUIRES)
|
2019-04-08 15:26:45 +00:00
|
|
|
elif sys.argv[1] == 'sdist':
|
2019-08-13 12:37:03 +00:00
|
|
|
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES, install_requires=REQUIRES,
|
2019-04-08 15:26:45 +00:00
|
|
|
scripts=SYSTEMD_SCRIPTS)
|