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__
31 * Added shortcut to copy result
32 * Shortcuts: Backspace - as expected, Ctrl+Backspace - unpops, Enter - pops
33 * BugFix: Attempt two at bigger X button
34 * Bugfix: Inconsistent location of pie items on the computer section
35 * Added support for creating .deb generic linux package files
38 * Fullscreen by Ctrl+Enter
39 * "Enter" in number entry causes a push
40 * Reversed stack order to be more proper
41 * Logging support, Ctrl+l to copy the log
47 * Swapping the keyboard positions, seem more friendly to my thumb location this way
50 * Added +/-, !, sq, and sqrt functions
51 * Improved Documentation
52 * Copy of calculation result and the corresponding equation
56 * Experimenting with faster startup by including pyc files in package
57 * Minor tweaks and bug fixes
59 0.9.1 - "Laziness doesn't always pay off"
60 * Profiled the code with an especial focus on the pie menus
61 * Tried to reduce potential bugs with double clicks
62 * Fixed a visual artifact issue on popup
64 0.9.0 - "Feed is for horses, so what about feedback?"
65 * Initial public release
68 * Supports different number types and bases
73 __postinstall__ = """#!/bin/sh -e
75 gtk-update-icon-cache -f /usr/share/icons/hicolor
76 rm -f ~/.ejpi/ejpi.log
81 for root, dirs, files in os.walk(path):
83 if file.startswith("src-"):
84 fileParts = file.split("-")
85 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
86 assert unused == "src"
87 relPath = os.sep.join(relPathParts)
88 yield relPath, file, newName
91 def unflatten_files(files):
93 for relPath, oldName, newName in files:
96 d[relPath].append((oldName, newName))
100 def build_package(distribution):
102 os.chdir(os.path.dirname(sys.argv[0]))
106 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
107 p = py2deb.Py2deb(__appname__)
108 p.prettyName = constants.__pretty_app_name__
109 p.description = __description__
110 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
111 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
112 p.author = __author__
115 p.depends = ", ".join([
116 "python2.6 | python2.5",
117 "python-gtk2 | python2.5-gtk2",
118 "python-xml | python2.5-xml",
119 "python-dbus | python2.5-dbus",
121 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
123 "debian": ", python-glade2",
124 "chinook": maemoSpecificDepends,
125 "diablo": maemoSpecificDepends,
126 "fremantle": maemoSpecificDepends + ", python-glade2",
127 "mer": maemoSpecificDepends + ", python-glade2",
131 "chinook": "accessories",
132 "diablo": "user/science",
133 "fremantle": "user/science",
134 "mer": "user/science",
138 p.distribution = "chinook diablo fremantle mer debian"
139 p.repository = "extras"
140 p.changelog = __changelog__
141 p.postinstall = __postinstall__
143 "debian": "26x26-ejpi.png",
144 "chinook": "26x26-ejpi.png",
145 "diablo": "26x26-ejpi.png",
146 "fremantle": "64x64-ejpi.png", # Fremantle natively uses 48x48
147 "mer": "64x64-ejpi.png",
149 p["/usr/bin"] = [ "ejpi.py" ]
150 for relPath, files in unflatten_files(find_files(".")).iteritems():
151 fullPath = "/usr/lib/ejpi"
153 fullPath += os.sep+relPath
155 "|".join((oldName, newName))
156 for (oldName, newName) in files
158 p["/usr/share/applications/hildon"] = ["ejpi.desktop"]
159 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-ejpi.png|ejpi.png"]
160 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-ejpi.png|ejpi.png"]
161 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-ejpi.png|ejpi.png"]
163 if distribution == "debian":
166 version="%s-%s" % (__version__, __build__),
167 changelog=__changelog__,
173 print "Building for %s finished" % distribution
177 version="%s-%s" % (__version__, __build__),
178 changelog=__changelog__,
184 print "Building for %s finished" % distribution
187 if __name__ == "__main__":
188 if len(sys.argv) > 1:
194 if optparse is not None:
195 parser = optparse.OptionParser()
196 (commandOptions, commandArgs) = parser.parse_args()
199 commandArgs = ["diablo"]
200 build_package(commandArgs[0])