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