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__
25 * Moved history to the (app)menu
26 * Moved search to Ctrl+f and (app)menu
27 * Switched category selection over to a touch selector entry, making it prettier and easier
31 * UI Tweak: Removed "New Note..." due to weirdness and duplicated behavior
32 * UI Tweak: Added App Menu to access some category functionality
33 * Bugfix: Move To Category
34 * Bugfix: Removed carriage return on Ctrl+Enter
35 * Added .deb package support
39 * Fixing the application title
41 * Ctrl+i and Ctrl+o to zoom in/out the interface
42 * Ctrl+enter to fullscreen app
43 * Ctrl+l to copy to clipboard the application debug log
46 * Slight modifications to the note history and SQL dialogs
47 * On zoom, also hiding the history status and button
48 * Touched up the note list, making it ellipsize at the end rather than scroll
49 * Storing of zoom, wordwrap, and fullscreen settings
64 * improved sync, fixed a small bug
74 __postinstall__ = """#!/bin/sh -e
76 gtk-update-icon-cache -f /usr/share/icons/hicolor
77 rm -f ~/.quicknote/quicknote.log
81 def find_files(path, root):
83 for unusedRoot, dirs, files in os.walk(path):
85 if file.startswith(root+"-"):
86 print "\t", root, file
87 fileParts = file.split("-")
88 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
90 relPath = os.sep.join(relPathParts)
91 yield relPath, file, newName
94 def unflatten_files(files):
96 for relPath, oldName, newName in files:
99 d[relPath].append((oldName, newName))
103 def build_package(distribution):
105 os.chdir(os.path.dirname(sys.argv[0]))
109 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
110 p = py2deb.Py2deb(__appname__)
111 p.prettyName = constants.__pretty_app_name__
112 p.description = __description__
113 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=quicknote"
114 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
115 p.author = __author__
118 p.depends = ", ".join([
119 "python2.6 | python2.5",
120 "python-gtk2 | python2.5-gtk2",
121 "python-xml | python2.5-xml",
123 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
125 "debian": ", python-glade2",
126 "chinook": maemoSpecificDepends,
127 "diablo": maemoSpecificDepends,
128 "fremantle": maemoSpecificDepends + ", python-glade2",
129 "mer": maemoSpecificDepends + ", python-glade2",
133 "chinook": "accessories",
134 "diablo": "user/office",
135 "fremantle": "user/office",
136 "mer": "user/office",
140 p.distribution = "chinook diablo fremantle mer debian"
141 p.repository = "extras"
142 p.changelog = __changelog__
143 p.postinstall = __postinstall__
145 "debian": "26x26-quicknote.png",
146 "chinook": "26x26-quicknote.png",
147 "diablo": "26x26-quicknote.png",
148 "fremantle": "48x48-quicknote.png", # Fremantle natively uses 48x48
149 "mer": "48x48-quicknote.png",
151 p["/usr/bin"] = [ "quicknote.py" ]
152 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
153 fullPath = "/usr/share/locale"
155 fullPath += os.sep+relPath
157 "|".join((oldName, newName))
158 for (oldName, newName) in files
160 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
161 fullPath = "/usr/lib/quicknote"
163 fullPath += os.sep+relPath
165 "|".join((oldName, newName))
166 for (oldName, newName) in files
168 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
169 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-quicknote.png|quicknote.png"]
170 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-quicknote.png|quicknote.png"]
171 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-quicknote.png|quicknote.png"]
172 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-quicknote.png|quicknote.png"]
174 if distribution == "debian":
177 version="%s-%s" % (__version__, __build__),
178 changelog=__changelog__,
184 print "Building for %s finished" % distribution
188 version="%s-%s" % (__version__, __build__),
189 changelog=__changelog__,
195 print "Building for %s finished" % distribution
198 if __name__ == "__main__":
199 if len(sys.argv) > 1:
205 if optparse is not None:
206 parser = optparse.OptionParser()
207 (commandOptions, commandArgs) = parser.parse_args()
210 commandArgs = ["diablo"]
211 build_package(commandArgs[0])