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