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 * UI Tweak: Removed "New Note..." due to weirdness and duplicated behavior
29 * UI Tweak: Added App Menu to access some category functionality
30 * Bugfix: Move To Category
31 * Bugfix: Removed carriage return on Ctrl+Enter
32 * Added .deb package support
36 * Fixing the application title
38 * Ctrl+i and Ctrl+o to zoom in/out the interface
39 * Ctrl+enter to fullscreen app
40 * Ctrl+l to copy to clipboard the application debug log
43 * Slight modifications to the note history and SQL dialogs
44 * On zoom, also hiding the history status and button
45 * Touched up the note list, making it ellipsize at the end rather than scroll
46 * Storing of zoom, wordwrap, and fullscreen settings
61 * improved sync, fixed a small bug
71 __postinstall__ = """#!/bin/sh -e
73 gtk-update-icon-cache -f /usr/share/icons/hicolor
74 rm -f ~/.quicknote/quicknote.log
78 def find_files(path, root):
80 for unusedRoot, dirs, files in os.walk(path):
82 if file.startswith(root+"-"):
83 print "\t", root, file
84 fileParts = file.split("-")
85 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
87 relPath = os.sep.join(relPathParts)
88 yield relPath, file, newName
91 def unflatten_files(files):
93 for relPath, oldName, newName in files:
96 d[relPath].append((oldName, newName))
100 def build_package(distribution):
102 os.chdir(os.path.dirname(sys.argv[0]))
106 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
107 p = py2deb.Py2deb(__appname__)
108 p.prettyName = constants.__pretty_app_name__
109 p.description = __description__
110 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=quicknote"
111 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
112 p.author = __author__
115 p.depends = ", ".join([
116 "python2.6 | python2.5",
117 "python-gtk2 | python2.5-gtk2",
118 "python-xml | python2.5-xml",
120 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
122 "debian": ", python-glade2",
123 "chinook": maemoSpecificDepends,
124 "diablo": maemoSpecificDepends,
125 "fremantle": maemoSpecificDepends + ", python-glade2",
126 "mer": maemoSpecificDepends + ", python-glade2",
130 "chinook": "accessories",
131 "diablo": "user/office",
132 "fremantle": "user/office",
133 "mer": "user/office",
137 p.distribution = "chinook diablo fremantle mer debian"
138 p.repository = "extras"
139 p.changelog = __changelog__
140 p.postinstall = __postinstall__
142 "debian": "26x26-quicknote.png",
143 "chinook": "26x26-quicknote.png",
144 "diablo": "26x26-quicknote.png",
145 "fremantle": "48x48-quicknote.png", # Fremantle natively uses 48x48
146 "mer": "48x48-quicknote.png",
148 p["/usr/bin"] = [ "quicknote.py" ]
149 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
150 fullPath = "/usr/share/locale"
152 fullPath += os.sep+relPath
154 "|".join((oldName, newName))
155 for (oldName, newName) in files
157 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
158 fullPath = "/usr/lib/quicknote"
160 fullPath += os.sep+relPath
162 "|".join((oldName, newName))
163 for (oldName, newName) in files
165 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
166 #p["/usr/share/dbus-1/services"] = ["quicknote.service"]
167 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-quicknote.png|quicknote.png"]
168 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-quicknote.png|quicknote.png"]
169 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-quicknote.png|quicknote.png"]
170 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-quicknote.png|quicknote.png"]
172 if distribution == "debian":
175 version="%s-%s" % (__version__, __build__),
176 changelog=__changelog__,
182 print "Building for %s finished" % distribution
186 version="%s-%s" % (__version__, __build__),
187 changelog=__changelog__,
193 print "Building for %s finished" % distribution
196 if __name__ == "__main__":
197 if len(sys.argv) > 1:
203 if optparse is not None:
204 parser = optparse.OptionParser()
205 (commandOptions, commandArgs) = parser.parse_args()
208 commandArgs = ["diablo"]
209 build_package(commandArgs[0])