forked from ham-radio-software/D-Rats
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·75 lines (60 loc) · 2.55 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
'''Python setup.py.'''
# Copyright 2008 Dan Smith <[email protected]>
# review 2015-2020 Maurizio Andreotti <[email protected]>
# Copyright 2022-2023 John. E. Malmberg - Python3 Conversion
#
# 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 3 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
from os.path import dirname
from glob import glob
from setuptools import setup
def default_build():
'''Default Build.'''
data_files = []
section_files = glob("share/*.desktop")
data_files.append(('share/applications', section_files))
data_files.append(('share/pixmaps/', ['share/d-rats2.xpm']))
section_files = glob("forms/*.x?l")
data_files.append(('share/d-rats/forms', section_files))
section_files = glob("images/*")
section_files.append("share/d-rats2.xpm")
data_files.append(('share/d-rats/images', section_files))
ui_files = ['ui/addport.glade', 'ui/mainwindow.glade']
data_files.append(('share/d-rats/ui', ui_files))
section_files = ['COPYING']
data_files.append(('share/doc/d-rats/', section_files))
section_files = ['share/d-rats.py.1.gz', 'share/d-rats_repeater.py.1.gz']
data_files.append(('share/man/man1', section_files))
locale_mo_files = glob("locale/*/LC_MESSAGES/D-RATS.mo")
mo_prefix = 'share/d-rats/'
for file_name in locale_mo_files:
data_files.append((mo_prefix + dirname(file_name), [file_name]))
version = '0.0.0'
with open('d_rats/setup_version.py', 'r') as version_file:
lines = version_file.readlines()
for line in lines:
line = line.strip()
if line.startswith('#'):
continue
parts = line.split()
if parts[0] != "SETUP_VERSION":
continue
version = parts[2].strip('"')
setup(name='D-Rats',
version=version,
scripts=['d-rats.py', 'd-rats_repeater.py'],
data_files=data_files)
print("The setup.py is only used in building a pip installable tarball.")
print("The setup.py is not used for actually installing d-rats" +
"and will not work.")
default_build()