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