9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """A Touch Screen Optimized RPN Calculator using Pie Menus
17 Homepage: http://ejpi.garage.maemo.org/
19 __author__ = "Ed Page"
20 __email__ = "eopage@byu.net"
21 __version__ = constants.__version__
22 __build__ = constants.__build__
29 * Swapping the keyboard positions, seem more friendly to my thumb location this way
32 * Added +/-, !, sq, and sqrt functions
33 * Improved Documentation
34 * Copy of calculation result and the corresponding equation
38 * Experimenting with faster startup by including pyc files in package
39 * Minor tweaks and bug fixes
41 0.9.1 - "Laziness doesn't always pay off"
42 * Profiled the code with an especial focus on the pie menus
43 * Tried to reduce potential bugs with double clicks
44 * Fixed a visual artifact issue on popup
46 0.9.0 - "Feed is for horses, so what about feedback?"
47 * Initial public release
50 * Supports different number types and bases
55 __postinstall__ = """#!/bin/sh -e
57 gtk-update-icon-cache -f /usr/share/icons/hicolor
62 for root, dirs, files in os.walk(path):
64 if file.startswith("src-"):
65 fileParts = file.split("-")
66 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
67 assert unused == "src"
68 relPath = os.sep.join(relPathParts)
69 yield relPath, file, newName
72 def unflatten_files(files):
74 for relPath, oldName, newName in files:
77 d[relPath].append((oldName, newName))
81 def build_package(distribution):
83 os.chdir(os.path.dirname(sys.argv[0]))
87 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
88 p = py2deb.Py2deb(__appname__)
89 p.prettyName = constants.__pretty_app_name__
90 p.description = __description__
91 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
95 p.depends = ", ".join([
96 "python2.6 | python2.5",
97 "python-gtk2 | python2.5-gtk2",
98 "python-xml | python2.5-xml",
100 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
102 "debian": ", python-glade2",
103 "chinook": maemoSpecificDepends,
104 "diablo": maemoSpecificDepends,
105 "fremantle": maemoSpecificDepends + ", python-glade2",
106 "mer": maemoSpecificDepends + ", python-glade2",
108 p.section = "user/accessories"
111 p.distribution = "chinook diablo fremantle mer debian"
112 p.repository = "extras"
113 p.changelog = __changelog__
114 p.postinstall = __postinstall__
116 "debian": "26x26-ejpi.png",
117 "chinook": "26x26-ejpi.png",
118 "diablo": "26x26-ejpi.png",
119 "fremantle": "64x64-ejpi.png", # Fremantle natively uses 48x48
120 "mer": "64x64-ejpi.png",
122 p["/usr/bin"] = [ "ejpi.py" ]
123 for relPath, files in unflatten_files(find_files(".")).iteritems():
124 fullPath = "/usr/lib/ejpi"
126 fullPath += os.sep+relPath
128 "|".join((oldName, newName))
129 for (oldName, newName) in files
131 p["/usr/share/applications/hildon"] = ["ejpi.desktop"]
132 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-ejpi.png|ejpi.png"]
133 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-ejpi.png|ejpi.png"]
134 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-ejpi.png|ejpi.png"]
138 version="%s-%s" % (__version__, __build__),
139 changelog=__changelog__,
145 print "Building for %s finished" % distribution
148 if __name__ == "__main__":
149 if len(sys.argv) > 1:
155 if optparse is not None:
156 parser = optparse.OptionParser()
157 (commandOptions, commandArgs) = parser.parse_args()
160 commandArgs = ["diablo"]
161 build_package(commandArgs[0])