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 menu/appmenu
26 * Switched category selection over to a touch selector entry, making it prettier and easier
30 * UI Tweak: Removed "New Note..." due to weirdness and duplicated behavior
31 * UI Tweak: Added App Menu to access some category functionality
32 * Bugfix: Move To Category
33 * Bugfix: Removed carriage return on Ctrl+Enter
34 * Added .deb package support
38 * Fixing the application title
40 * Ctrl+i and Ctrl+o to zoom in/out the interface
41 * Ctrl+enter to fullscreen app
42 * Ctrl+l to copy to clipboard the application debug log
45 * Slight modifications to the note history and SQL dialogs
46 * On zoom, also hiding the history status and button
47 * Touched up the note list, making it ellipsize at the end rather than scroll
48 * Storing of zoom, wordwrap, and fullscreen settings
63 * improved sync, fixed a small bug
73 __postinstall__ = """#!/bin/sh -e
75 gtk-update-icon-cache -f /usr/share/icons/hicolor
76 rm -f ~/.quicknote/quicknote.log
80 def find_files(path, root):
82 for unusedRoot, dirs, files in os.walk(path):
84 if file.startswith(root+"-"):
85 print "\t", root, file
86 fileParts = file.split("-")
87 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
89 relPath = os.sep.join(relPathParts)
90 yield relPath, file, newName
93 def unflatten_files(files):
95 for relPath, oldName, newName in files:
98 d[relPath].append((oldName, newName))
102 def build_package(distribution):
104 os.chdir(os.path.dirname(sys.argv[0]))
108 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
109 p = py2deb.Py2deb(__appname__)
110 p.prettyName = constants.__pretty_app_name__
111 p.description = __description__
112 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=quicknote"
113 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
114 p.author = __author__
117 p.depends = ", ".join([
118 "python2.6 | python2.5",
119 "python-gtk2 | python2.5-gtk2",
120 "python-xml | python2.5-xml",
122 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
124 "debian": ", python-glade2",
125 "chinook": maemoSpecificDepends,
126 "diablo": maemoSpecificDepends,
127 "fremantle": maemoSpecificDepends + ", python-glade2",
128 "mer": maemoSpecificDepends + ", python-glade2",
132 "chinook": "accessories",
133 "diablo": "user/office",
134 "fremantle": "user/office",
135 "mer": "user/office",
139 p.distribution = "chinook diablo fremantle mer debian"
140 p.repository = "extras"
141 p.changelog = __changelog__
142 p.postinstall = __postinstall__
144 "debian": "26x26-quicknote.png",
145 "chinook": "26x26-quicknote.png",
146 "diablo": "26x26-quicknote.png",
147 "fremantle": "48x48-quicknote.png", # Fremantle natively uses 48x48
148 "mer": "48x48-quicknote.png",
150 p["/usr/bin"] = [ "quicknote.py" ]
151 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
152 fullPath = "/usr/share/locale"
154 fullPath += os.sep+relPath
156 "|".join((oldName, newName))
157 for (oldName, newName) in files
159 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
160 fullPath = "/usr/lib/quicknote"
162 fullPath += os.sep+relPath
164 "|".join((oldName, newName))
165 for (oldName, newName) in files
167 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
168 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-quicknote.png|quicknote.png"]
169 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-quicknote.png|quicknote.png"]
170 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-quicknote.png|quicknote.png"]
171 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-quicknote.png|quicknote.png"]
173 if distribution == "debian":
176 version="%s-%s" % (__version__, __build__),
177 changelog=__changelog__,
183 print "Building for %s finished" % distribution
187 version="%s-%s" % (__version__, __build__),
188 changelog=__changelog__,
194 print "Building for %s finished" % distribution
197 if __name__ == "__main__":
198 if len(sys.argv) > 1:
204 if optparse is not None:
205 parser = optparse.OptionParser()
206 (commandOptions, commandArgs) = parser.parse_args()
209 commandArgs = ["diablo"]
210 build_package(commandArgs[0])