Removing upgrade description
[gc-dialer] / support / builddeb.py
1 #!/usr/bin/python2.5
2
3 import os
4 import sys
5
6 try:
7         import py2deb
8 except ImportError:
9         import fake_py2deb as py2deb
10
11 import constants
12
13
14 __appname__ = constants.__app_name__
15 __description__ = """Touch screen enhanced interface to the GoogleVoice phone service"
16 Features:
17 * Dialpad for quick call
18 * Checking voicemails, texts, call history
19 * Sending texts
20 * Notification support for texts, voicemail, and/or missed calls
21 .
22 Homepage: http://gc-dialer.garage.maemo.org/
23 """
24 __author__ = "Ed Page"
25 __email__ = "eopage@byu.net"
26 __version__ = constants.__version__
27 __build__ = constants.__build__
28 __changelog__ = """
29 1.0.8
30 * Sped up login time by delay loading contact list
31 * Ability to narrow down messages either by type or status
32 * Fremantle: Notification Support including testing of custom notifications
33 * UI Tweak: Cut down the number of times the login dialog is needlessly displayed
34 * Bug Fix: Switching to accounts tab when callback is blank
35 * Debugging: Log contents now accessible through Ctrl+l
36
37 1.0.7
38 * Sped up various login cases
39 * Added descriptions to the callback numbers
40 * Collapsed conversations in the messages tab
41 * Give access to all of a contacts numbers when launching dialog from Recent or Messages tabs
42 * UI Tweak: Added more login status notifications
43 * UI Tweak: When no characters are entered, you can't send a text
44 * UI Tweak: Trying to consolidate dialogs by combining phone selection and SMS entry
45 * UI Tweak: Removed "Select" button from SMS Dialog
46 * UI Tweak: Increased the size of the SMS dialog
47 * UI Tweak: Disable "Dial" when a text has started to be entered
48 * UI Tweak: Move the sms history scroll bars around the whole sms conversation, giving more room to see with
49 * UI Tweak: Trying to be clearer by switching the login dialog from "Close" to "Cancel"
50 * UI Tweak: Remove auto-cancel of login after X attempts
51 * Bug Fix: Expanded the types of the Enter key that are supported for going to full screen
52 * Bug Fix: Random people were reporting login issues
53 * Bug Fix: Hardened against issues with grabbing possible callback numbers
54 * Bug Fix: Fremantle GTK doesn't allow TreeView rows to be selected, so row-activated handlers have to read their path
55 * Bug Fix: Fremantle PyMaemo doesn't provide a function Mer PyMaemo does, created a hack to be workable on both
56 * Bug Fix: Once PyMaemo supports thumb button sizes, setting that for all of the random buttons
57 * Bug Fix: When debugging hildonization, dialogs weren't closing
58 * Bug Fix: Not properly hildonizing some code
59 * Bug Fix: Attempting a hack to fix redirect issues for people
60 * Debugging: Improved logging output
61 * Debugging: Printing page when can't get a callback number
62 * Debugging: Included stuff to create all the debug files
63
64 1.0.6
65 * Fremantle Prep: Simplified menus in prep for no menu or the Fremantle App Menu
66 * Fremantle Prep: Implemented a work around for https://bugs.maemo.org/show_bug.cgi?id=4957
67 * Fremantle Prep: Switched to touch selectors for notification time, callback number, and contact addressbook
68 * Fremantle Prep: Making various widgets pannable rather than scrollable
69 * Fremantle Prep: CTRL-V added for paste for Dialpad
70 * Fremantle Prep: CTRL-Enter added for fullscreen
71 * UI Tweak: Phone selection and SMS Message dialogs now highlight the last message and are easier to scroll
72 * UI Tweak: Tweaked sizes of stuff on recent tab
73 * UI Tweak: Added notifcations for various things like login and dialing
74 * UI Tweak: Switch to accounts tab when logging in and callback is blank as a sublte hint to configure it
75 * UI Tweak: Switch to accounts tab on failed login to remind the user they are not logged in
76 * Packaging: Disables notifications on uninstall
77 * Packaging: Including a vastly improved py2deb for better packages (icons on package, etc)
78 * Debugging: Adding seperator between dialcentral launches in log
79 * Bug Fix: Made startup more error resistant
80 * Bug Fix: some dependencies for Diablo
81 * Bug Fix: Error on refreshing tabs when not logged in
82 * Bug Fix: #4471 Notification Checkbox Won't Stay Checked (hour roll over error)
83 * Bug Fix: Phone numbers in voicemails wouldn't appear
84 * Bug Fix: category for Fremantle/Diablo
85 * Bug Fix: needing to manually create "~/.dialcentral" due to earlier logging changes
86 * Bug Fix: dependencies for fremantle
87 * Bug Fix: Issues when trying to stack error messages
88 * Bug Fix: Python2.6 deprecates some stuff I did
89 * Bug Fix: On refreshing the Accounts tab, the callback number resets to the number from startup
90
91 1.0.5
92 * Contacts Tab remembers the last address book viewed on restart
93 * Applied some suggested changes for being more thumb friendly
94 * Messaging Dialog auto-scrolls to bottom
95 * Removed GrandCentral support
96 * Numbers can now be entered immediately, before login
97 * Bug Fix: Not clearing the entered number on sending an SMS
98 * Bug Fix: Disabling SMS button when logged off
99 * Bug Fix: Trying to make SMS and phone selection dialogs more readable
100 * Bug Fix: Adding some more thumb scrollbars
101
102 1.0.4
103 * "Back" button and tabs now visually indicate when they've entered a "hold" state
104 * Fixed the duplicate title on Maemo
105 * Removing some device connection observer code due to high bug to low benefit ratio
106 * Notification support
107 * Fixed a bug from 1.0.3 where once you refreshed a tab by holding on it, every tab would then be forced to refresh
108
109 1.0.3
110 * Holding down a tab for a second will now force a refresh
111 * Fixed a bug dealing with overzealously refreshing the contacts tab
112 * Finding some undescriptive errors and made them more descriptive
113 * Swapped the order GrandCentral and GoogleVoice appear in login window
114 * Fixed the "Recent" and "Message" tabs, google changed things on me again
115
116 1.0.2
117 * Random bug fixes
118 * Random performance improvements
119
120 1.0.1
121 * Fixed a voicemail transcripts due to a GoogleVoice change
122
123 1.0.0
124 * Added names to the recent tab for GoogleVoice
125
126 0.9.9
127 * SMS From Dialpad
128 * Display of names for messages tab
129 * Condensed messages/recent's date column
130
131 0.9.8
132  * Added columns to recent view and messages view to help seperate messages
133  * Attempted refreshing session on dial/sms send
134  * Fixed a GC Bug
135  * Minor bug fixes as usual
136
137 0.9.7
138  * Switched to Force Refresh for when wanting to check for more messages
139  * Removed timeouts that forced refreshes on various tabs
140  * Added support for a settings file, fairly primitive right now
141  * Fixed Maemo Support
142  * Lots of major and minor bug fixes
143
144 0.9.6
145  * Experimenting with the tabs being on the side
146  * Now the phone selector is used always, even if there is just one phone number
147  * Added a Messages Tab, which displays SMS and Voicemail messages
148  * Added option to send SMS messages
149
150 0.9.5
151  * Fixed a login issue due to Google changing their webpage
152
153 0.9.4 - ""
154  * Misc Bug fixes and experiments
155
156 0.9.3 - ""
157  * Removed the much disliked contact source ID
158  * Added saving of callback number when using GoogleVoice
159  * Got proper formatting on things ("&" rather than "&")
160  * Misc Bug fixes
161
162 0.9.2 - "Two heads are better than one"
163  * Adding of UI to switch between GC and GV
164  * Minimized flashing the dial button between grayed out and not on startup
165  * Bug fixes
166
167 0.9.1 - "Get your hands off that"
168  * GoogleVoice Support, what a pain
169  * More flexible CSV support.  It now checks the header row for what column name/number are in
170  * Experimenting with faster startup by caching PYC files with the package
171  * Fixing of some bad error handling
172  * More debug output for when people run into issues
173
174 0.9.0 - "Slick as snot"
175  * Caching of contacts
176  * Refactoring to make working with the code easier
177  * Filesystem backed contacts but currently only supporting a specific csv format
178  * Gracefully handle lack of connection and connection transitions
179  * Gracefully handle failed login
180  * A tiny bit better error reporting
181
182 0.8.3 - "Extras Love"
183  * Version bump fighting the extras autobuilder, I hope this works
184
185 0.8.2 - "Feed is for horses, so what about feedback?"
186  * Merged addressbook
187  * many more smaller fixes
188
189 0.8.1 - "Two Beers"
190  * Thumb scrollbars ( Kudos Khertan )
191
192 0.8.0 - "Spit and polish"
193  * Addressbook support
194  * threaded networking for better interactivity
195  * Hold down back to clear number
196  * Standard about dialog
197  * many more smaller fixes
198 """
199
200
201 __postinstall__ = """#!/bin/sh -e
202
203 gtk-update-icon-cache -f /usr/share/icons/hicolor
204 rm -f ~/.dialcentral/dialcentral.log
205 """
206
207 __preremove__ = """#!/bin/sh -e
208
209 python /usr/lib/dialcentral/alarm_handler.py -d || true
210 """
211
212
213 def find_files(path):
214         for root, dirs, files in os.walk(path):
215                 for file in files:
216                         if file.startswith("src-"):
217                                 fileParts = file.split("-")
218                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
219                                 assert unused == "src"
220                                 relPath = os.sep.join(relPathParts)
221                                 yield relPath, file, newName
222
223
224 def unflatten_files(files):
225         d = {}
226         for relPath, oldName, newName in files:
227                 if relPath not in d:
228                         d[relPath] = []
229                 d[relPath].append((oldName, newName))
230         return d
231
232
233 def build_package(distribution):
234         try:
235                 os.chdir(os.path.dirname(sys.argv[0]))
236         except:
237                 pass
238
239         py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
240         p = py2deb.Py2deb(__appname__)
241         p.prettyName = constants.__pretty_app_name__
242         p.description = __description__
243         p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Dialcentral"
244         #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
245         p.author = __author__
246         p.mail = __email__
247         p.license = "lgpl"
248         p.depends = ", ".join([
249                 "python2.6 | python2.5",
250                 "python-gtk2 | python2.5-gtk2",
251                 "python-xml | python2.5-xml",
252                 "python-dbus | python2.5-dbus",
253         ])
254         maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
255         p.depends += {
256                 "debian": ", python-glade2",
257                 "chinook": maemoSpecificDepends,
258                 "diablo": maemoSpecificDepends,
259                 "fremantle": maemoSpecificDepends + ", python-glade2, python-alarm",
260                 "mer": maemoSpecificDepends + ", python-glade2",
261         }[distribution]
262         p.recommends = ", ".join([
263         ])
264         p.section = {
265                 "debian": "comm",
266                 "chinook": "communication",
267                 "diablo": "user/network",
268                 "fremantle": "user/network",
269                 "mer": "user/network",
270         }[distribution]
271         p.arch = "all"
272         p.urgency = "low"
273         p.distribution = "chinook diablo fremantle mer debian"
274         p.repository = "extras"
275         p.changelog = __changelog__
276         p.postinstall = __postinstall__
277         p.preremove = __preremove__
278         p.icon = {
279                 "debian": "26x26-dialcentral.png",
280                 "chinook": "26x26-dialcentral.png",
281                 "diablo": "26x26-dialcentral.png",
282                 "fremantle": "64x64-dialcentral.png", # Fremantle natively uses 48x48
283                 "mer": "64x64-dialcentral.png",
284         }[distribution]
285         p["/usr/bin"] = [ "dialcentral.py" ]
286         for relPath, files in unflatten_files(find_files(".")).iteritems():
287                 fullPath = "/usr/lib/dialcentral"
288                 if relPath:
289                         fullPath += os.sep+relPath
290                 p[fullPath] = list(
291                         "|".join((oldName, newName))
292                         for (oldName, newName) in files
293                 )
294         p["/usr/share/applications/hildon"] = ["dialcentral.desktop"]
295         p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-dialcentral.png|dialcentral.png"]
296         p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-dialcentral.png|dialcentral.png"]
297         p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-dialcentral.png|dialcentral.png"]
298
299         print p
300         print p.generate(
301                 version="%s-%s" % (__version__, __build__),
302                 changelog=__changelog__,
303                 build=False,
304                 tar=True,
305                 changes=True,
306                 dsc=True,
307         )
308         print "Building for %s finished" % distribution
309
310
311 if __name__ == "__main__":
312         if len(sys.argv) > 1:
313                 try:
314                         import optparse
315                 except ImportError:
316                         optparse = None
317
318                 if optparse is not None:
319                         parser = optparse.OptionParser()
320                         (commandOptions, commandArgs) = parser.parse_args()
321         else:
322                 commandArgs = None
323                 commandArgs = ["diablo"]
324         build_package(commandArgs[0])