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__
24 * Small bugfix for launch
29 __postinstall__ = """#!/bin/sh -e
31 gtk-update-icon-cache -f /usr/share/icons/hicolor
32 rm -f ~/.quicknote/quicknote.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=quicknote"
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-quicknote.png",
98 "diablo": "26x26-quicknote.png",
99 "fremantle": "48x48-quicknote.png", # Fremantle natively uses 48x48
101 p["/usr/bin"] = [ "quicknote.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/quicknote"
113 fullPath += os.sep+relPath
115 "|".join((oldName, newName))
116 for (oldName, newName) in files
118 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
119 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-quicknote.png|quicknote.png"]
120 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-quicknote.png|quicknote.png"]
121 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-quicknote.png|quicknote.png"]
122 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-quicknote.png|quicknote.png"]
124 if distribution == "debian":
127 version="%s-%s" % (__version__, __build__),
128 changelog=__changelog__,
134 print "Building for %s finished" % distribution
138 version="%s-%s" % (__version__, __build__),
139 changelog=__changelog__,
145 print "Building for %s finished" % distribution
148 if __name__ == "__main__":
149 if len(sys.argv) > 1:
155 if optparse is not None:
156 parser = optparse.OptionParser()
157 (commandOptions, commandArgs) = parser.parse_args()
160 commandArgs = ["diablo"]
161 build_package(commandArgs[0])