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 * UI Tweak: Removed "New Note..." due to weirdness and duplicated behavior
26 * UI Tweak: Added App Menu to access some category functionality
27 * Bugfix: Move To Category
28 * Bugfix: Removed carriage return on Ctrl+Enter
29 * Added .deb package support
33 * Fixing the application title
35 * Ctrl+i and Ctrl+o to zoom in/out the interface
36 * Ctrl+enter to fullscreen app
37 * Ctrl+l to copy to clipboard the application debug log
40 * Slight modifications to the note history and SQL dialogs
41 * On zoom, also hiding the history status and button
42 * Touched up the note list, making it ellipsize at the end rather than scroll
43 * Storing of zoom, wordwrap, and fullscreen settings
58 * improved sync, fixed a small bug
68 __postinstall__ = """#!/bin/sh -e
70 gtk-update-icon-cache -f /usr/share/icons/hicolor
71 rm -f ~/.quicknote/quicknote.log
75 def find_files(path, root):
77 for unusedRoot, dirs, files in os.walk(path):
79 if file.startswith(root+"-"):
80 print "\t", root, file
81 fileParts = file.split("-")
82 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
84 relPath = os.sep.join(relPathParts)
85 yield relPath, file, newName
88 def unflatten_files(files):
90 for relPath, oldName, newName in files:
93 d[relPath].append((oldName, newName))
97 def build_package(distribution):
99 os.chdir(os.path.dirname(sys.argv[0]))
103 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
104 p = py2deb.Py2deb(__appname__)
105 p.prettyName = constants.__pretty_app_name__
106 p.description = __description__
107 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=quicknote"
108 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
109 p.author = __author__
112 p.depends = ", ".join([
113 "python2.6 | python2.5",
114 "python-gtk2 | python2.5-gtk2",
115 "python-xml | python2.5-xml",
117 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
119 "debian": ", python-glade2",
120 "chinook": maemoSpecificDepends,
121 "diablo": maemoSpecificDepends,
122 "fremantle": maemoSpecificDepends + ", python-glade2",
123 "mer": maemoSpecificDepends + ", python-glade2",
127 "chinook": "accessories",
128 "diablo": "user/office",
129 "fremantle": "user/office",
130 "mer": "user/office",
134 p.distribution = "chinook diablo fremantle mer debian"
135 p.repository = "extras"
136 p.changelog = __changelog__
137 p.postinstall = __postinstall__
139 "debian": "26x26-quicknote.png",
140 "chinook": "26x26-quicknote.png",
141 "diablo": "26x26-quicknote.png",
142 "fremantle": "48x48-quicknote.png", # Fremantle natively uses 48x48
143 "mer": "48x48-quicknote.png",
145 p["/usr/bin"] = [ "quicknote.py" ]
146 for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
147 fullPath = "/usr/share/locale"
149 fullPath += os.sep+relPath
151 "|".join((oldName, newName))
152 for (oldName, newName) in files
154 for relPath, files in unflatten_files(find_files(".", "src")).iteritems():
155 fullPath = "/usr/lib/quicknote"
157 fullPath += os.sep+relPath
159 "|".join((oldName, newName))
160 for (oldName, newName) in files
162 p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
163 #p["/usr/share/dbus-1/services"] = ["quicknote.service"]
164 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-quicknote.png|quicknote.png"]
165 p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-quicknote.png|quicknote.png"]
166 p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-quicknote.png|quicknote.png"]
167 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-quicknote.png|quicknote.png"]
171 version="%s-%s" % (__version__, __build__),
172 changelog=__changelog__,
178 print "Building for %s finished" % distribution
181 if __name__ == "__main__":
182 if len(sys.argv) > 1:
188 if optparse is not None:
189 parser = optparse.OptionParser()
190 (commandOptions, commandArgs) = parser.parse_args()
193 commandArgs = ["diablo"]
194 build_package(commandArgs[0])