9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Simple note taking application in a similar vein as PalmOS Memos
17 Homepage: http://quicknote.garage.maemo.org/
19 __author__ = "Christoph Wurstle"
20 __email__ = "n800@axique.net"
21 __version__ = constants.__version__
22 __build__ = constants.__build__
28 __postinstall__ = """#!/bin/sh -e
30 gtk-update-icon-cache -f /usr/share/icons/hicolor
31 rm -f ~/.quicknote/quicknote.log
35 def find_files(path, root):
37 for unusedRoot, dirs, files in os.walk(path):
39 if file.startswith(root+"-"):
40 print "\t", root, file
41 fileParts = file.split("-")
42 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
44 relPath = os.sep.join(relPathParts)
45 yield relPath, file, newName
48 def unflatten_files(files):
50 for relPath, oldName, newName in files:
53 d[relPath].append((oldName, newName))
57 def build_package(distribution):
59 os.chdir(os.path.dirname(sys.argv[0]))
63 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
64 p = py2deb.Py2deb(__appname__)
65 p.prettyName = constants.__pretty_app_name__
66 p.description = __description__
67 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=quicknote"
71 p.depends = ", ".join([
72 "python2.6 | python2.5",
73 "python-gtk2 | python2.5-gtk2",
74 "python-xml | python2.5-xml",
75 "python-dbus | python2.5-dbus",
77 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
79 "debian": ", python-glade2",
80 "diablo": maemoSpecificDepends,
81 "fremantle": maemoSpecificDepends + ", python-glade2",
85 "diablo": "user/office",
86 "fremantle": "user/office",
90 p.distribution = "diablo fremantle debian"
91 p.repository = "extras"
92 p.changelog = __changelog__
93 p.postinstall = __postinstall__
95 "debian": "24_quicknote.png",
96 "diablo": "32_quicknote.png",
97 "fremantle": "48_quicknote.png", # Fremantle natively uses 48x48
99 p["/usr/bin"] = [ "quicknote.py" ]
100 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
101 fullPath = "/usr/share/locale"
103 fullPath += os.sep+relPath
105 "|".join((oldName, newName))
106 for (oldName, newName) in files
108 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
109 fullPath = "/usr/lib/quicknote"
111 fullPath += os.sep+relPath
113 "|".join((oldName, newName))
114 for (oldName, newName) in files
116 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
117 p["/usr/share/icons/hicolor/24x24/hildon"] = ["24_quicknote.png|quicknote.png"]
118 p["/usr/share/icons/hicolor/32x32/hildon"] = ["32_quicknote.png|quicknote.png"]
119 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48_quicknote.png|quicknote.png"]
120 p["/usr/share/icons/hicolor/72x72/hildon"] = ["72_quicknote.png|quicknote.png"]
122 if distribution == "debian":
125 version="%s-%s" % (__version__, __build__),
126 changelog=__changelog__,
132 print "Building for %s finished" % distribution
136 version="%s-%s" % (__version__, __build__),
137 changelog=__changelog__,
143 print "Building for %s finished" % distribution
146 if __name__ == "__main__":
147 if len(sys.argv) > 1:
153 if optparse is not None:
154 parser = optparse.OptionParser()
155 (commandOptions, commandArgs) = parser.parse_args()
158 commandArgs = ["diablo"]
159 build_package(commandArgs[0])