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