New release
[ussd-widget] / ussd-common / build_ussd-common.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-common")
23     p.description="Command line utility for makein USSD queries"
24     p.author="Alexey Guseynov"
25     p.mail="kibergus@gmail.com"
26     p.depends = "python2.5, pexpect"
27     p.section="misc"
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="https://garage.maemo.org/tracker/?group_id=1219"
34     p.postinstall="""#!/bin/sh
35 # we need to make pnatd setuid root
36 # if you feel that this is a security hole, you may come up with a
37 # better solution :)
38 chmod +s /usr/bin/pnatd
39 """ #Set here your post install script
40
41     version = "0.0.3"
42     build = "0" 
43     changeloginformation = "Language selection support, line break in reply bug fixed." 
44    
45     dir_name = "src"     
46
47     #Thanks to DareTheHair from talk.maemo.org for this snippet that recursively builds the file list 
48     for root, dirs, files in os.walk(dir_name):
49         real_dir = root[len(dir_name):]
50         fake_file = []
51         for f in files:
52             fake_file.append(root + os.sep + f + "|" + f);
53         if len(fake_file) > 0:
54             p[real_dir] = fake_file
55
56     print p
57     r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)
58     fake_file.append(root + os.sep + f + "|" + f)
59     if len(fake_file) > 0:
60         p[real_dir] = fake_file