11 __appname__ = constants.__app_name__
12 __description__ = """Unit Conversions
13 A conversion utility that allows conversion between many units like CGS, Ancient, Imperial with many categories like length, mass, numbers, etc. All units converted values shown at once as you type
15 Homepage: http://www.unihedron.com/projects/gonvert/index.php
17 __author__ = "Anthony Tekatch"
18 __email__ = "anthony@unihedron.com"
19 __version__ = constants.__version__
20 __build__ = constants.__build__
22 * Switching Condensed View's output to be editable also
23 * Fixed scrolling on Maemo
24 * On the traditional view, fixed an issue setting a value on the unit being converted
25 * Increased the name column size in the traditional view
26 * Switching Favorites to checkboxes from selection
30 __postinstall__ = """#!/bin/sh -e
32 gtk-update-icon-cache -f /usr/share/icons/hicolor
33 rm -f ~/.gonvert/gonvert.log ~/.gonvert/selections.dat ~/.gonvert/window.dat
36 __preremove__ = """#!/bin/sh -e
40 def find_files(prefix, path):
41 for root, dirs, files in os.walk(path):
43 if file.startswith(prefix+"-"):
44 fileParts = file.split("-")
45 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
46 assert unused == prefix
47 relPath = os.sep.join(relPathParts)
48 yield relPath, file, newName
51 def unflatten_files(files):
53 for relPath, oldName, newName in files:
56 d[relPath].append((oldName, newName))
60 def build_package(distribution):
62 os.chdir(os.path.dirname(sys.argv[0]))
66 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
67 p = py2deb.Py2deb(__appname__)
68 p.prettyName = constants.__pretty_app_name__
69 p.description = __description__
70 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Gonvert"
74 p.depends = ", ".join([
75 "python2.6 | python2.5",
79 "debian": ", python-qt4",
80 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
81 "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
83 p.recommends = ", ".join([
87 "diablo": "user/science",
88 "fremantle": "user/science",
92 p.distribution = "diablo fremantle debian"
93 p.repository = "extras"
94 p.changelog = __changelog__
95 p.postinstall = __postinstall__
96 p.preremove = __preremove__
98 "debian": "data-pixmaps-gonvert.png",
99 "diablo": "data-pixmaps-gonvert.png",
100 "fremantle": "data-pixmaps-gonvert.png", # Fremantle natively uses 48x48
102 p["/opt/gonvert/bin"] = [ "gonvert.py" ]
103 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
104 fullPath = "/opt/gonvert/lib"
106 fullPath += os.sep+relPath
108 "|".join((oldName, newName))
109 for (oldName, newName) in files
111 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
112 fullPath = "/opt/gonvert/share"
114 fullPath += os.sep+relPath
116 "|".join((oldName, newName))
117 for (oldName, newName) in files
119 p["/usr/share/applications/hildon"] = ["gonvert.desktop"]
120 p["/usr/share/icons/hicolor/26x26/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
121 p["/usr/share/icons/hicolor/64x64/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
122 p["/usr/share/icons/hicolor/scalable/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
124 if distribution == "debian":
127 version="%s-%s" % (__version__, __build__),
128 changelog=__changelog__,
134 print "Building for %s finished" % distribution
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])