06f222a45b638d29f6734800093b9fd865aae908
[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__ = 0
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
18 0.9.0 - "Slick as snot"
19  * Caching of contacts
20  * Refactoring to make working with the code easier
21  * Filesystem backed contacts but currently only supporting a specific csv format
22  * Gracefully handle lack of connection and connection transitions
23  * Gracefully handle failed login
24  * A tiny bit better error reporting
25
26 0.8.3 - "Extras Love"
27  * Version bump fighting the extras autobuilder, I hope this works
28
29 0.8.2 - "Feed is for horses, so what about feedback?"
30  * Merged addressbook
31  * many more smaller fixes
32
33 0.8.1 - "Two Beers"
34  * Thumb scrollbars ( Kudos Khertan )
35
36 0.8.0 - "Spit and polish"
37  * Addressbook support
38  * threaded networking for better interactivity
39  * Hold down back to clear number
40  * Standard about dialog
41  * many more smaller fixes
42 '''
43
44
45 __postinstall__ = '''#!/bin/sh
46
47 gtk-update-icon-cache /usr/share/icons/hicolor
48 '''
49
50
51 def find_files(path):
52         for root, dirs, files in os.walk(path):
53                 for file in files:
54                         if file.startswith("src-"):
55                                 fileParts = file.split("-")
56                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
57                                 assert unused == "src"
58                                 relPath = os.sep.join(relPathParts)
59                                 yield relPath, file, newName
60
61
62 def unflatten_files(files):
63         d = {}
64         for relPath, oldName, newName in files:
65                 if relPath not in d:
66                         d[relPath] = []
67                 d[relPath].append((oldName, newName))
68         return d
69
70
71 if __name__ == "__main__":
72         try:
73                 os.chdir(os.path.dirname(sys.argv[0]))
74         except:
75                 pass
76
77         p = Py2deb(__appname__)
78         p.description = __description__
79         p.author = __author__
80         p.mail = __email__
81         p.license = "lgpl"
82         p.depends = "python2.5, python2.5-gtk2"
83         p.section = "user/communication"
84         p.arch = "all"
85         p.urgency = "low"
86         p.distribution = "chinook diablo"
87         p.repository = "extras-devel"
88         p.changelog = __changelog__
89         p.postinstall = __postinstall__
90         p.icon="26x26-dialcentral.png"
91         p["/usr/bin"] = [ "dialcentral.py" ]
92         for relPath, files in unflatten_files(find_files(".")).iteritems():
93                 fullPath = "/usr/lib/dialcentral"
94                 if relPath:
95                         fullPath += os.sep+relPath
96                 p[fullPath] = list(
97                         "|".join((oldName, newName))
98                         for (oldName, newName) in files
99                 )
100         p["/usr/share/applications/hildon"] = ["dialcentral.desktop"]
101         p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-dialcentral.png|dialcentral.png"]
102         p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-dialcentral.png|dialcentral.png"]
103         p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-dialcentral.png|dialcentral.png"]
104
105         print p
106         print p.generate(
107                 __version__, __build__, changelog=__changelog__,
108                 tar=True, dsc=True, changes=True, build=False, src=True
109         )