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