forked from shlomif/PySolFC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
96 lines (85 loc) · 2.92 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
#!/usr/bin/env python
# -*- mode: python; -*-
import os
from distutils.core import setup
from pysollib.settings import VERSION
from pysollib.settings import PACKAGE_URL
if os.name == 'nt':
import py2exe # noqa: F401
if os.name == 'posix':
data_dir = 'share/PySolFC'
elif os.name == 'nt':
data_dir = 'data'
else:
data_dir = 'data'
ddirs = [
'html',
'images',
'sound',
'tiles',
'toolbar',
'themes',
'tcl',
]
for s in open('MANIFEST.in'):
if s.startswith('graft data/cardset-'):
ddirs.append(s[11:].strip())
data_files = []
for d in ddirs:
for root, dirs, files in os.walk(os.path.join('data', d)):
if root.find('.svn') >= 0:
continue
if files:
# files = map(lambda f: os.path.join(root, f), files)
files = [os.path.join(root, f) for f in files]
data_files.append((os.path.join(data_dir, root[5:]), files))
if os.name == 'posix':
data_files.append(('share/pixmaps', ['data/pysol.xbm', 'data/pysol.xpm']))
data_files.append(('share/icons',
['data/images/misc/pysol01.png',
'data/images/misc/pysol02.png', ]))
for l in ('ru', 'ru_RU'):
data_files.append(('share/locale/%s/LC_MESSAGES' % l,
['locale/%s/LC_MESSAGES/pysol.mo' % l]))
data_files.append((data_dir, ['data/pysolfc.glade']))
data_files.append(('share/applications', ['data/pysol.desktop']))
# from pprint import pprint; pprint(data_files)
# import sys; sys.exit()
long_description = '''\
PySolFC is a collection of more than 1000 solitaire card games.
Its features include modern look and feel (uses Tile widget set), multiple
cardsets and tableau backgrounds, sound, unlimited undo, player statistics,
a hint system, demo games, a solitaire wizard, support for user written
plug-ins, an integrated HTML help browser, and lots of documentation.
'''
kw = {
'name': 'PySolFC',
'version': VERSION,
'url': PACKAGE_URL,
'author': 'Skomoroh',
'author_email': 'skomoroh@gmail.com',
'description': 'a Python solitaire game collection',
'long_description': long_description,
'license': 'GPL',
'scripts': ['pysol.py'],
'packages': ['pysollib',
'pysollib.configobj',
'pysollib.macosx',
'pysollib.winsystems',
'pysollib.tk',
'pysollib.tile',
'pysollib.pysolgtk',
'pysollib.ui',
'pysollib.ui.tktile',
'pysollib.kivy',
'pysollib.games',
'pysollib.games.special',
'pysollib.games.ultra',
'pysollib.games.mahjongg'],
'data_files': data_files,
}
if os.name == 'nt':
kw['windows'] = [{'script': 'pysol.py',
'icon_resources': [(1, 'data/pysol.ico')], }]
kw['packages'].remove('pysollib.pysolgtk')
setup(**kw)