77ff5147e302d436b805e051150e261e227d72f1
[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
17 0.3.0
18  * Initial Release
19  * Backend Support: Remember The Milk
20  * Completing of tasks
21  * Browse to task URLs
22  * Task editing:
23    * Task list
24    * Task Name
25    * Task Priority
26    * Task Due Date
27  * Note Viewer / Editor
28  * Not supported:
29    * Adding, renaming, and (un)archiving of lists
30    * Uncompleting a task and viewing completed tasks
31    * Viewing/editing of task recurrence, time estimate, tags, location, url
32    * Postponing tasks
33    * Due time
34 '''
35
36
37 __postinstall__ = '''#!/bin/sh
38
39 gtk-update-icon-cache /usr/share/icons/hicolor
40 '''
41
42
43 def find_files(path):
44         for root, dirs, files in os.walk(path):
45                 for file in files:
46                         if file.startswith("src-"):
47                                 fileParts = file.split("-")
48                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
49                                 assert unused == "src"
50                                 relPath = os.sep.join(relPathParts)
51                                 yield relPath, file, newName
52
53
54 def unflatten_files(files):
55         d = {}
56         for relPath, oldName, newName in files:
57                 if relPath not in d:
58                         d[relPath] = []
59                 d[relPath].append((oldName, newName))
60         return d
61
62
63 if __name__ == "__main__":
64         try:
65                 os.chdir(os.path.dirname(sys.argv[0]))
66         except:
67                 pass
68
69         p = Py2deb(__appname__)
70         p.description = __description__
71         p.author = __author__
72         p.mail = __email__
73         p.license = "lgpl"
74         p.depends = "python2.5, python2.5-gtk2"
75         p.section = "user/communication"
76         p.arch = "all"
77         p.urgency = "low"
78         p.distribution = "chinook diablo"
79         p.repository = "extras-devel"
80         p.changelog = __changelog__
81         p.postinstall = __postinstall__
82         p.icon="26x26-doneit.png"
83         p["/usr/bin"] = [ "doneit.py" ]
84         for relPath, files in unflatten_files(find_files(".")).iteritems():
85                 fullPath = "/usr/lib/doneit"
86                 if relPath:
87                         fullPath += os.sep+relPath
88                 p[fullPath] = list(
89                         "|".join((oldName, newName))
90                         for (oldName, newName) in files
91                 )
92         p["/usr/share/applications/hildon"] = ["doneit.desktop"]
93         # p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-doneit.png|doneit.png"]
94         # p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-doneit.png|doneit.png"]
95         # p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-doneit.png|doneit.png"]
96
97         print p
98         print p.generate(
99                 __version__, __build__, changelog=__changelog__,
100                 tar=True, dsc=True, changes=True, build=False, src=True
101         )