2021-03-22 11:03:15 +00:00
|
|
|
import shutil
|
2021-03-17 09:28:25 +00:00
|
|
|
import sys
|
2019-04-08 15:26:45 +00:00
|
|
|
import os
|
2021-03-17 09:28:25 +00:00
|
|
|
from setuptools import setup
|
2019-04-08 15:26:45 +00:00
|
|
|
|
2021-03-17 09:28:25 +00:00
|
|
|
NAME = 'Greenhouse'
|
|
|
|
VERSION = '1'
|
2019-04-08 15:26:45 +00:00
|
|
|
AUTHOR = 'Thomas Klaehn'
|
|
|
|
EMAIL = 'tkl@blackfinn.de'
|
|
|
|
PACKAGES = ['greenhouse']
|
2021-03-17 09:28:25 +00:00
|
|
|
REQUIRES = ['Flask', 'w1thermsensor', 'RPi.GPIO']
|
2021-03-22 11:03:15 +00:00
|
|
|
CONFIG_FOLDER = '/etc/greenhouse'
|
|
|
|
CONFIG_FILE = 'greenhouse.json'
|
2021-04-06 05:50:18 +00:00
|
|
|
PACKAGE_DATA = {'greenhouse': ['templates/*', 'static/css/*', 'static/scripts/*', 'config/*']}
|
2019-04-08 15:26:45 +00:00
|
|
|
|
2021-03-17 09:28:25 +00:00
|
|
|
setup(name=NAME, version=VERSION, long_description=__doc__, author=AUTHOR, author_email=EMAIL,
|
2021-04-06 05:39:43 +00:00
|
|
|
packages=PACKAGES, include_package_data=True, package_data=PACKAGE_DATA, zip_safe=False,
|
|
|
|
install_requires=REQUIRES)
|
2021-03-22 11:03:15 +00:00
|
|
|
|
|
|
|
if sys.argv[1] == 'install':
|
|
|
|
try:
|
|
|
|
os.makedirs(CONFIG_FOLDER)
|
|
|
|
shutil.copyfile(CONFIG_FILE, os.path.join(CONFIG_FOLDER, CONFIG_FILE))
|
|
|
|
except FileExistsError:
|
|
|
|
#FIXME: handle overwriting the config file
|
|
|
|
pass
|