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 * A condensed view of unit conversion for those who so chose
23 * Changed the way windows handle closing
24 * Improved performance of jumping between some of the windows (including startup)
25 * Persisting the sort preference
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__
70 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Gonvert"
72 p.bugTracker = "REPLACEME"
73 >>>>>>> 6e3215856a887adc778853fcacf0dfcee13701bc
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
106 p["/opt/gonvert/bin"] = [ "gonvert.py" ]
107 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
108 fullPath = "/opt/gonvert/lib"
110 fullPath += os.sep+relPath
112 "|".join((oldName, newName))
113 for (oldName, newName) in files
115 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
116 fullPath = "/opt/gonvert/share"
118 p["/opt/REPLACEME/bin"] = [ "REPLACEME" ]
119 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
120 fullPath = "/opt/REPLACEME/lib"
121 >>>>>>> 6e3215856a887adc778853fcacf0dfcee13701bc
123 fullPath += os.sep+relPath
125 "|".join((oldName, newName))
126 for (oldName, newName) in files
128 p["/usr/share/applications/hildon"] = ["gonvert.desktop"]
129 p["/usr/share/icons/hicolor/26x26/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
130 p["/usr/share/icons/hicolor/64x64/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
131 p["/usr/share/icons/hicolor/scalable/hildon"] = ["data-pixmaps-gonvert.png|gonvert.png"]
133 if distribution == "debian":
136 version="%s-%s" % (__version__, __build__),
137 changelog=__changelog__,
143 print "Building for %s finished" % distribution
147 version="%s-%s" % (__version__, __build__),
148 changelog=__changelog__,
154 print "Building for %s finished" % distribution
157 if __name__ == "__main__":
158 if len(sys.argv) > 1:
164 if optparse is not None:
165 parser = optparse.OptionParser()
166 (commandOptions, commandArgs) = parser.parse_args()
169 commandArgs = ["diablo"]
170 build_package(commandArgs[0])