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
29 __postinstall__ = """#!/bin/sh -e
31 gtk-update-icon-cache -f /usr/share/icons/hicolor
32 rm -f ~/.gonvert/gonvert.log ~/.gonvert/selections.dat ~/.gonvert/window.dat
35 __preremove__ = """#!/bin/sh -e
39 def find_files(prefix, path):
40 for root, dirs, files in os.walk(path):
42 if file.startswith(prefix+"-"):
43 fileParts = file.split("-")
44 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
45 assert unused == prefix
46 relPath = os.sep.join(relPathParts)
47 yield relPath, file, newName
50 def unflatten_files(files):
52 for relPath, oldName, newName in files:
55 d[relPath].append((oldName, newName))
59 def build_package(distribution):
61 os.chdir(os.path.dirname(sys.argv[0]))
65 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
66 p = py2deb.Py2deb(__appname__)
67 p.prettyName = constants.__pretty_app_name__
68 p.description = __description__
69 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Gonvert"
73 p.depends = ", ".join([
74 "python2.6 | python2.5",
78 "debian": ", python-qt4",
79 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
80 "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
82 p.recommends = ", ".join([
86 "diablo": "user/science",
87 "fremantle": "user/science",
91 p.distribution = "diablo fremantle debian"
92 p.repository = "extras"
93 p.changelog = __changelog__
94 p.postinstall = __postinstall__
95 p.preremove = __preremove__
97 "debian": "data-pixmaps-gonvert.png",
98 "diablo": "data-pixmaps-gonvert.png",
99 "fremantle": "data-pixmaps-gonvert.png", # Fremantle natively uses 48x48
101 p["/opt/gonvert/bin"] = [ "gonvert.py" ]
102 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
103 fullPath = "/opt/gonvert/lib"
105 fullPath += os.sep+relPath
107 "|".join((oldName, newName))
108 for (oldName, newName) in files
110 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
111 fullPath = "/opt/gonvert/share"
113 fullPath += os.sep+relPath
115 "|".join((oldName, newName))
116 for (oldName, newName) in files
118 p["/usr/share/applications/hildon"] = ["gonvert.desktop"]
119 p["/usr/share/icons/hicolor/26x26/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
120 p["/usr/share/icons/hicolor/64x64/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
121 p["/usr/share/icons/hicolor/scalable/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
123 if distribution == "debian":
126 version="%s-%s" % (__version__, __build__),
127 changelog=__changelog__,
133 print "Building for %s finished" % distribution
137 version="%s-%s" % (__version__, __build__),
138 changelog=__changelog__,
144 print "Building for %s finished" % distribution
147 if __name__ == "__main__":
148 if len(sys.argv) > 1:
154 if optparse is not None:
155 parser = optparse.OptionParser()
156 (commandOptions, commandArgs) = parser.parse_args()
159 commandArgs = ["diablo"]
160 build_package(commandArgs[0])