-
Notifications
You must be signed in to change notification settings - Fork 301
/
setup.py
executable file
·75 lines (67 loc) · 2.51 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2011 VPAC <http://www.vpac.org>
# Copyright 2012-2024 Marcus Furlong <[email protected]>
#
# 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, version 3 only.
#
# 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, see <https://www.gnu.org/licenses/>
import os
import sys
from setuptools import setup, find_packages
with open('VERSION.txt', 'r', encoding='utf_8') as v:
version = v.readline().strip()
with open('README.md', 'r', encoding='utf_8') as r:
long_description = r.read()
with open('requirements.txt', 'r', encoding='utf_8') as rt:
install_requires = rt.read().splitlines()
package_files = []
for directory in ['openvpn_monitor/static', 'openvpn_monitor/templates']:
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
trimmed_path = path.replace('openvpn_monitor/', '')
package_files.append(os.path.join(trimmed_path, filename))
if sys.prefix == '/usr':
conf_path = '/etc'
else:
conf_path = sys.prefix
data_files = []
for dirpath, dirnames, filenames in os.walk('etc'):
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'):
del dirnames[i]
if filenames:
data_files.append(
['/etc/openvpn-monitor', [os.path.join(dirpath, f) for f in filenames]]
)
setup(
name='openvpn-monitor',
version=version,
author='Marcus Furlong',
author_email='[email protected]',
description=('A simple web based openvpn monitor'),
license='GPLv3',
keywords='web openvpn monitor',
url='http://openvpn-monitor.openbytes.ie',
packages=find_packages(),
package_data={'openvpn_monitor': package_files},
install_requires=install_requires,
long_description=long_description,
long_description_content_type='text/markdown',
data_files=data_files,
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
],
)