d19a18b48f7d30220be474a95165afffc891a50c
[gc-dialer] / support / builddeb.py
1 #!/usr/bin/python2.5
2
3 from py2deb import *
4
5
6 __appname__ = "dialcentral"
7 __description__ = "Simple interface to Google's GrandCentral(tm) service"
8 __author__ = "Ed Page"
9 __email__ = "eopage@byu.net"
10 __version__ = "0.9.1"
11 __build__ = 1
12 __changelog__ = '''\
13 0.9.1 - "Get your hands off that"
14  * GoogleVoice Support, what a pain
15  * More flexible CSV support.  It now checks the header row for what column name/number are in
16  * Experimenting with faster startup by caching PYC files with the package
17  * Fixing of some bad error handling
18  * More debug output for when people run into issues
19
20 0.9.0 - "Slick as snot"
21  * Caching of contacts
22  * Refactoring to make working with the code easier
23  * Filesystem backed contacts but currently only supporting a specific csv format
24  * Gracefully handle lack of connection and connection transitions
25  * Gracefully handle failed login
26  * A tiny bit better error reporting
27
28 0.8.3 - "Extras Love"
29  * Version bump fighting the extras autobuilder, I hope this works
30
31 0.8.2 - "Feed is for horses, so what about feedback?"
32  * Merged addressbook
33  * many more smaller fixes
34
35 0.8.1 - "Two Beers"
36  * Thumb scrollbars ( Kudos Khertan )
37
38 0.8.0 - "Spit and polish"
39  * Addressbook support
40  * threaded networking for better interactivity
41  * Hold down back to clear number
42  * Standard about dialog
43  * many more smaller fixes
44 '''
45
46
47 __postinstall__ = '''#!/bin/sh
48
49 gtk-update-icon-cache /usr/share/icons/hicolor
50 '''
51
52
53 def find_files(path):
54         for root, dirs, files in os.walk(path):
55                 for file in files:
56                         if file.startswith("src-"):
57                                 fileParts = file.split("-")
58                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
59                                 assert unused == "src"
60                                 relPath = os.sep.join(relPathParts)
61                                 yield relPath, file, newName
62
63
64 def unflatten_files(files):
65         d = {}
66         for relPath, oldName, newName in files:
67                 if relPath not in d:
68                         d[relPath] = []
69                 d[relPath].append((oldName, newName))
70         return d
71
72
73 if __name__ == "__main__":
74         try:
75                 os.chdir(os.path.dirname(sys.argv[0]))
76         except:
77                 pass
78
79         p = Py2deb(__appname__)
80         p.description = __description__
81         p.author = __author__
82         p.mail = __email__
83         p.license = "lgpl"
84         p.depends = "python2.5, python2.5-gtk2"
85         p.section = "user/network"
86         p.arch = "all"
87         p.urgency = "low"
88         p.distribution = "chinook diablo"
89         p.repository = "extras-devel"
90         p.changelog = __changelog__
91         p.postinstall = __postinstall__
92         p.icon="26x26-dialcentral.png"
93         p["/usr/bin"] = [ "dialcentral.py" ]
94         for relPath, files in unflatten_files(find_files(".")).iteritems():
95                 fullPath = "/usr/lib/dialcentral"
96                 if relPath:
97                         fullPath += os.sep+relPath
98                 p[fullPath] = list(
99                         "|".join((oldName, newName))
100                         for (oldName, newName) in files
101                 )
102         p["/usr/share/applications/hildon"] = ["dialcentral.desktop"]
103         p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-dialcentral.png|dialcentral.png"]
104         p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-dialcentral.png|dialcentral.png"]
105         p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-dialcentral.png|dialcentral.png"]
106
107         print p
108         print p.generate(
109                 __version__, __build__, changelog=__changelog__,
110                 tar=True, dsc=True, changes=True, build=False, src=True
111         )