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