9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """A Touch Screen Optimized RPN Calculator using Pie Menus
17 RPN: Stack based math, come on it is fun
19 Pie Menus: Press them or press-drag them
21 History: Its such a drag, so drag them around, delete them, etc
23 Homepage: http://ejpi.garage.maemo.org/
25 __author__ = "Ed Page"
26 __email__ = "eopage@byu.net"
27 __version__ = constants.__version__
28 __build__ = constants.__build__
34 * Added shortcut to copy result
35 * Shortcuts: Backspace - as expected, Ctrl+Backspace - unpops, Enter - pops
36 * BugFix: Attempt two at bigger X button
37 * Bugfix: Inconsistent location of pie items on the computer section
38 * Added support for creating .deb generic linux package files
41 * Fullscreen by Ctrl+Enter
42 * "Enter" in number entry causes a push
43 * Reversed stack order to be more proper
44 * Logging support, Ctrl+l to copy the log
50 * Swapping the keyboard positions, seem more friendly to my thumb location this way
53 * Added +/-, !, sq, and sqrt functions
54 * Improved Documentation
55 * Copy of calculation result and the corresponding equation
59 * Experimenting with faster startup by including pyc files in package
60 * Minor tweaks and bug fixes
62 0.9.1 - "Laziness doesn't always pay off"
63 * Profiled the code with an especial focus on the pie menus
64 * Tried to reduce potential bugs with double clicks
65 * Fixed a visual artifact issue on popup
67 0.9.0 - "Feed is for horses, so what about feedback?"
68 * Initial public release
71 * Supports different number types and bases
76 __postinstall__ = """#!/bin/sh -e
78 gtk-update-icon-cache -f /usr/share/icons/hicolor
79 rm -f ~/.ejpi/ejpi.log
84 for root, dirs, files in os.walk(path):
86 if file.startswith("src-"):
87 fileParts = file.split("-")
88 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
89 assert unused == "src"
90 relPath = os.sep.join(relPathParts)
91 yield relPath, file, newName
94 def unflatten_files(files):
96 for relPath, oldName, newName in files:
99 d[relPath].append((oldName, newName))
103 def build_package(distribution):
105 os.chdir(os.path.dirname(sys.argv[0]))
109 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
110 p = py2deb.Py2deb(__appname__)
111 p.prettyName = constants.__pretty_app_name__
112 p.description = __description__
113 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
114 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
115 p.author = __author__
118 p.depends = ", ".join([
119 "python2.6 | python2.5",
120 "python-gtk2 | python2.5-gtk2",
121 "python-xml | python2.5-xml",
122 "python-dbus | python2.5-dbus",
124 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
126 "debian": ", python-glade2",
127 "diablo": maemoSpecificDepends,
128 "fremantle": maemoSpecificDepends + ", python-glade2",
132 "diablo": "user/science",
133 "fremantle": "user/science",
137 p.distribution = "diablo fremantle debian"
138 p.repository = "extras"
139 p.changelog = __changelog__
140 p.postinstall = __postinstall__
142 "debian": "26x26-ejpi.png",
143 "diablo": "26x26-ejpi.png",
144 "fremantle": "64x64-ejpi.png", # Fremantle natively uses 48x48
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])