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",
82 "debian": ", python-qt4",
83 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
84 "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
86 p.recommends = ", ".join([
90 "diablo": "user/science",
91 "fremantle": "user/science",
95 p.distribution = "diablo fremantle debian"
96 p.repository = "extras"
97 p.changelog = __changelog__
98 p.postinstall = __postinstall__
99 p.preremove = __preremove__
101 "debian": "data-pixmaps-gonvert.png",
102 "diablo": "data-pixmaps-gonvert.png",
103 "fremantle": "data-pixmaps-gonvert.png", # Fremantle natively uses 48x48
105 p["/usr/bin"] = [ "gonvert.py" ]
106 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
107 fullPath = "/usr/lib/gonvert"
109 fullPath += os.sep+relPath
111 "|".join((oldName, newName))
112 for (oldName, newName) in files
114 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
115 fullPath = "/usr/share/gonvert"
117 fullPath += os.sep+relPath
119 "|".join((oldName, newName))
120 for (oldName, newName) in files
122 p["/usr/share/applications/hildon"] = ["gonvert.desktop"]
123 p["/usr/share/icons/hicolor/26x26/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
124 p["/usr/share/icons/hicolor/64x64/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
125 p["/usr/share/icons/hicolor/scalable/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
127 if distribution == "debian":
130 version="%s-%s" % (__version__, __build__),
131 changelog=__changelog__,
137 print "Building for %s finished" % distribution
141 version="%s-%s" % (__version__, __build__),
142 changelog=__changelog__,
148 print "Building for %s finished" % distribution
151 if __name__ == "__main__":
152 if len(sys.argv) > 1:
158 if optparse is not None:
159 parser = optparse.OptionParser()
160 (commandOptions, commandArgs) = parser.parse_args()
163 commandArgs = ["diablo"]
164 build_package(commandArgs[0])