forked from HenriWahl/Nagstamon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
152 lines (134 loc) · 5.66 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env python3
# encoding: utf-8
# Nagstamon - Nagios status monitor for your desktop
# Copyright (C) 2008-2016 Henri Wahl <[email protected]> et al.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
# from distutils.core import setup
import sys
import platform
import os.path
from Nagstamon.Config import AppInfo
# dummy debug queue for compiling
debug_queue = list()
NAME = AppInfo.NAME
# make name lowercase for Linux/Unix
if platform.system() not in ['Windows', 'Darwin']:
NAME = NAME.lower()
VERSION = AppInfo.VERSION
NAGSTAMON_SCRIPT = 'nagstamon.py'
# workaround to get directory of Qt5 plugins to add missing 'mediaservice' folder needed for audio on OSX and Windows
from PyQt5 import QtCore
if platform.system() == 'Windows':
QTPLUGINS = os.path.join(os.path.dirname(QtCore.__file__), 'plugins')
elif platform.system() == 'Darwin':
# works of course only with Fink-based Qt5-installation
QTPLUGINS = '/sw/lib/qt5-mac/plugins'
if platform.system() == 'Windows':
base = 'Win32GUI'
else:
base = None
if platform.system() in ('Windows', 'Darwin'):
from cx_Freeze import setup, Executable
os_dependent_include_files = ['Nagstamon/resources/qt.conf',
'Nagstamon/resources',
'{0}/mediaservice'.format(QTPLUGINS)]
executables = [
Executable(NAGSTAMON_SCRIPT,
base=base,
icon='Nagstamon/resources/nagstamon.ico')
]
else:
from setuptools import setup
os_dependent_include_files = ['Nagstamon/resources']
executables = []
if os.path.exists('nagstamon'):
NAGSTAMON_SCRIPT = 'nagstamon'
CLASSIFIERS = [
'Intended Audience :: System Administrators',
'Development Status :: 5 - Production/Stable',
'Environment :: Win32 (MS Windows)',
'Environment :: X11 Applications',
'Environment :: MacOS X',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX',
'Natural Language :: English',
'Programming Language :: Python',
'Topic :: System :: Monitoring',
'Topic :: System :: Networking :: Monitoring'
]
# Dependencies are automatically detected, but it might need
# fine tuning.
build_exe_options = dict(packages=['PyQt5.QtNetwork',
'keyring.backends.kwallet',
'keyring.backends.OS_X',
'keyring.backends.SecretService',
'keyring.backends.Windows'],
include_files=os_dependent_include_files,
include_msvcr=True,
excludes=[])
bdist_mac_options = dict(iconfile='Nagstamon/resources/nagstamon.icns',
custom_info_plist='Nagstamon/resources/Info.plist')
bdist_dmg_options = dict(volume_label='{0} {1}'.format(NAME, VERSION),
applications_shortcut=False)
bdist_rpm_options = dict(requires='python3 '
'python3-qt5 '
'python3-beautifulsoup4 '
'python3-requests '
'python3-requests-kerberos '
'python3-qt5 '
'python3-SecretStorage '
'python3-crypto '
'python3-cryptography '
'python3-psutil '
'qt5-qtsvg '
'qt5-qtmultimedia ',
dist_dir='./build')
setup(name=NAME,
version=VERSION,
license='GNU GPL v2',
description='Nagios status monitor for desktop',
long_description='Nagstamon is a Nagios status monitor which takes place in systray or on desktop (GNOME, KDE, Windows) as floating statusbar to inform you in realtime about the status of your Nagios and derivatives monitored network. It allows to connect to multiple Nagios, Icinga, Opsview, Op5Monitor, Check_MK/Multisite, Centreon and Thruk servers.',
classifiers=CLASSIFIERS,
author='Henri Wahl',
author_email='[email protected]',
url='https://nagstamon.ifw-dresden.de',
download_url='https://nagstamon.ifw-dresden.de/files-nagstamon/stable/',
scripts=[NAGSTAMON_SCRIPT],
packages=['Nagstamon',
'Nagstamon.QUI',
'Nagstamon.Servers',
'Nagstamon.thirdparty',
'Nagstamon.thirdparty.Xlib',
'Nagstamon.thirdparty.Xlib.ext',
'Nagstamon.thirdparty.Xlib.protocol',
'Nagstamon.thirdparty.Xlib.support',
'Nagstamon.thirdparty.Xlib.xobject',
'Nagstamon.thirdparty.keyring',
'Nagstamon.thirdparty.keyring.backends',
'Nagstamon.thirdparty.keyring.util'],
package_dir={'Nagstamon': 'Nagstamon'},
package_data={'Nagstamon': ['resources/*']},
data_files=[('%s/share/man/man1' % sys.prefix, ['Nagstamon/resources/nagstamon.1.gz']),
('%s/share/pixmaps' % sys.prefix, ['Nagstamon/resources/nagstamon.svg']),
('%s/share/applications' % sys.prefix, ['Nagstamon/resources/nagstamon.desktop'])],
options=dict(build_exe=build_exe_options,
bdist_mac=bdist_mac_options,
bdist_dmg=bdist_dmg_options,
bdist_rpm=bdist_rpm_options),
executables=executables
)