Merge branch 'stable'
[pedometerwidget] / build_pedo.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 if __name__ == "__main__":
15     try:
16         os.chdir(os.path.dirname(sys.argv[0]))
17     except:
18         pass
19     print
20     p=py2deb.Py2deb("pedometerhomewidget")   #This is the package name and MUST be in lowercase! (using e.g. "mClock" fails miserably...)
21     p.description="Count the number of steps you take using the N900's accelerometer. The widget shows the number of steps, the distance travelled, the number of lost calories and charts with the history of those values."
22     p.author="Andrei Mirestean"
23     p.mail="andrei.mirestean@gmail.com"
24     p.url="https://garage.maemo.org/projects/pedometerwidget/"
25     p.depends = "python(>=2.5), python-gtk2, python-gobject, python-hildondesktop, python-hildon, python-cairo, hildon-desktop-python-loader, python-gconf, python-xml, python-gst0.10"
26     p.section="user/desktop"
27     p.icon = "/home/andrei/pedometer-widget-0.1/icon.png"
28     p.arch="all"                #should be all for python, any for all arch
29     p.urgency="low"             #not used in maemo onl for deb os
30     p.distribution="fremantle"
31     p.repository="extras-devel"
32     p.xsbc_bugtracker="https://garage.maemo.org/tracker/?group_id=1272"
33     p.maemodisplayname = "Pedometer Home Widget"
34     p.postinstall="""#!/bin/sh
35     GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
36               gconftool-2 --makefile-install-rule /etc/gconf/schemas/pedometer.schemas""" #Set here your post install script
37     #  p.postremove="""#!/bin/sh
38     #  chmod +x /usr/bin/mclock.py""" #Set here your post remove script
39     #  p.preinstall="""#!/bin/sh
40     #  chmod +x /usr/bin/mclock.py""" #Set here your pre install script
41     #  p.preremove="""#!/bin/sh
42     #  chmod +x /usr/bin/mclock.py""" #Set here your pre remove script
43     version = "0.3"           #Version of your software, e.g. "1.2.0" or "0.8.2"
44     build = "4"                 #Build number, e.g. "1" for the first build of this version of your software. Increment for later re-builds of the same version of your software.
45     #Text with changelog information to be displayed in the package "Details" tab of the Maemo Application Manager
46     #changeloginformation ="New features: \n*fixed Imperial units bug\n*option to set sensitivity\n*options to set step length\n*calculate number of lost calories\n*show graphs of steps/distance/calories\n*save history in XML file\n*set alarm for steps/calories/distance\n*option to pause timer when not walking"
47     changeloginformation = open("debian/changelog").read()
48     dir_name = "src"            #Name of the subfolder containing your package source files (e.g. usr\share\icons\hicolor\scalable\myappicon.svg, usr\lib\myapp\somelib.py). We suggest to leave it named src in all projects and will refer to that in the wiki article on maemo.org
49     for root, dirs, files in os.walk(dir_name):
50         real_dir = root[len(dir_name):]
51         fake_file = []
52         for f in files:
53             fake_file.append(root + os.sep + f + "|" + f)
54         if len(fake_file) > 0:
55             p[real_dir] = fake_file
56     print p
57     r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)