Fremantle versions pushed to Extras
[easy-deb-chroot] / fremantle / easy-deb-chroot / build_easydebchroot.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
13 import py2deb
14 import os
15
16 if __name__ == "__main__":
17      try:
18          os.chdir(os.path.dirname(sys.argv[0]))
19      except:
20          pass
21      print
22      p=py2deb.Py2deb("easy-deb-chroot")   #This is the package name and MUST be in lowercase! 
23      qoledescript = open("control/description", "r")
24      p.description=qoledescript.read()
25      p.xsbc_bugtracker="http://talk.maemo.org/showthread.php?t=34550"
26      p.maemodispname="Easy Debian" 
27      version = "0.9.46"   #Version of your software, e.g. "1.2.0" or "0.8.2"
28      build = "1fremantle1"         #Build number
29      qolechangelog = open("control/changelog", "r")
30      changeloginformation = qolechangelog.read()
31      p.author="Alan Bruce (qole)"
32      p.mail="qole@qole.org"
33      p.depends = "easy-chroot (>=0.2.7), lzma, wget"
34      p.section="user/system"
35      p.icon = "deblet-48.png"
36      p.arch="armel"              #should be all for python, any for all arch
37      p.urgency="low"             #not used in maemo onl for deb os
38      p.distribution="fremantle"
39      p.repository="extras-devel"
40      qolepostinst = open("control/postinst", "r")
41      p.postinstall=qolepostinst.read()
42      qolepostrm = open("control/postrm", "r")
43      p.postremove=qolepostrm.read()
44      qolepreinst = open("control/preinst", "r")
45      p.preinstall=qolepreinst.read()
46      # p.postinstall="postinst"
47      # p.postremove="postrm"
48      # p.preinstall="preinst"
49      qoleprerm = open("control/prerm", "r")
50      p.preremove=qoleprerm.read()
51      # p.preremove=""
52      dir_name = "src"    #Name of the subfolder containing your package source files
53
54      #Thanks to DareTheHair from talk.maemo.org for this snippet that recursively builds the file list 
55      for root, dirs, files in os.walk(dir_name):
56          real_dir = root[len(dir_name):]
57          fake_file = []
58          for f in files:
59              fake_file.append(root + os.sep + f + "|" + f)
60          if len(fake_file) > 0:
61              p[real_dir] = fake_file
62
63      print p
64      r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)
65