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