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__
26 * Fixing the application title
29 * Slight modifications to the note history and SQL dialogs
30 * On zoom, also hiding the history status and button
31 * Touched up the note list, making it ellipsize at the end rather than scroll
32 * Storing of zoom, wordwrap, and fullscreen settings
47 * improved sync, fixed a small bug
57 __postinstall__ = """#!/bin/sh -e
59 gtk-update-icon-cache -f /usr/share/icons/hicolor
60 rm -f ~/.quicknote/quicknote.log
64 def find_files(path, root):
66 for unusedRoot, dirs, files in os.walk(path):
68 if file.startswith(root+"-"):
69 print "\t", root, file
70 fileParts = file.split("-")
71 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
73 relPath = os.sep.join(relPathParts)
74 yield relPath, file, newName
77 def unflatten_files(files):
79 for relPath, oldName, newName in files:
82 d[relPath].append((oldName, newName))
86 def build_package(distribution):
88 os.chdir(os.path.dirname(sys.argv[0]))
92 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
93 p = py2deb.Py2deb(__appname__)
94 p.prettyName = constants.__pretty_app_name__
95 p.description = __description__
96 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
97 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
101 p.depends = ", ".join([
102 "python2.6 | python2.5",
103 "python-gtk2 | python2.5-gtk2",
104 "python-xml | python2.5-xml",
106 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
108 "debian": ", python-glade2",
109 "chinook": maemoSpecificDepends,
110 "diablo": maemoSpecificDepends,
111 "fremantle": maemoSpecificDepends + ", python-glade2",
112 "mer": maemoSpecificDepends + ", python-glade2",
115 "debian": "accessories",
116 "chinook": "accessories",
117 "diablo": "user/office",
118 "fremantle": "user/office",
119 "mer": "user/office",
123 p.distribution = "chinook diablo fremantle mer debian"
124 p.repository = "extras"
125 p.changelog = __changelog__
126 p.postinstall = __postinstall__
128 "debian": "26x26-quicknote.png",
129 "chinook": "26x26-quicknote.png",
130 "diablo": "26x26-quicknote.png",
131 "fremantle": "64x64-quicknote.png", # Fremantle natively uses 48x48
132 "mer": "64x64-quicknote.png",
134 p["/usr/bin"] = [ "quicknote.py" ]
135 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
136 fullPath = "/usr/share/locale"
138 fullPath += os.sep+relPath
140 "|".join((oldName, newName))
141 for (oldName, newName) in files
143 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
144 fullPath = "/usr/lib/quicknote"
146 fullPath += os.sep+relPath
148 "|".join((oldName, newName))
149 for (oldName, newName) in files
151 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
152 #p["/usr/share/dbus-1/services"] = ["quicknote.service"]
153 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-quicknote.png|quicknote.png"]
154 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-quicknote.png|quicknote.png"]
155 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-quicknote.png|quicknote.png"]
156 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-quicknote.png|quicknote.png"]
160 version="%s-%s" % (__version__, __build__),
161 changelog=__changelog__,
167 print "Building for %s finished" % distribution
170 if __name__ == "__main__":
171 if len(sys.argv) > 1:
177 if optparse is not None:
178 parser = optparse.OptionParser()
179 (commandOptions, commandArgs) = parser.parse_args()
182 commandArgs = ["diablo"]
183 build_package(commandArgs[0])