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