Forgot to provide defaults to both versions of this function
[gc-dialer] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import sys
5 reload(sys).setdefaultencoding("UTF-8")
6 import os
7
8 try:
9         from sdist_maemo import sdist_maemo as _sdist_maemo
10         sdist_maemo = _sdist_maemo
11 except ImportError:
12         sdist_maemo = None
13         print 'sdist_maemo command not available'
14
15 from distutils.core import setup
16
17
18 #[[[cog
19 #       import cog
20 #       from dialcentral import constants
21 #       cog.outl('APP_NAME="%s"' % constants.__app_name__)
22 #       cog.outl('PRETTY_APP_NAME="%s"' % constants.__pretty_app_name__)
23 #       cog.outl('VERSION="%s"' % constants.__version__)
24 #       cog.outl('BUILD="%s"' % constants.__build__)
25 #       cog.outl('DESKTOP_FILE_PATH="%s"' % DESKTOP_FILE_PATH)
26 #       cog.outl('INPUT_DESKTOP_FILE="%s"' % INPUT_DESKTOP_FILE)
27 #       cog.outl('ICON_CATEGORY="%s"' % ICON_CATEGORY)
28 #       cog.outl('ICON_SIZES=[%s]' % ICON_SIZES)
29 #]]]
30 APP_NAME="dialcentral"
31 PRETTY_APP_NAME="DialCentral"
32 VERSION="1.3.6"
33 BUILD="0"
34 DESKTOP_FILE_PATH="/usr/share/applications"
35 INPUT_DESKTOP_FILE="data/ubuntu/dialcentral.desktop"
36 ICON_CATEGORY="apps"
37 ICON_SIZES=[32,48]
38 #[[[end]]] (checksum: 6b362845c8509854ec12f330afd9c7b7)
39
40 CHANGES = """* Fixing broadcast messages from the Message tab
41 * Making it more consistent on what numbers are shown
42 """.strip()
43 BUGTRACKER_URL = "https://bugs.maemo.org/enter_bug.cgi?product=Dialcentral"
44
45
46 def is_package(path):
47         return (
48                 os.path.isdir(path) and
49                 os.path.isfile(os.path.join(path, '__init__.py'))
50         )
51
52
53 def find_packages(path, base="", includeRoot=False):
54         """ Find all packages in path """
55         if includeRoot:
56                 assert not base, "Base not supported with includeRoot: %r" % base
57                 rootPath, module_name = os.path.split(path)
58                 yield module_name
59                 base = module_name
60         for item in os.listdir(path):
61                 dir = os.path.join(path, item)
62                 if is_package( dir ):
63                         if base:
64                                 module_name = "%(base)s.%(item)s" % vars()
65                         else:
66                                 module_name = item
67                         yield module_name
68                         for mname in find_packages(dir, module_name):
69                                 yield mname
70
71
72 setup(
73         name=APP_NAME,
74         version=VERSION,
75         description="Touch screen enhanced interface to the GoogleVoice phone service",
76         long_description="Touch screen enhanced interface to the GoogleVoice phone service",
77         author="Ed Page",
78         author_email="eopage@byu.net",
79         maintainer="Ed Page",
80         maintainer_email="eopage@byu.net",
81         url="http://wiki.maemo.org/DialCentral",
82         license="GNU LGPLv2.1",
83         scripts=[
84                 "DialCentral",
85         ],
86         packages=list(find_packages(APP_NAME, includeRoot=True)),
87         package_data={
88                 "dialcentral": ["data/*.wav", "data/*.png"],
89         },
90         data_files=[
91                 (DESKTOP_FILE_PATH, [INPUT_DESKTOP_FILE]),
92                 ("/usr/share/icons/hicolor/scalable/apps", ["data/%s.svg" % APP_NAME]),
93         ] +
94         [
95                 (
96                         "/usr/share/icons/hicolor/%sx%s/%s" % (size, size, ICON_CATEGORY),
97                         ["data/icons/%s/%s.png" % (size, APP_NAME)]
98                 )
99                 for size in ICON_SIZES
100         ],
101         requires=[
102                 "PySide",
103                 "xml",
104         ],
105         cmdclass={
106                 'sdist_ubuntu': sdist_maemo,
107                 'sdist_diablo': sdist_maemo,
108                 'sdist_fremantle': sdist_maemo,
109                 'sdist_harmattan': sdist_maemo,
110         },
111         options={
112                 "sdist_ubuntu": {
113                         "debian_package": APP_NAME,
114                         "section": "comm",
115                         "copyright": "lgpl",
116                         "changelog": CHANGES,
117                         "buildversion": str(BUILD),
118                         "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-xdg, python-dbus, python-gst0.10",
119                         "architecture": "any",
120                 },
121                 "sdist_diablo": {
122                         "debian_package": APP_NAME,
123                         "Maemo_Display_Name": PRETTY_APP_NAME,
124                         #"Maemo_Upgrade_Description": CHANGES,
125                         "Maemo_Bugtracker": BUGTRACKER_URL,
126                         "Maemo_Icon_26": "data/icons/26/%s.png" % APP_NAME,
127                         "section": "user/network",
128                         "copyright": "lgpl",
129                         "changelog": CHANGES,
130                         "buildversion": str(BUILD),
131                         "depends": "python2.5, python2.5-qt4-core, python2.5-qt4-gui, python-xdg, python-simplejson, python-xml | python2.5-xml, python-dbus | python2.5-dbus",
132                         "architecture": "any",
133                 },
134                 "sdist_fremantle": {
135                         "debian_package": APP_NAME,
136                         "Maemo_Display_Name": PRETTY_APP_NAME,
137                         #"Maemo_Upgrade_Description": CHANGES,
138                         "Maemo_Bugtracker": BUGTRACKER_URL,
139                         "Maemo_Icon_26": "data/icons/48/%s.png" % APP_NAME,
140                         "section": "user/network",
141                         "copyright": "lgpl",
142                         "changelog": CHANGES,
143                         "buildversion": str(BUILD),
144                         "depends": "python2.5, python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5, python-xdg, python-simplejson, python-xml | python2.5-xml, python-dbus | python2.5-dbus",
145                         #"depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-pyside.qtmaemo5, python-xdg, python-simplejson, python-gst0.10, python-xml | python2.5-xml, python-dbus | python2.5-dbus",
146                         "architecture": "any",
147                 },
148                 "sdist_harmattan": {
149                         "debian_package": APP_NAME,
150                         "Maemo_Display_Name": PRETTY_APP_NAME,
151                         #"Maemo_Upgrade_Description": CHANGES,
152                         "Maemo_Bugtracker": BUGTRACKER_URL,
153                         "Maemo_Icon_26": "data/icons/48/%s.png" % APP_NAME,
154                         "MeeGo_Desktop_Entry_Filename": APP_NAME,
155                         #"MeeGo_Desktop_Entry": "",
156                         "section": "user/science",
157                         "copyright": "lgpl",
158                         "changelog": CHANGES,
159                         "buildversion": str(BUILD),
160                         "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-xdg",
161                         "architecture": "any",
162                 },
163                 "bdist_rpm": {
164                         "requires": "REPLACEME",
165                         "icon": "data/icons/48/%s.png" % APP_NAME,
166                         "group": "REPLACEME",
167                 },
168         },
169 )