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 * Added shortcut to copy result
29 * Shortcuts: Backspace - as expected, Ctrl+Backspace - unpops, Enter - pops
30 * BugFix: Attempt two at bigger X button
31 * Bugfix: Inconsistent location of pie items on the computer section
32 * Added support for creating .deb generic linux package files
35 * Fullscreen by Ctrl+Enter
36 * "Enter" in number entry causes a push
37 * Reversed stack order to be more proper
38 * Logging support, Ctrl+l to copy the log
44 * Swapping the keyboard positions, seem more friendly to my thumb location this way
47 * Added +/-, !, sq, and sqrt functions
48 * Improved Documentation
49 * Copy of calculation result and the corresponding equation
53 * Experimenting with faster startup by including pyc files in package
54 * Minor tweaks and bug fixes
56 0.9.1 - "Laziness doesn't always pay off"
57 * Profiled the code with an especial focus on the pie menus
58 * Tried to reduce potential bugs with double clicks
59 * Fixed a visual artifact issue on popup
61 0.9.0 - "Feed is for horses, so what about feedback?"
62 * Initial public release
65 * Supports different number types and bases
70 __postinstall__ = """#!/bin/sh -e
72 gtk-update-icon-cache -f /usr/share/icons/hicolor
73 rm -f ~/.ejpi/ejpi.log
78 for root, dirs, files in os.walk(path):
80 if file.startswith("src-"):
81 fileParts = file.split("-")
82 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
83 assert unused == "src"
84 relPath = os.sep.join(relPathParts)
85 yield relPath, file, newName
88 def unflatten_files(files):
90 for relPath, oldName, newName in files:
93 d[relPath].append((oldName, newName))
97 def build_package(distribution):
99 os.chdir(os.path.dirname(sys.argv[0]))
103 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
104 p = py2deb.Py2deb(__appname__)
105 p.prettyName = constants.__pretty_app_name__
106 p.description = __description__
107 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
108 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
109 p.author = __author__
112 p.depends = ", ".join([
113 "python2.6 | python2.5",
114 "python-gtk2 | python2.5-gtk2",
115 "python-xml | python2.5-xml",
116 "python-dbus | python2.5-dbus",
118 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
120 "debian": ", python-glade2",
121 "chinook": maemoSpecificDepends,
122 "diablo": maemoSpecificDepends,
123 "fremantle": maemoSpecificDepends + ", python-glade2",
124 "mer": maemoSpecificDepends + ", python-glade2",
128 "chinook": "accessories",
129 "diablo": "user/science",
130 "fremantle": "user/science",
131 "mer": "user/science",
135 p.distribution = "chinook diablo fremantle mer debian"
136 p.repository = "extras"
137 p.changelog = __changelog__
138 p.postinstall = __postinstall__
140 "debian": "26x26-ejpi.png",
141 "chinook": "26x26-ejpi.png",
142 "diablo": "26x26-ejpi.png",
143 "fremantle": "64x64-ejpi.png", # Fremantle natively uses 48x48
144 "mer": "64x64-ejpi.png",
146 p["/usr/bin"] = [ "ejpi.py" ]
147 for relPath, files in unflatten_files(find_files(".")).iteritems():
148 fullPath = "/usr/lib/ejpi"
150 fullPath += os.sep+relPath
152 "|".join((oldName, newName))
153 for (oldName, newName) in files
155 p["/usr/share/applications/hildon"] = ["ejpi.desktop"]
156 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-ejpi.png|ejpi.png"]
157 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-ejpi.png|ejpi.png"]
158 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-ejpi.png|ejpi.png"]
160 if distribution == "debian":
163 version="%s-%s" % (__version__, __build__),
164 changelog=__changelog__,
170 print "Building for %s finished" % distribution
174 version="%s-%s" % (__version__, __build__),
175 changelog=__changelog__,
181 print "Building for %s finished" % distribution
184 if __name__ == "__main__":
185 if len(sys.argv) > 1:
191 if optparse is not None:
192 parser = optparse.OptionParser()
193 (commandOptions, commandArgs) = parser.parse_args()
196 commandArgs = ["diablo"]
197 build_package(commandArgs[0])