# workaround for manpage gzipping bug in bdist_rpm import gzip man = open('Nagstamon/resources/nagstamon.1', 'rb') mangz = gzip.open('Nagstamon/resources/nagstamon.1.gz', 'wb') mangz.writelines(man) mangz.close() man.close() # run setup.py for rpm creation subprocess.call(['python3', 'setup.py', 'bdist_rpm'], shell=False) DISTS = { 'debian': debmain, 'ubuntu': debmain, 'linuxmint': debmain, 'fedora': rpmmain } if __name__ == '__main__': if platform.system() == 'Windows': winmain() elif platform.system() == 'Darwin': macmain() else: dist = get_distro()[0] if dist in DISTS: DISTS[dist]() else: print('Your system is not supported for automated build yet')
import platform import os.path from Nagstamon.Config import AppInfo from Nagstamon.Helpers import get_distro # dummy debug queue for compiling debug_queue = list() NAME = AppInfo.NAME OS = platform.system() # make name lowercase for Linux/Unix if OS not in ['Windows', 'Darwin']: if OS == 'Linux': DIST, DIST_VERSION, DIST_NAME = get_distro() # platform.dist() returns "('', '', '')" on FreeBSD elif OS == 'FreeBSD': DIST, DIST_VERSION, DIST_NAME = ('', '', '') else: DIST, DIST_VERSION, DIST_NAME = platform.dist() NAME = NAME.lower() VERSION = AppInfo.VERSION.replace('-', '.') + '.' + DIST + DIST_VERSION NAGSTAMON_SCRIPT = 'nagstamon.py' from setuptools import setup os_dependent_include_files = ['Nagstamon/resources'] executables = [] if os.path.exists('nagstamon'): NAGSTAMON_SCRIPT = 'nagstamon'