Bump to 0.8.10
[theonering] / 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__ = """Send/receive texts and initiate GV callbacks all through Conversations and Phone
16 Features:
17 .
18 * Send Texts and Receive both Texts and Voicemail through your chat window (buggy on Maemo 4.1)
19 .
20 * Initiate Google Voice callbacks from the dialpad or your contacts
21 .
22 * Access to all of your Google Voice contacts (Maemo 4.1 only for now)
23 .
24 * Reduce battery drain by setting your status to "Away"
25 .
26 * Block incoming calls by switching your status to "Hidden"
27 .
28 Note: Google and Google Voice are probably trademarks of Google.  This software nor the author has any affiliation with Google
29 .
30 Homepage: http://theonering.garage.maemo.org
31 """
32 __author__ = "Ed Page"
33 __email__ = "eopage@byu.net"
34 __version__ = constants.__version__
35 __build__ = constants.__build__
36 __changelog__ = """
37 0.8.10
38 * More improvements to the logging
39
40 0.8.9
41 * For now removing "removing of old conversations" in case that is contributing to people's problems
42 * Attempting to use the messages actual time stamp rather than the time when we received it
43 * Adding a bit of paranoia to marking messages as read
44 * Added lots of debugging help
45
46 0.8.8
47 * Switching to a non-blocking system so TOR can remain responsive to MC and avoid being leaked in the first place
48
49 0.8.7
50 * Adding some logging to help track down some issues
51
52 0.8.6
53 * Switched to a 10 second timeout without connections before closing TOR
54 * Reduced the numbr of conversations cached
55 * Forcing system contacts to be enabled but only calls are working for now
56 * Bugfix: Reduced windows of hitting "Network Failure" when transitioning between networks
57
58 0.8.5
59 * Bugfix: User's locale differs from google's causes errors
60 * Bugfix: Reducing the times we ignore the cache of past conversations
61 * Bugfix: The One Ring does not work on desktop systems with Empathy 2.28
62
63 0.8.4
64 * Reduced time allowed for disconnect due to RTComm not putting TOR on hold, causing miss of callback
65 * Doubled the timed disconnects time
66 * Cleaning up things to better match the latest Empathy
67 * Bugfix: Random "General Error"s when making a call
68
69 0.8.3
70 * "Hold" support for calls, so that initiating a callback does not block incoming calls
71 * Increased the auto-cleanup timeout from 5 seconds to 10 seconds
72
73 0.8.2
74 * Improved debug logs, removing noise
75 * Reduced allotted disconnect time from 5 seconds to 2
76 * Auto-cleanup resources when client only does phase 1 of 2 connection creation phases
77 * Added 26x26 and 64x64 variants of icons to hopefully fix issues on Maemo 4.1
78
79 0.8.1
80 * Canceling of outbound calls
81 * Bugfix: Removing race condition with disconnect.  I introduced it expecting it to help but it hurts more than it helps
82
83 0.8.0
84 * Basic avatar support to distinguish phone types
85 * Tweaks to hopefully improve behavior
86
87 0.7.14
88 * Bugfix: Polling state machines weren't properly resetting (maybe thats why I had such good battery life)
89 * Bugfix: On Maemo 4.1 there are still some empty windows created
90 * Bugfix: Obscure alias bug no one should hit with The One Ring
91 * Bugfix: Another obscure bug causing possibly no negative side-effects
92
93 0.7.13
94 * Bugfix: Cancelling timeouts
95
96 0.7.12
97 * Bugfix: In 0.7.11 I messed up refreshing messages
98 * Bugfix: DND support has been broken for a while
99 * Bugfix: Auto-disconnect on Maemo 4.1 couldn't have worked for a while
100 * Bugfix: Handling missed calls had .. issues
101 * Bugfix: Issues when making a call introduced in 0.7.11
102 * Etc with the bug fixes (all too small to list)
103
104 0.7.11
105 * Bugfix: Attempting to improve the behavior of calls by reducing potential RTComm errors
106 * Bugfix: Issues with weird unexpected disconnect issues
107 * Bugfix: I guess I made a mistake in registering for system signals, whoops
108 * Bugfix: Following more closely the Telepathy spec by doing connects and disconnects asynchronously
109
110 0.7.10
111 * Increased the network timeout when connecting to GV
112 * Bugfix: On connection failure, the connection would be left around, preventing future connections
113
114 0.7.9
115 * Bugfix: Disconnect/Reconnect issues seem to be lessoned for me (What I previously thought was a bugfix turned out to cause several bugs.)
116
117 0.7.8
118 * Bugfix: Issues with checking for new conversations
119
120 0.7.7
121 * On change between available/away, start state_machine at max rather than min, reducing overhead
122 * Added a check for voicemails on missed/rejected calls (checks 3 times, 1 minute apart each)
123 * Adjusted default polling times to be more battery cautious for our n8x0 friends who can't change things right now
124 * Bugfix: Some of the derived polling settings had bugs
125 * Bugfix: Setting text polling to infinite would still have polling done if one sent a text
126
127 0.7.6
128 * On login, polling now starts at the max time rather than the min, reducing overhead
129 * Bugfix: Polling configuration wasn't actually hooked up to anything
130 * Debug Prompt: Made it so you can either reset one or all state machines (Rather than just all)
131
132 0.7.5
133 * Fixing a polling time bug introduced when making polling configurable
134
135 0.7.4
136 * Fixing a bug with deny-lists
137
138 0.7.3
139 * Fixing bug with being able to configure polling times
140
141 0.7.2
142 * Added a Deny list
143 * Added option to make GV Contacts optional
144 * Added a limit, where if a state machine period is longer than it, than we set the period to infinite
145 * Delayed when we say the connection is disconnected to hopefully help random issues
146 * Tweaked how The One Ring shows up in the addressbook (Maemo 5)
147 * Made polling configurable
148 * Delayed auto-disconnect in case the user is just switching network connections (Maemo 4.1)
149 * Bugfix: Removed superfluous blank message from debug prompt
150 * Bugfix: Moved some more (very minor, very rarely used) timeouts to second resolution reducing overhead
151 * Bugfix: debug prompt commands handled command validation poorly
152 * Debug Prompt: Added a "version" command
153 * Debug Prompt: Added a "get_polling" command to find out what the actual polling periods are
154 * Debug Prompt: Added a "grab_log" command which is a broken but means to offer the log file through a file transfer
155 * Debug Prompt: Added a "save_log" command to help till grab_log works and for where file transfers aren't supported by clients
156
157 0.7.1
158 * Reducing the race window where GV will mark messages as read accidently
159 * Modified some things blindly "because thats what Butterfly does"
160 * Modified some support files to mimic other plugins on Maemo 5 PR1.1
161 * Added link to bug tracker and moved all bugs and enhancements to it
162 * Switched contacts to being away by default upon user feedback
163 * Adjusting handling of call states to at least allow the option of clients to provide clearer information to the user
164 * Fixing some bugs with handling a variety of phone number formats
165 * Removed a hack that changed the number being called, most likely put in place in a bygone era
166
167 0.7.0
168 * Initial beta release for Maemo 5
169 * Late Alpha for Maemo 4.1 with horrible consequences like crashing RTComm
170
171 0.1.0
172 * Pre-Alpha Development Release
173 """
174
175
176 __postinstall__ = """#!/bin/sh -e
177
178 gtk-update-icon-cache -f /usr/share/icons/hicolor
179 rm -f ~/.telepathy-theonering/theonering.log
180 """
181
182 def find_files(path):
183         for root, dirs, files in os.walk(path):
184                 for file in files:
185                         if file.startswith("src!"):
186                                 fileParts = file.split("!")
187                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
188                                 assert unused == "src"
189                                 relPath = os.sep.join(relPathParts)
190                                 yield relPath, file, newName
191
192
193 def unflatten_files(files):
194         d = {}
195         for relPath, oldName, newName in files:
196                 if relPath not in d:
197                         d[relPath] = []
198                 d[relPath].append((oldName, newName))
199         return d
200
201
202 def build_package(distribution):
203         try:
204                 os.chdir(os.path.dirname(sys.argv[0]))
205         except:
206                 pass
207
208         py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
209         p = py2deb.Py2deb(__appname__)
210         if distribution == "debian":
211                 p.prettyName = constants.__pretty_app_name__
212         else:
213                 p.prettyName = "Google Voice plugin for Conversations and Calls"
214         p.description = __description__
215         p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=The%%20One%%20Ring"
216         #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
217         p.author = __author__
218         p.mail = __email__
219         p.license = "lgpl"
220         p.section = {
221                 "debian": "comm",
222                 "diablo": "user/network",
223                 "fremantle": "user/network",
224         }[distribution]
225         p.depends = ", ".join([
226                 "python (>= 2.5) | python2.5",
227                 "python-dbus | python2.5-dbus",
228                 "python-gobject | python2.5-gobject",
229                 "python-telepathy | python2.5-telepathy",
230         ])
231         p.depends += {
232                 "debian": "",
233                 "diablo": ", python2.5-conic, account-plugin-haze",
234                 "fremantle": ", account-plugin-haze",
235         }[distribution]
236         p.arch = "all"
237         p.urgency = "low"
238         p.distribution = "diablo fremantle debian"
239         p.repository = "extras"
240         p.changelog = __changelog__
241         p.postinstall = __postinstall__
242         p.icon = "32-tor_handset.png"
243         for relPath, files in unflatten_files(find_files(".")).iteritems():
244                 fullPath = "/usr/lib/theonering"
245                 if relPath:
246                         fullPath += os.sep+relPath
247                 p[fullPath] = list(
248                         "|".join((oldName, newName))
249                         for (oldName, newName) in files
250                 )
251         p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
252         if distribution in ("debian", ):
253                 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
254         elif distribution in ("diablo", "fremantle"):
255                 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
256         p["/usr/lib/telepathy"] = ["telepathy-theonering"]
257         p["/usr/share/telepathy/managers"] = ["theonering.manager"]
258         if distribution in ("debian", ):
259                 iconBasePath = "/usr/share/icons/gnome/%s/apps"
260         elif distribution in ("diablo", "fremantle"):
261                 iconBasePath = "/usr/share/icons/hicolor/%s/hildon"
262         p[iconBasePath % "26x26"] = ["26-tor_handset.png|im-theonering.png"]
263         p[iconBasePath % "32x32"] = ["32-tor_handset.png|im-theonering.png"]
264         p[iconBasePath % "64x64"] = ["64-tor_handset.png|im-theonering.png"]
265         p["/usr/share/theonering"] = [
266                 "32-tor_handset.png|tor_handset.png",
267                 "32-tor_phone.png|tor_phone.png",
268                 "32-tor_question.png|tor_question.png",
269                 "32-tor_self.png|tor_self.png",
270         ]
271
272         if distribution == "debian":
273                 print p
274                 print p.generate(
275                         version="%s-%s" % (__version__, __build__),
276                         changelog=__changelog__,
277                         build=True,
278                         tar=False,
279                         changes=False,
280                         dsc=False,
281                 )
282                 print "Building for %s finished" % distribution
283         else:
284                 print p
285                 print p.generate(
286                         version="%s-%s" % (__version__, __build__),
287                         changelog=__changelog__,
288                         build=False,
289                         tar=True,
290                         changes=True,
291                         dsc=True,
292                 )
293                 print "Building for %s finished" % distribution
294
295
296 if __name__ == "__main__":
297         if len(sys.argv) > 1:
298                 try:
299                         import optparse
300                 except ImportError:
301                         optparse = None
302
303                 if optparse is not None:
304                         parser = optparse.OptionParser()
305                         (commandOptions, commandArgs) = parser.parse_args()
306         else:
307                 commandArgs = None
308                 commandArgs = ["diablo"]
309         build_package(commandArgs[0])