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