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 * BugFix: Attempt two at bigger X button
30 * Added support for creating .deb generic linux package files
33 * Fullscreen by Ctrl+Enter
34 * "Enter" in number entry causes a push
35 * Reversed stack order to be more proper
36 * Logging support, Ctrl+l to copy the log
42 * Swapping the keyboard positions, seem more friendly to my thumb location this way
45 * Added +/-, !, sq, and sqrt functions
46 * Improved Documentation
47 * Copy of calculation result and the corresponding equation
51 * Experimenting with faster startup by including pyc files in package
52 * Minor tweaks and bug fixes
54 0.9.1 - "Laziness doesn't always pay off"
55 * Profiled the code with an especial focus on the pie menus
56 * Tried to reduce potential bugs with double clicks
57 * Fixed a visual artifact issue on popup
59 0.9.0 - "Feed is for horses, so what about feedback?"
60 * Initial public release
63 * Supports different number types and bases
68 __postinstall__ = """#!/bin/sh -e
70 gtk-update-icon-cache -f /usr/share/icons/hicolor
71 rm -f ~/.ejpi/ejpi.log
76 for root, dirs, files in os.walk(path):
78 if file.startswith("src-"):
79 fileParts = file.split("-")
80 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
81 assert unused == "src"
82 relPath = os.sep.join(relPathParts)
83 yield relPath, file, newName
86 def unflatten_files(files):
88 for relPath, oldName, newName in files:
91 d[relPath].append((oldName, newName))
95 def build_package(distribution):
97 os.chdir(os.path.dirname(sys.argv[0]))
101 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
102 p = py2deb.Py2deb(__appname__)
103 p.prettyName = constants.__pretty_app_name__
104 p.description = __description__
105 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
106 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
107 p.author = __author__
110 p.depends = ", ".join([
111 "python2.6 | python2.5",
112 "python-gtk2 | python2.5-gtk2",
113 "python-xml | python2.5-xml",
114 "python-dbus | python2.5-dbus",
116 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
118 "debian": ", python-glade2",
119 "chinook": maemoSpecificDepends,
120 "diablo": maemoSpecificDepends,
121 "fremantle": maemoSpecificDepends + ", python-glade2",
122 "mer": maemoSpecificDepends + ", python-glade2",
126 "chinook": "accessories",
127 "diablo": "user/science",
128 "fremantle": "user/science",
129 "mer": "user/science",
133 p.distribution = "chinook diablo fremantle mer debian"
134 p.repository = "extras"
135 p.changelog = __changelog__
136 p.postinstall = __postinstall__
138 "debian": "26x26-ejpi.png",
139 "chinook": "26x26-ejpi.png",
140 "diablo": "26x26-ejpi.png",
141 "fremantle": "64x64-ejpi.png", # Fremantle natively uses 48x48
142 "mer": "64x64-ejpi.png",
144 p["/usr/bin"] = [ "ejpi.py" ]
145 for relPath, files in unflatten_files(find_files(".")).iteritems():
146 fullPath = "/usr/lib/ejpi"
148 fullPath += os.sep+relPath
150 "|".join((oldName, newName))
151 for (oldName, newName) in files
153 p["/usr/share/applications/hildon"] = ["ejpi.desktop"]
154 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-ejpi.png|ejpi.png"]
155 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-ejpi.png|ejpi.png"]
156 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-ejpi.png|ejpi.png"]
160 version="%s-%s" % (__version__, __build__),
161 changelog=__changelog__,
167 print "Building for %s finished" % distribution
170 if __name__ == "__main__":
171 if len(sys.argv) > 1:
177 if optparse is not None:
178 parser = optparse.OptionParser()
179 (commandOptions, commandArgs) = parser.parse_args()
182 commandArgs = ["diablo"]
183 build_package(commandArgs[0])