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