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
|
# !/usr/bin/python
# -*- coding: utf-8 -*-
# Glitter Toolkit
__authors__ = ["Jan Jokela <janjokela@gmail.com>"]
__licenses__ = ["LICENSE.LGPL"]
__description__ = "distutils setup script"
""" Setup script
For a system-wide installation of glitter run
'(sudo) python setup.py install'
For help run
'python setup.py --help'
"""
import sys
import os
from distutils.core import setup
if sys.version_info < (2, 5):
sys.stderr.write("[ERROR] Python version not supported. 2.5+ required\n")
sys.exit(1)
import glitter
META_DATA = {
'name': 'Glitter',
'version': glitter.__version__,
'author': 'The Glitter Team',
'author_email': '',
'maintainer': 'Jan Jokela',
'maintainer_email': 'janjokela@gmail.com',
'url': 'http://www.glitter-toolkit.com/',
'description': 'Glitter User Interface Tookit',
'long_description': """Glitter is a widget toolkit written in python and
built on top of clutter. It offers breathtaking visuals,
resolution independence and for developers, a simple and
elegant GObject-based API similar to GTK.""",
'download_url': 'http://www.glitter-toolkit.com/',
'classifiers': [
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: X11 Applications',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU Library or Lesser General Public ' + \
'License (LGPL)',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
}
PACKAGES = {}
PACKAGE_DATA = {}
def get_package_data():
""" Run a recursive search through glitter/data and fetch package data to
be used by the distutils setup
"""
package_data = []
base_path = os.path.join(
os.path.dirname(os.path.abspath(glitter.__file__)),
'data'
)
for root, dirs, files in os.walk(base_path):
data_path = root[len(base_path):]
if not data_path:
data_path = 'data'
else:
data_path = ('data' + data_path)
for f in files:
ext = os.path.splitext(f)[1]
if ext in ['.py', '.conf', '.svg', '.json']:
data = data_path + '/*' + ext
if not data in package_data:
package_data.append(data)
return sorted(package_data)
PACKAGES['packages'] = ['glitter', 'glitter.tests']
PACKAGE_DATA['package_data'] = {'glitter': get_package_data()}
KWARGS = {}
KWARGS.update(META_DATA)
KWARGS.update(PACKAGES)
KWARGS.update(PACKAGE_DATA)
#print KWARGS
setup(**KWARGS)
|