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 * Switched from GTK to QT in preparation for Meego, all previous features still present
23 * Except removed the current form of search
24 * Added a "Recent" window
25 * Added a "Quick Jump" window (to replace old form of search)
26 * Added favorites to limit the number of categories and units shown
27 * Should be auto-rotatable (might not be working for some reason)
28 * Should auto-enable Fn on Maemo 5
32 __postinstall__ = """#!/bin/sh -e
34 gtk-update-icon-cache -f /usr/share/icons/hicolor
35 rm -f ~/.gonvert/gonvert.log ~/.gonvert/selections.dat ~/.gonvert/window.dat
38 __preremove__ = """#!/bin/sh -e
42 def find_files(prefix, path):
43 for root, dirs, files in os.walk(path):
45 if file.startswith(prefix+"-"):
46 fileParts = file.split("-")
47 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
48 assert unused == prefix
49 relPath = os.sep.join(relPathParts)
50 yield relPath, file, newName
53 def unflatten_files(files):
55 for relPath, oldName, newName in files:
58 d[relPath].append((oldName, newName))
62 def build_package(distribution):
64 os.chdir(os.path.dirname(sys.argv[0]))
68 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
69 p = py2deb.Py2deb(__appname__)
70 p.prettyName = constants.__pretty_app_name__
71 p.description = __description__
72 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Gonvert"
73 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
77 p.depends = ", ".join([
78 "python2.6 | python2.5",
81 "debian": ", python-qt4",
82 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
83 "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
85 p.recommends = ", ".join([
89 "diablo": "user/science",
90 "fremantle": "user/science",
94 p.distribution = "diablo fremantle debian"
95 p.repository = "extras"
96 p.changelog = __changelog__
97 p.postinstall = __postinstall__
98 p.preremove = __preremove__
100 "debian": "data-pixmaps-gonvert.png",
101 "diablo": "data-pixmaps-gonvert.png",
102 "fremantle": "data-pixmaps-gonvert.png", # Fremantle natively uses 48x48
104 p["/usr/bin"] = [ "gonvert.py" ]
105 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
106 fullPath = "/usr/lib/gonvert"
108 fullPath += os.sep+relPath
110 "|".join((oldName, newName))
111 for (oldName, newName) in files
113 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
114 fullPath = "/usr/share/gonvert"
116 fullPath += os.sep+relPath
118 "|".join((oldName, newName))
119 for (oldName, newName) in files
121 p["/usr/share/applications/hildon"] = ["gonvert.desktop"]
122 p["/usr/share/icons/hicolor/26x26/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
123 p["/usr/share/icons/hicolor/64x64/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
124 p["/usr/share/icons/hicolor/scalable/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
126 if distribution == "debian":
129 version="%s-%s" % (__version__, __build__),
130 changelog=__changelog__,
136 print "Building for %s finished" % distribution
140 version="%s-%s" % (__version__, __build__),
141 changelog=__changelog__,
147 print "Building for %s finished" % distribution
150 if __name__ == "__main__":
151 if len(sys.argv) > 1:
157 if optparse is not None:
158 parser = optparse.OptionParser()
159 (commandOptions, commandArgs) = parser.parse_args()
162 commandArgs = ["diablo"]
163 build_package(commandArgs[0])