Minor updates being taken in from Dialcentral
[doneit] / 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
12 __appname__ = "doneit"
13 __description__ = "Todo Manager"
14 __author__ = "Ed Page"
15 __email__ = "eopage@byu.net"
16 __version__ = "0.3.1"
17 __build__ = 0
18 __changelog__ = '''\
19 0.3.1
20  * Fixed bug where if you had no backend enabled, you couldn't enable a backend (Now hit "Connect" in the "File" menu)
21  * Fixed some polish bugs with the popup calendar
22  * Caching added to RTM backend
23  * File backend
24  * Misc other stuff
25
26 0.3.0
27  * Initial Release
28  * Backend Support: Remember The Milk
29  * Completing of tasks
30  * Browse to task URLs
31  * Task editing:
32    * Task list
33    * Task Name
34    * Task Priority
35    * Task Due Date
36  * Note Viewer / Editor
37  * Not supported:
38    * Adding, renaming, and (un)archiving of lists
39    * Uncompleting a task and viewing completed tasks
40    * Viewing/editing of task recurrence, time estimate, tags, location, url
41    * Postponing tasks
42    * Due time
43 '''
44
45
46 __postinstall__ = '''#!/bin/sh -e
47
48 gtk-update-icon-cache -f /usr/share/icons/hicolor
49 '''
50
51
52 def find_files(path):
53         for root, dirs, files in os.walk(path):
54                 for file in files:
55                         if file.startswith("src-"):
56                                 fileParts = file.split("-")
57                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
58                                 assert unused == "src"
59                                 relPath = os.sep.join(relPathParts)
60                                 yield relPath, file, newName
61
62
63 def unflatten_files(files):
64         d = {}
65         for relPath, oldName, newName in files:
66                 if relPath not in d:
67                         d[relPath] = []
68                 d[relPath].append((oldName, newName))
69         return d
70
71
72 if __name__ == "__main__":
73         try:
74                 os.chdir(os.path.dirname(sys.argv[0]))
75         except:
76                 pass
77
78         p = py2deb.Py2deb(__appname__)
79         p.description = __description__
80         p.author = __author__
81         p.mail = __email__
82         p.license = "lgpl"
83         p.depends = "python2.5, python2.5-gtk2, python2.5-xml"
84         p.section = "user/communication"
85         p.arch = "all"
86         p.urgency = "low"
87         p.distribution = "chinook diablo fremantle"
88         p.repository = "extras"
89         p.changelog = __changelog__
90         p.postinstall = __postinstall__
91         p.icon="26x26-doneit.png"
92         p["/usr/bin"] = [ "doneit.py" ]
93         for relPath, files in unflatten_files(find_files(".")).iteritems():
94                 fullPath = "/usr/lib/doneit"
95                 if relPath:
96                         fullPath += os.sep+relPath
97                 p[fullPath] = list(
98                         "|".join((oldName, newName))
99                         for (oldName, newName) in files
100                 )
101         p["/usr/share/applications/hildon"] = ["doneit.desktop"]
102         # p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-doneit.png|doneit.png"]
103         # p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-doneit.png|doneit.png"]
104         # p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-doneit.png|doneit.png"]
105
106         print p
107         print p.generate(
108                 __version__, __build__, changelog=__changelog__,
109                 tar=True, dsc=True, changes=True, build=False, src=True
110         )