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