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"
68 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
72 p.depends = ", ".join([
73 "python2.6 | python2.5",
74 "python-gtk2 | python2.5-gtk2",
75 "python-xml | python2.5-xml",
76 "python-dbus | python2.5-dbus",
78 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
80 "debian": ", python-glade2",
81 "diablo": maemoSpecificDepends,
82 "fremantle": maemoSpecificDepends + ", python-glade2",
86 "diablo": "user/office",
87 "fremantle": "user/office",
91 p.distribution = "diablo fremantle debian"
92 p.repository = "extras"
93 p.changelog = __changelog__
94 p.postinstall = __postinstall__
96 "debian": "24_quicknote.png",
97 "diablo": "32_quicknote.png",
98 "fremantle": "48_quicknote.png", # Fremantle natively uses 48x48
100 p["/usr/bin"] = [ "quicknote.py" ]
101 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
102 fullPath = "/usr/share/locale"
104 fullPath += os.sep+relPath
106 "|".join((oldName, newName))
107 for (oldName, newName) in files
109 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
110 fullPath = "/usr/lib/quicknote"
112 fullPath += os.sep+relPath
114 "|".join((oldName, newName))
115 for (oldName, newName) in files
117 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
118 p["/usr/share/icons/hicolor/24x24/hildon"] = ["24_quicknote.png|quicknote.png"]
119 p["/usr/share/icons/hicolor/32x32/hildon"] = ["32_quicknote.png|quicknote.png"]
120 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48_quicknote.png|quicknote.png"]
121 p["/usr/share/icons/hicolor/72x72/hildon"] = ["72_quicknote.png|quicknote.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])