Tagging the releases, whoops forgot this
[ejpi] / support / builddeb.py
1 #!/usr/bin/python2.5
2
3 from py2deb import *
4
5
6 __appname__ = "ejpi"
7 __description__ = "RPN Calculator"
8 __author__ = "Ed Page"
9 __email__ = "eopage@byu.net"
10 __version__ = "0.9.1"
11 __build__ = 1
12 __changelog__ = '''\
13 0.9.1 - "Laziness doesn't always pay off"
14  * Profiled the code with an especial focus on the pie menus
15  * Tried to reduce potential bugs with double clicks
16  * Fixed a visual artifact issue on popup
17
18 0.9.0 - "Feed is for horses, so what about feedback?"
19  * Initial public release
20  * Pie menus for keys
21  * Modifiable history
22  * Supports different number types and bases
23  * Basic trig support
24 '''
25
26
27 __postinstall__ = '''#!/bin/sh
28
29 gtk-update-icon-cache /usr/share/icons/hicolor
30 '''
31
32
33 def find_files(path):
34         for root, dirs, files in os.walk(path):
35                 for file in files:
36                         if file.startswith("src-"):
37                                 fileParts = file.split("-")
38                                 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
39                                 assert unused == "src"
40                                 relPath = os.sep.join(relPathParts)
41                                 yield relPath, file, newName
42
43
44 def unflatten_files(files):
45         d = {}
46         for relPath, oldName, newName in files:
47                 if relPath not in d:
48                         d[relPath] = []
49                 d[relPath].append((oldName, newName))
50         return d
51
52
53 if __name__ == "__main__":
54         try:
55                 os.chdir(os.path.dirname(sys.argv[0]))
56         except:
57                 pass
58
59         p = Py2deb(__appname__)
60         p.description = __description__
61         p.author = __author__
62         p.mail = __email__
63         p.license = "lgpl"
64         p.depends = "python2.5, python2.5-gtk2"
65         # p.section = "user/utilities"
66         p.section = "user/accessories"
67         p.arch = "all"
68         p.urgency = "low"
69         p.distribution = "chinook diablo"
70         p.repository = "extras-devel"
71         p.changelog = __changelog__
72         p.postinstall = __postinstall__
73         p.icon="26x26-ejpi.png"
74         p["/usr/bin"] = [ "ejpi.py" ]
75         for relPath, files in unflatten_files(find_files(".")).iteritems():
76                 fullPath = "/usr/lib/ejpi"
77                 if relPath:
78                         fullPath += os.sep+relPath
79                 p[fullPath] = list(
80                         "|".join((oldName, newName))
81                         for (oldName, newName) in files
82                 )
83         p["/usr/share/applications/hildon"] = ["ejpi.desktop"]
84         # p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-dialcentral.png|dialcentral.png"]
85         # p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-dialcentral.png|dialcentral.png"]
86         # p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-dialcentral.png|dialcentral.png"]
87
88         print p
89         print p.generate(
90                 __version__, __build__, changelog=__changelog__,
91                 tar=True, dsc=True, changes=True, build=False, src=True
92         )