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