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__
30 * Fixed and improved error reporting
31 * Re-arranged trig and programmer keyboards to reduce keyboard swapping
32 * Fixed issues with auto-scoll to latest item on startup
33 * Reducing redraws on spurious rotations
37 __postinstall__ = """#!/bin/sh -e
39 gtk-update-icon-cache -f /usr/share/icons/hicolor
40 rm -f ~/.%(name)s/%(name)s.log
41 """ % {"name": constants.__app_name__}
43 __preremove__ = """#!/bin/sh -e
47 def find_files(prefix, path):
48 for root, dirs, files in os.walk(path):
50 if file.startswith(prefix+"-"):
51 fileParts = file.split("-")
52 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
53 assert unused == prefix
54 relPath = os.sep.join(relPathParts)
55 yield relPath, file, newName
58 def unflatten_files(files):
60 for relPath, oldName, newName in files:
63 d[relPath].append((oldName, newName))
67 def build_package(distribution):
69 os.chdir(os.path.dirname(sys.argv[0]))
73 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
74 p = py2deb.Py2deb(__appname__)
75 p.prettyName = constants.__pretty_app_name__
76 p.description = __description__
77 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
81 p.depends = ", ".join([
82 "python2.6 | python2.5",
85 "debian": ", python-qt4",
86 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
87 "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
91 "diablo": "user/science",
92 "fremantle": "user/science",
96 p.distribution = "diablo fremantle debian"
97 p.repository = "extras"
98 p.changelog = __changelog__
99 p.postinstall = __postinstall__
101 "debian": "26x26-ejpi.png",
102 "diablo": "26x26-ejpi.png",
103 "fremantle": "64x64-ejpi.png", # Fremantle natively uses 48x48
105 p["/opt/%s/bin" % __appname__] = [ "%s.py" % __appname__ ]
106 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
107 fullPath = "/opt/%s/lib" % __appname__
109 fullPath += os.sep+relPath
111 "|".join((oldName, newName))
112 for (oldName, newName) in files
114 p["/usr/share/applications/hildon"] = ["%s.desktop" % __appname__]
115 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-ejpi.png|ejpi.png"]
116 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-ejpi.png|ejpi.png"]
117 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-ejpi.png|ejpi.png"]
119 if distribution == "debian":
122 version="%s-%s" % (__version__, __build__),
123 changelog=__changelog__,
129 print "Building for %s finished" % distribution
133 version="%s-%s" % (__version__, __build__),
134 changelog=__changelog__,
140 print "Building for %s finished" % distribution
143 if __name__ == "__main__":
144 if len(sys.argv) > 1:
150 if optparse is not None:
151 parser = optparse.OptionParser()
152 (commandOptions, commandArgs) = parser.parse_args()
155 commandArgs = ["diablo"]
156 build_package(commandArgs[0])