From 334a10018016b1653742b0fde4737d5565a6f1d6 Mon Sep 17 00:00:00 2001 From: ocket8888 Date: Mon, 11 Jun 2018 12:18:29 -0600 Subject: [PATCH] Hotfix: systemd unit files now properly installed --- connmonitor/__init__.py | 2 +- setup.py | 25 +++++++------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/connmonitor/__init__.py b/connmonitor/__init__.py index f932d6e..cabb6e2 100755 --- a/connmonitor/__init__.py +++ b/connmonitor/__init__.py @@ -19,7 +19,7 @@ __author__ = "Brennan W. Fieck" -__version__ = "3.0.3" +__version__ = "3.0.4" import sys diff --git a/setup.py b/setup.py index b0d1dd1..cf7e6c1 100755 --- a/setup.py +++ b/setup.py @@ -20,34 +20,23 @@ """ import os +import sys # RPMs generated for fedora/rhel/centos need to have a different name # (debian/ubuntu automatically prepends python3-, but those do not) import platform from setuptools import setup, find_packages -pkgname = "connmonitor" -depname = "connvitals" - -# I know this is deprecated, but it's the only way to get this information afaik -distname = platform.linux_distribution(full_distribution_name=False)[0] -if distname in {'centos', 'fedora', 'redhat'}: - pkgname = "python3-"+pkgname - depname = "python3-"+depname -elif not distname: - from sys import stderr - print("\033[38;2;255;0;0mconnvitals-monitor ONLY works on compatible *nix \ -distributions - '%s' is not supported.\033[38;2;255;255;255m" % platform.system(), file=stderr) - exit(1) - here = os.path.abspath(os.path.dirname(__file__)) +sys.path.append(here) +import connmonitor with open(os.path.join(here, 'README.rst')) as f: long_description = f.read() setup( - name=pkgname, - version='3.0.3', + name='connmonitor', + version=connmonitor.__version__, description=\ 'Uses the connvitals library to continuously poll and record network connectivity statistics.', long_description=long_description, @@ -82,8 +71,8 @@ ], keywords='network statistics connection ping traceroute port ip', packages=find_packages(exclude=['contrib', 'docs', 'tests']), - install_requires=[depname, 'setuptools', 'typing'], - data_files=[('/usr/lib/systemd/system', ['connmonitor.service'])], + install_requires=['connvitals', 'setuptools', 'typing'], + data_files=[('lib/systemd/system', ['connmonitor.service'])], entry_points={ 'console_scripts': [ 'connmonitor=connmonitor:main',