28 lines
756 B
Python
28 lines
756 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
import sys
|
||
|
import os
|
||
|
import shutil
|
||
|
import stat
|
||
|
from setuptools import setup
|
||
|
|
||
|
NAME = 'gpxtracker'
|
||
|
VERSION = '0.1.0'
|
||
|
AUTHOR = 'Thomas Klaehn'
|
||
|
EMAIL = 'tkl@blackfinn.de'
|
||
|
PACKAGES = ['gpx_tracker']
|
||
|
SCRIPTS = ['gpxtracker']
|
||
|
REQUIRES = ['gps', 'gpxpy', 'rpi.gpio']
|
||
|
|
||
|
SERVICEDIR = "/lib/systemd/system"
|
||
|
|
||
|
DAEMON_START_SCRIPT = os.path.join(SERVICEDIR, "gpxtracker.service")
|
||
|
|
||
|
if sys.argv[1] == 'install':
|
||
|
os.makedirs(SERVICEDIR, exist_ok=True)
|
||
|
shutil.copyfile("gpxtracker.service", DAEMON_START_SCRIPT)
|
||
|
os.chmod(DAEMON_START_SCRIPT, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
|
||
|
|
||
|
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL,
|
||
|
packages=PACKAGES, scripts=SCRIPTS, install_requires=REQUIRES)
|