New release
[ussd-widget] / ussd-widget / build_ussd-widget.py
1 #!/usr/bin/python2.5
2 # -*- coding: utf-8 -*-
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published
5 ## by the Free Software Foundation; version 2 only.
6 ##
7 ## This program is distributed in the hope that it will be useful,
8 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
9 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 ## GNU General Public License for more details.
11 ##
12 import py2deb
13 import os
14
15 if __name__ == "__main__":
16     try:
17         os.chdir(os.path.dirname(sys.argv[0]))
18     except:
19         pass
20     print
21
22     p=py2deb.Py2deb("ussd-widget")
23     p.description="Widget, that executes USSD query and displays response text\nThe main purpose is viewing your balance. In Russia all operators provide balace information via USSD queries and most part of contracts are prepaid. Ability to see your balance on desktop can be useful in such case.\nAnyway, you can configure widget to any other USSD query."
24     p.author="Alexey Guseynov"
25     p.mail="kibergus@gmail.com"
26     p.depends = "python2.5, ussd-common (>=0.0.3), python-hildondesktop (>=0.1.0-1maemo2), hildon-desktop-python-loader (>=0.1.0-1maemo2), python-gtk2, python-gobject, python-hildon, python-cairo"
27     p.section="user/desktop"
28     p.icon = "./ussd-widget.png"
29     p.arch="all"                #should be all for python, any for all arch
30     p.urgency="low"             #not used in maemo onl for deb os
31     p.distribution="fremantle"
32     p.repository="extras-devel"
33     p.xsbc_bugtracker="http://bugs.maemo.org"
34 #    p.postinstall="""#!/bin/sh
35 #""" #Set here your post install script
36
37     version = "0.1.0"
38     build = "0" 
39     changeloginformation = "Banner support." 
40    
41     dir_name = "src"   
42
43     #Thanks to DareTheHair from talk.maemo.org for this snippet that recursively builds the file list 
44     for root, dirs, files in os.walk(dir_name):
45         real_dir = root[len(dir_name):]
46         fake_file = []
47         for f in files:
48             fake_file.append(root + os.sep + f + "|" + f);
49         if len(fake_file) > 0:
50             p[real_dir] = fake_file
51
52     print p
53     r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)
54     fake_file.append(root + os.sep + f + "|" + f)
55     if len(fake_file) > 0:
56         p[real_dir] = fake_file