forked from foobnix/foobnix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·125 lines (104 loc) · 3.59 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
#!/usr/bin/env python
import os
import glob
import shutil
from distutils.core import setup, Command
from test.all import run_all_tests
if os.name == 'nt':
import py2exe #@UnresolvedImport @UnusedImport
from foobnix.version import FOOBNIX_VERSION
VERSION = FOOBNIX_VERSION
data_files = [
('share/applications', glob.glob('share/applications/*.desktop')),
('share/pixmaps', glob.glob('share/pixmaps/*.*')),
('share/foobnix/images', glob.glob('share/foobnix/images/*.*')),
('share/foobnix/images/theme', glob.glob('share/foobnix/images/theme/*.*')),
('share/foobnix/radio', glob.glob('share/foobnix/radio/*.*')),
('share/man/man1', glob.glob('docs/*')),
]
MO_DIR = "dist/"
if os.path.exists(MO_DIR):
shutil.rmtree(MO_DIR)
if os.name != 'nt':
LANGS = glob.glob("po/*.po")
if not os.path.exists(MO_DIR):
os.mkdir(MO_DIR)
for lang in LANGS:
lang = lang.replace(".po", "")
lang = lang.replace("po/", "")
if not os.path.exists(MO_DIR + 'share/locale/%s/LC_MESSAGES' % lang):
os.makedirs(MO_DIR + 'share/locale/%s/LC_MESSAGES' % lang)
mofile = MO_DIR + 'share/locale/%s/LC_MESSAGES/foobnix.mo' % lang
pofile = "po/" + lang + ".po"
os.system("msgfmt %s -o %s" % (pofile, mofile))
data_files.append(('share/locale/%s/LC_MESSAGES' % lang, [mofile]))
#data_files.append(('/usr/share/locale/%s/LC_MESSAGES' % lang, ['mo/%s/foobnix.mo' % lang]))
version = open("foobnix/version.py", "wt")
version.write("FOOBNIX_VERSION='%s'" % VERSION)
version.close()
shutil.copyfile("foobnix.py", "foobnix/foobnix")
class test_cmd(Command):
description = "run automated tests"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if not run_all_tests():
raise SystemExit("Test failures are listed above.")
setup(name='foobnix',
version=VERSION,
license="GNU GPLv3",
description='Foobnix GTK+ music player',
author='Ivan Ivanenko',
author_email='ivan.ivanenko@gmail.com',
url='www.foobnix.com',
classifiers=[
'Development Status :: Beta',
'Environment :: X11 Applications',
'Intended Audience :: End Users/Desktop',
'License :: GNU General Public License (GPL)',
'Operating System :: Linux',
'Programming Language :: Python',
'Topic :: Multimedia :: Sound :: Players',
],
packages=[
"foobnix",
"foobnix.dm",
"foobnix.eq",
"foobnix.fc",
"foobnix.helpers",
"foobnix.playlists",
"foobnix.preferences",
"foobnix.preferences.configs",
"foobnix.gui",
"foobnix.gui.about",
"foobnix.gui.controls",
"foobnix.gui.engine",
"foobnix.gui.model",
"foobnix.gui.notetab",
"foobnix.gui.perspectives",
"foobnix.gui.service",
"foobnix.gui.treeview",
"foobnix.thirdparty",
"foobnix.util",
],
scripts=['foobnix/foobnix'],
cmdclass={"test": test_cmd},
data_files=data_files,
windows=[
{
"script": "foobnix.py",
"icon_resources": [(0, os.path.join('foobnix', 'pixmaps', 'foobnix.ico'))]
}],
options={
'py2exe': {
'includes': ('cairo, pango, pangocairo, atk, gio, pygst, gst, simplejson, chardet')
}
}
)
if os.name != 'nt':
os.remove("foobnix/foobnix")
if os.path.exists("build"):
shutil.rmtree("build")