9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Simple list management application
17 Homepage: http://multilist.garage.maemo.org/
19 __author__ = "Christoph Wurstle"
20 __email__ = "n800@axique.net"
21 __version__ = constants.__version__
22 __build__ = constants.__build__
25 * Adding some paranoia protection against a problem brought up on t.m.o thread
29 __postinstall__ = """#!/bin/sh -e
31 gtk-update-icon-cache -f /usr/share/icons/hicolor
32 rm -f ~/.multilist/multilist.log
36 def find_files(path, root):
38 for unusedRoot, dirs, files in os.walk(path):
40 if file.startswith(root+"-"):
41 print "\t", root, file
42 fileParts = file.split("-")
43 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
45 relPath = os.sep.join(relPathParts)
46 yield relPath, file, newName
49 def unflatten_files(files):
51 for relPath, oldName, newName in files:
54 d[relPath].append((oldName, newName))
58 def build_package(distribution):
60 os.chdir(os.path.dirname(sys.argv[0]))
64 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
65 p = py2deb.Py2deb(__appname__)
66 p.prettyName = constants.__pretty_app_name__
67 p.description = __description__
68 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Multilist"
69 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
73 p.depends = ", ".join([
74 "python2.6 | python2.5",
75 "python-gtk2 | python2.5-gtk2",
76 "python-xml | python2.5-xml",
77 "python-dbus | python2.5-dbus",
79 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
81 "debian": ", python-glade2",
82 "diablo": maemoSpecificDepends,
83 "fremantle": maemoSpecificDepends + ", python-glade2",
87 "diablo": "user/office",
88 "fremantle": "user/office",
92 p.distribution = "diablo fremantle debian"
93 p.repository = "extras"
94 p.changelog = __changelog__
95 p.postinstall = __postinstall__
97 "debian": "26x26-multilist.png",
98 "diablo": "26x26-multilist.png",
99 "fremantle": "40x40-multilist.png", # Fremantle natively uses 48x48
101 p["/usr/bin"] = [ "multilist.py" ]
102 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
103 fullPath = "/usr/share/locale"
105 fullPath += os.sep+relPath
107 "|".join((oldName, newName))
108 for (oldName, newName) in files
110 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
111 fullPath = "/usr/lib/multilist"
113 fullPath += os.sep+relPath
115 "|".join((oldName, newName))
116 for (oldName, newName) in files
118 p["/usr/share/applications/hildon"] = ["multilist.desktop"]
119 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-multilist.png|multilist.png"]
120 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-multilist.png|multilist.png"]
121 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-multilist.png|multilist.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])