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