forked from nicotine-plus/nicotine-plus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
134 lines (112 loc) · 3.18 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
#!/usr/bin/env python3
# COPYRIGHT (C) 2020 Nicotine+ Team
# COPYRIGHT (C) 2016-2017 Michael Labouebe <[email protected]>
# COPYRIGHT (C) 2009-2010 Quinox <[email protected]>
# COPYRIGHT (C) 2009 Hedonist <[email protected]>
# COPYRIGHT (C) 2006-2009 Daelstorm <[email protected]>
# COPYRIGHT (C) 2008-2009 eL_vErDe <[email protected]>
#
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
To install Nicotine+ on a GNU/Linux distribution run:
sudo python setup.py install
"""
import os
import glob
from pynicotine.utils import version
from setuptools import find_packages, setup
# Compute data_files
files = []
# Program icon
files.append(
(
"share/icons/hicolor/scalable/apps",
["files/org.nicotine_plus.Nicotine.svg"]
)
)
# Tray icons
tray_icons = glob.glob(os.path.join("img", "tray", "*"))
for icon_name in tray_icons:
files.append(
(
"share/icons/hicolor/32x32/apps",
[icon_name]
)
)
# Desktop file
files.append(
(
"share/applications",
["files/org.nicotine_plus.Nicotine.desktop"]
)
)
# AppStream metainfo
files.append(
(
"share/metainfo",
["files/appdata/org.nicotine_plus.Nicotine.appdata.xml"]
)
)
# Documentation
docfiles = glob.glob("[!404.md]*.md") + glob.glob(os.path.join("doc", "*.md"))
for doc in docfiles:
files.append(
(
"share/doc/nicotine",
[doc]
)
)
files.append(
(
"share/doc/nicotine",
["img/CREDITS.md"]
)
)
manpages = glob.glob(os.path.join("files", "*.1"))
for man in manpages:
files.append(
(
"share/man/man1",
[man]
)
)
# Translation
mo_dirs = [x for x in glob.glob(os.path.join("languages", "*")) if os.path.isdir(x)]
for mo in mo_dirs:
p, lang = os.path.split(mo)
lc_messages_path = os.path.join(mo, "LC_MESSAGES")
if lang in ("msgfmtall.py", "tr_gen.py", "mergeall", "nicotine.pot"):
continue
files.append(
(
os.path.join("share/locale", lang, "LC_MESSAGES"),
[os.path.join(lc_messages_path, "nicotine.mo")]
)
)
if __name__ == '__main__':
setup(
name="nicotine",
version=version,
license="GPLv3",
description="Nicotine+, a client for the Soulseek file sharing network.",
author="Nicotine+ Contributors",
url="https://nicotine-plus.org/",
packages=find_packages(exclude=['*test*']),
include_package_data=True,
scripts=['nicotine'],
data_files=files
)