29 lines
934 B
Python
29 lines
934 B
Python
|
#!/usr/bin/python3
|
||
|
'''
|
||
|
@author: Thomas Klaehn <tkl@blackfinn.de>
|
||
|
'''
|
||
|
from distutils.core import setup
|
||
|
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'}
|
||
|
|
||
|
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)
|
||
|
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES)
|
||
|
elif sys.argv[1] == 'sdist':
|
||
|
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES,
|
||
|
scripts=SYSTEMD_SCRIPTS)
|