Removing the scalable icon to try to fix icon issues and some misc cleanup
[ejpi] / 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 ejpi 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="ejpi"
31 PRETTY_APP_NAME="e**(j pi) + 1 = 0"
32 VERSION="0.1.0"
33 BUILD=0
34 DESKTOP_FILE_PATH="/usr/share/applications"
35 INPUT_DESKTOP_FILE="data/harmattan/ejpi.desktop"
36 ICON_CATEGORY="hildon"
37 ICON_SIZES=[32,80]
38 #[[[end]]]
39
40 CHANGES = """Switching from py2deb.py to sdist_maemo
41 """.strip()
42 BUGTRACKER_URL = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
43
44
45 def is_package(path):
46         return (
47                 os.path.isdir(path) and
48                 os.path.isfile(os.path.join(path, '__init__.py'))
49         )
50
51
52 def find_packages(path, base="", includeRoot=False):
53         """ Find all packages in path """
54         if includeRoot:
55                 assert not base, "Base not supported with includeRoot: %r" % base
56                 rootPath, module_name = os.path.split(path)
57                 yield module_name
58                 base = module_name
59         for item in os.listdir(path):
60                 dir = os.path.join(path, item)
61                 if is_package( dir ):
62                         if base:
63                                 module_name = "%(base)s.%(item)s" % vars()
64                         else:
65                                 module_name = item
66                         yield module_name
67                         for mname in find_packages(dir, module_name):
68                                 yield mname
69
70
71 setup(
72         name=APP_NAME,
73         version=VERSION,
74         description="RPN calculator designed for touchscreens",
75         long_description="RPN calculator designed for touchscreens",
76         author="Ed Page",
77         author_email="eopage@byu.net",
78         maintainer="Ed Page",
79         maintainer_email="eopage@byu.net",
80         url="http://ejpi.garage.maemo.org/",
81         license="GNU LGPLv2.1",
82         scripts=[
83                 "ejpi-calc",
84         ],
85         packages=list(find_packages(APP_NAME, includeRoot=True)),
86         package_data={
87                 "ejpi.plugins": ["*.ini", "images/*.png"],
88         },
89         data_files=[
90                 (DESKTOP_FILE_PATH, [INPUT_DESKTOP_FILE]),
91         ] +
92         [
93                 (
94                         "/usr/share/icons/hicolor/%sx%s/%s" % (size, size, ICON_CATEGORY),
95                         ["data/icons/%s/%s.png" % (size, APP_NAME)]
96                 )
97                 for size in ICON_SIZES
98         ],
99         requires=[
100                 "PySide",
101         ],
102         cmdclass={
103                 'sdist_ubuntu': sdist_maemo,
104                 'sdist_diablo': sdist_maemo,
105                 'sdist_fremantle': sdist_maemo,
106                 'sdist_harmattan': sdist_maemo,
107         },
108         options={
109                 "sdist_ubuntu": {
110                         "debian_package": APP_NAME,
111                         "section": "math",
112                         "copyright": "lgpl",
113                         "changelog": CHANGES,
114                         "buildversion": str(BUILD),
115                         "depends": "python, python-pyside.qtcore, python-pyside.qtgui",
116                         "architecture": "any",
117                 },
118                 "sdist_diablo": {
119                         "debian_package": APP_NAME,
120                         "Maemo_Display_Name": PRETTY_APP_NAME,
121                         #"Maemo_Upgrade_Description": CHANGES,
122                         "Maemo_Bugtracker": BUGTRACKER_URL,
123                         "Maemo_Icon_26": "data/icons/26/%s.png" % APP_NAME,
124                         "section": "user/science",
125                         "copyright": "lgpl",
126                         "changelog": CHANGES,
127                         "buildversion": str(BUILD),
128                         "depends": "python2.5, python2.5-qt4-core, python2.5-qt4-gui",
129                         "architecture": "any",
130                 },
131                 "sdist_fremantle": {
132                         "debian_package": APP_NAME,
133                         "Maemo_Display_Name": PRETTY_APP_NAME,
134                         #"Maemo_Upgrade_Description": CHANGES,
135                         "Maemo_Bugtracker": BUGTRACKER_URL,
136                         "Maemo_Icon_26": "data/icons/48/%s.png" % APP_NAME,
137                         "section": "user/science",
138                         "copyright": "lgpl",
139                         "changelog": CHANGES,
140                         "buildversion": str(BUILD),
141                         "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-pyside.qtmaemo5",
142                         "architecture": "any",
143                 },
144                 "sdist_harmattan": {
145                         "debian_package": APP_NAME,
146                         "Maemo_Display_Name": PRETTY_APP_NAME,
147                         #"Maemo_Upgrade_Description": CHANGES,
148                         "Maemo_Bugtracker": BUGTRACKER_URL,
149                         "Maemo_Icon_26": "data/icons/48/%s.png" % APP_NAME,
150                         "MeeGo_Desktop_Entry_Filename": APP_NAME,
151                         #"MeeGo_Desktop_Entry": "",
152                         "section": "user/science",
153                         "copyright": "lgpl",
154                         "changelog": CHANGES,
155                         "buildversion": str(BUILD),
156                         "depends": "python, python-pyside.qtcore, python-pyside.qtgui",
157                         "architecture": "any",
158                 },
159                 "bdist_rpm": {
160                         "requires": "REPLACEME",
161                         "icon": "data/icons/48/%s.png" % APP_NAME,
162                         "group": "REPLACEME",
163                 },
164         },
165 )