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