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