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