forked from tstriker/apx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·71 lines (59 loc) · 2.24 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
#!/usr/bin/env %{__python2}
# - coding: utf-8 -
import distutils.command.build_py
import distutils.command.install
import os
import platform
import sys
from setuptools import setup
class install(distutils.command.install.install):
def finalize_options(self):
special_cases = ('debian', 'ubuntu')
if (platform.system() == 'Linux' and
platform.linux_distribution()[0].lower() in special_cases):
# Maintain an explicit install-layout, but use deb by default
specified_layout = getattr(self, 'install_layout', None)
self.install_layout = specified_layout or 'deb'
distutils.command.install.install.finalize_options(self)
class build_py(distutils.command.build_py.build_py):
"""Insert real package installation locations into conf module
snatched from meld
"""
def build_module(self, module, module_file, package):
if module_file == 'apx/conf.py':
datadir = os.path.join(sys.prefix, 'share', 'apx')
with open(module_file, 'w') as f:
f.write('DATA_DIR = "%s"' % datadir)
distutils.command.build_py.build_py.build_module(
self, module, module_file, package)
setup(
name = "apx",
version = "0.1",
author = "Toms Bauģis",
author_email = "[email protected]",
description = "A playful QIX clone.",
license = "MIT",
keywords = "game arcade python",
url = "https://github.com/projecthamster/apx",
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: X11 Applications :: GTK",
"Intended Audience :: End Users/Desktop",
"Topic :: Games/Entertainment",
"License :: OSI Approved :: MIT License",
],
packages=['apx', 'apx.lib'],
scripts=['bin/apx'],
data_files= [
('share/icons/hicolor/scalable', ['data/apx.svg']),
('share/fonts/04b03', ['data/04b03.ttf', 'data/04b03_LICENSE',]),
('share/apx', ['data/apx.sqlite']),
('share/appdata', ['data/apx.appdata.xml']),
('share/applications', ['data/apx.desktop']),
],
cmdclass={
"build_py": build_py,
"install": install,
},
)