9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """A Touch Screen Optimized RPN Calculator using Pie Menus
16 RPN: Stack based math, come on it is fun
17 Pie Menus: Press them or press-drag them
18 History: Its such a drag, so drag them around, delete them, etc
20 Homepage: http://ejpi.garage.maemo.org/
22 __author__ = "Ed Page"
23 __email__ = "eopage@byu.net"
24 __version__ = constants.__version__
25 __build__ = constants.__build__
28 * Fullscreen by Ctrl+Enter
29 * "Enter" in number entry causes a push
30 * Reversed stack order to be more proper
37 * Swapping the keyboard positions, seem more friendly to my thumb location this way
40 * Added +/-, !, sq, and sqrt functions
41 * Improved Documentation
42 * Copy of calculation result and the corresponding equation
46 * Experimenting with faster startup by including pyc files in package
47 * Minor tweaks and bug fixes
49 0.9.1 - "Laziness doesn't always pay off"
50 * Profiled the code with an especial focus on the pie menus
51 * Tried to reduce potential bugs with double clicks
52 * Fixed a visual artifact issue on popup
54 0.9.0 - "Feed is for horses, so what about feedback?"
55 * Initial public release
58 * Supports different number types and bases
63 __postinstall__ = """#!/bin/sh -e
65 gtk-update-icon-cache -f /usr/share/icons/hicolor
66 rm -f ~/.ejpi/ejpi.log
71 for root, dirs, files in os.walk(path):
73 if file.startswith("src-"):
74 fileParts = file.split("-")
75 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
76 assert unused == "src"
77 relPath = os.sep.join(relPathParts)
78 yield relPath, file, newName
81 def unflatten_files(files):
83 for relPath, oldName, newName in files:
86 d[relPath].append((oldName, newName))
90 def build_package(distribution):
92 os.chdir(os.path.dirname(sys.argv[0]))
96 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
97 p = py2deb.Py2deb(__appname__)
98 p.prettyName = constants.__pretty_app_name__
99 p.description = __description__
100 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
101 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
102 p.author = __author__
105 p.depends = ", ".join([
106 "python2.6 | python2.5",
107 "python-gtk2 | python2.5-gtk2",
108 "python-xml | python2.5-xml",
109 "python-dbus | python2.5-dbus",
111 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
113 "debian": ", python-glade2",
114 "chinook": maemoSpecificDepends,
115 "diablo": maemoSpecificDepends,
116 "fremantle": maemoSpecificDepends + ", python-glade2",
117 "mer": maemoSpecificDepends + ", python-glade2",
120 "debian": "accessories",
121 "chinook": "accessories",
122 "diablo": "user/science",
123 "fremantle": "user/science",
124 "mer": "user/science",
128 p.distribution = "chinook diablo fremantle mer debian"
129 p.repository = "extras"
130 p.changelog = __changelog__
131 p.postinstall = __postinstall__
133 "debian": "26x26-ejpi.png",
134 "chinook": "26x26-ejpi.png",
135 "diablo": "26x26-ejpi.png",
136 "fremantle": "64x64-ejpi.png", # Fremantle natively uses 48x48
137 "mer": "64x64-ejpi.png",
139 p["/usr/bin"] = [ "ejpi.py" ]
140 for relPath, files in unflatten_files(find_files(".")).iteritems():
141 fullPath = "/usr/lib/ejpi"
143 fullPath += os.sep+relPath
145 "|".join((oldName, newName))
146 for (oldName, newName) in files
148 p["/usr/share/applications/hildon"] = ["ejpi.desktop"]
149 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-ejpi.png|ejpi.png"]
150 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-ejpi.png|ejpi.png"]
151 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-ejpi.png|ejpi.png"]
155 version="%s-%s" % (__version__, __build__),
156 changelog=__changelog__,
162 print "Building for %s finished" % distribution
165 if __name__ == "__main__":
166 if len(sys.argv) > 1:
172 if optparse is not None:
173 parser = optparse.OptionParser()
174 (commandOptions, commandArgs) = parser.parse_args()
177 commandArgs = ["diablo"]
178 build_package(commandArgs[0])