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 * Cleaned up some code
26 * Moved Active/All filter to menu
29 * I18N, extract de.po, add ru.po.
36 __postinstall__ = """#!/bin/sh -e
38 gtk-update-icon-cache -f /usr/share/icons/hicolor
39 rm -f ~/.multilist/multilist.log
43 def find_files(path, root):
45 for unusedRoot, dirs, files in os.walk(path):
47 if file.startswith(root+"-"):
48 print "\t", root, file
49 fileParts = file.split("-")
50 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
52 relPath = os.sep.join(relPathParts)
53 yield relPath, file, newName
56 def unflatten_files(files):
58 for relPath, oldName, newName in files:
61 d[relPath].append((oldName, newName))
65 def build_package(distribution):
67 os.chdir(os.path.dirname(sys.argv[0]))
71 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
72 p = py2deb.Py2deb(__appname__)
73 p.prettyName = constants.__pretty_app_name__
74 p.description = __description__
75 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=quicknote"
76 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
80 p.depends = ", ".join([
81 "python2.6 | python2.5",
82 "python-gtk2 | python2.5-gtk2",
83 "python-xml | python2.5-xml",
84 "python-dbus | python2.5-dbus",
86 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
88 "debian": ", python-glade2",
89 "diablo": maemoSpecificDepends,
90 "fremantle": maemoSpecificDepends + ", python-glade2",
94 "diablo": "user/office",
95 "fremantle": "user/office",
99 p.distribution = "diablo fremantle debian"
100 p.repository = "extras"
101 p.changelog = __changelog__
102 p.postinstall = __postinstall__
104 "debian": "26x26-multilist.png",
105 "diablo": "26x26-multilist.png",
106 "fremantle": "40x40-multilist.png", # Fremantle natively uses 48x48
108 p["/usr/bin"] = [ "multilist.py" ]
109 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
110 fullPath = "/usr/share/locale"
112 fullPath += os.sep+relPath
114 "|".join((oldName, newName))
115 for (oldName, newName) in files
117 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
118 fullPath = "/usr/lib/multilist"
120 fullPath += os.sep+relPath
122 "|".join((oldName, newName))
123 for (oldName, newName) in files
125 p["/usr/share/applications/hildon"] = ["multilist.desktop"]
126 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-multilist.png|multilist.png"]
127 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-multilist.png|multilist.png"]
128 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-multilist.png|multilist.png"]
130 if distribution == "debian":
133 version="%s-%s" % (__version__, __build__),
134 changelog=__changelog__,
140 print "Building for %s finished" % distribution
144 version="%s-%s" % (__version__, __build__),
145 changelog=__changelog__,
151 print "Building for %s finished" % distribution
154 if __name__ == "__main__":
155 if len(sys.argv) > 1:
161 if optparse is not None:
162 parser = optparse.OptionParser()
163 (commandOptions, commandArgs) = parser.parse_args()
166 commandArgs = ["diablo"]
167 build_package(commandArgs[0])