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