Bumping to 0.7.9
[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.7.9
38 * Bugfix: Disconnect/Reconnect issues seem to be lessoned for me (What I previously thought was a bugfix turned out to cause several bugs.)
39
40 0.7.8
41 * Bugfix: Issues with checking for new conversations
42
43 0.7.7
44 * On change between available/away, start state_machine at max rather than min, reducing overhead
45 * Added a check for voicemails on missed/rejected calls (checks 3 times, 1 minute apart each)
46 * Adjusted default polling times to be more battery cautious for our n8x0 friends who can't change things right now
47 * Bugfix: Some of the derived polling settings had bugs
48 * Bugfix: Setting text polling to infinite would still have polling done if one sent a text
49
50 0.7.6
51 * On login, polling now starts at the max time rather than the min, reducing overhead
52 * Bugfix: Polling configuration wasn't actually hooked up to anything
53 * Debug Prompt: Made it so you can either reset one or all state machines (Rather than just all)
54
55 0.7.5
56 * Fixing a polling time bug introduced when making polling configurable
57
58 0.7.4
59 * Fixing a bug with deny-lists
60
61 0.7.3
62 * Fixing bug with being able to configure polling times
63
64 0.7.2
65 * Added a Deny list
66 * Added option to make GV Contacts optional
67 * Added a limit, where if a state machine period is longer than it, than we set the period to infinite
68 * Delayed when we say the connection is disconnected to hopefully help random issues
69 * Tweaked how The One Ring shows up in the addressbook (Maemo 5)
70 * Made polling configurable
71 * Delayed auto-disconnect in case the user is just switching network connections (Maemo 4.1)
72 * Bugfix: Removed superfluous blank message from debug prompt
73 * Bugfix: Moved some more (very minor, very rarely used) timeouts to second resolution reducing overhead
74 * Bugfix: debug prompt commands handled command validation poorly
75 * Debug Prompt: Added a "version" command
76 * Debug Prompt: Added a "get_polling" command to find out what the actual polling periods are
77 * Debug Prompt: Added a "grab_log" command which is a broken but means to offer the log file through a file transfer
78 * Debug Prompt: Added a "save_log" command to help till grab_log works and for where file transfers aren't supported by clients
79
80 0.7.1
81 * Reducing the race window where GV will mark messages as read accidently
82 * Modified some things blindly "because thats what Butterfly does"
83 * Modified some support files to mimic other plugins on Maemo 5 PR1.1
84 * Added link to bug tracker and moved all bugs and enhancements to it
85 * Switched contacts to being away by default upon user feedback
86 * Adjusting handling of call states to at least allow the option of clients to provide clearer information to the user
87 * Fixing some bugs with handling a variety of phone number formats
88 * Removed a hack that changed the number being called, most likely put in place in a bygone era
89
90 0.7.0
91 * Initial beta release for Maemo 5
92 * Late Alpha for Maemo 4.1 with horrible consequences like crashing RTComm
93
94 0.1.0
95 * Pre-Alpha Development Release
96 """
97
98
99 __postinstall__ = """#!/bin/sh -e
100
101 gtk-update-icon-cache -f /usr/share/icons/hicolor
102 rm -f ~/.telepathy-theonering/theonering.log
103 """
104
105 def find_files(path):
106         for root, dirs, files in os.walk(path):
107                 for file in files:
108                         if file.startswith("src!"):
109                                 fileParts = file.split("!")
110                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
111                                 assert unused == "src"
112                                 relPath = os.sep.join(relPathParts)
113                                 yield relPath, file, newName
114
115
116 def unflatten_files(files):
117         d = {}
118         for relPath, oldName, newName in files:
119                 if relPath not in d:
120                         d[relPath] = []
121                 d[relPath].append((oldName, newName))
122         return d
123
124
125 def build_package(distribution):
126         try:
127                 os.chdir(os.path.dirname(sys.argv[0]))
128         except:
129                 pass
130
131         py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
132         p = py2deb.Py2deb(__appname__)
133         if distribution == "debian":
134                 p.prettyName = constants.__pretty_app_name__
135         else:
136                 p.prettyName = "Google Voice plugin for Conversations and Calls"
137         p.description = __description__
138         p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=The%%20One%%20Ring"
139         #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
140         p.author = __author__
141         p.mail = __email__
142         p.license = "lgpl"
143         p.section = {
144                 "debian": "comm",
145                 "diablo": "user/network",
146                 "fremantle": "user/network",
147                 "mer": "user/network",
148         }[distribution]
149         p.depends = ", ".join([
150                 "python (>= 2.5) | python2.5",
151                 "python-dbus | python2.5-dbus",
152                 "python-gobject | python2.5-gobject",
153                 "python-telepathy | python2.5-telepathy",
154         ])
155         p.depends += {
156                 "debian": "",
157                 "diablo": ", python2.5-conic, account-plugin-haze",
158                 "fremantle": ", account-plugin-haze",
159                 "mer": "",
160         }[distribution]
161         p.arch = "all"
162         p.urgency = "low"
163         p.distribution = "diablo fremantle mer debian"
164         p.repository = "extras"
165         p.changelog = __changelog__
166         p.postinstall = __postinstall__
167         p.icon = {
168                 "debian": "26x26-theonering.png",
169                 "diablo": "26x26-theonering.png",
170                 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
171                 "mer": "64x64-theonering.png",
172         }[distribution]
173         for relPath, files in unflatten_files(find_files(".")).iteritems():
174                 fullPath = "/usr/lib/theonering"
175                 if relPath:
176                         fullPath += os.sep+relPath
177                 p[fullPath] = list(
178                         "|".join((oldName, newName))
179                         for (oldName, newName) in files
180                 )
181         p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
182         if distribution in ("debian", ):
183                 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
184         elif distribution in ("diablo", "fremantle", "mer"):
185                 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
186         p["/usr/lib/telepathy"] = ["telepathy-theonering"]
187         p["/usr/share/telepathy/managers"] = ["theonering.manager"]
188         p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|im-theonering.png"]
189
190         if distribution == "debian":
191                 print p
192                 print p.generate(
193                         version="%s-%s" % (__version__, __build__),
194                         changelog=__changelog__,
195                         build=True,
196                         tar=False,
197                         changes=False,
198                         dsc=False,
199                 )
200                 print "Building for %s finished" % distribution
201         else:
202                 print p
203                 print p.generate(
204                         version="%s-%s" % (__version__, __build__),
205                         changelog=__changelog__,
206                         build=False,
207                         tar=True,
208                         changes=True,
209                         dsc=True,
210                 )
211                 print "Building for %s finished" % distribution
212
213
214 if __name__ == "__main__":
215         if len(sys.argv) > 1:
216                 try:
217                         import optparse
218                 except ImportError:
219                         optparse = None
220
221                 if optparse is not None:
222                         parser = optparse.OptionParser()
223                         (commandOptions, commandArgs) = parser.parse_args()
224         else:
225                 commandArgs = None
226                 commandArgs = ["diablo"]
227         build_package(commandArgs[0])