build_myapp.py 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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("qonso") #This is the package name and MUST be in lowercase! (using e.g. "mClock" fails miserably...)
  21. p.maemodisplayname="Qonso" # Maemo-Display-Name
  22. p.description = dict()
  23. p.description['default']="Mobile phone plan information"
  24. p.description['fr_FR']="Suivi conso pour forfaits mobiles"
  25. p.upgradedescription='Use MicroB user agent, useful for SFR'
  26. version = "0.5.1" #Version of your software, e.g. "1.2.0" or "0.8.2"
  27. build = "1" #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.
  28. p.author="Gérald Fauvelle"
  29. p.mail="maemo@fauvelle.net"
  30. p.depends = "python2.5, python2.5-qt4-gui,python2.5-qt4-core, python2.5-qt4-network,python2.5-qt4-webkit"
  31. p.section="user/network"
  32. p.icon = "src/usr/share/icons/hicolor/40x40/apps/qonso.png"
  33. p.arch="all" #should be all for python, any for all arch
  34. p.urgency="low" #not used in maemo onl for deb os
  35. p.distribution="fremantle"
  36. p.repository="extras-devel"
  37. p.xsbc_bugtracker="https://projects.forum.nokia.com/Qonso/query?status=!closed&order=priority"
  38. #Set here your post install script
  39. p.postinstall="""#!/bin/sh
  40. chmod +x /opt/qonso/*.py
  41. """
  42. #Set here your post remove script
  43. # p.postremove="""#!/bin/sh
  44. # """
  45. # p.preinstall="""#!/bin/sh
  46. # chmod +x /usr/bin/mclock.py""" #Set here your pre install script
  47. # p.preremove="""#!/bin/sh
  48. # chmod +x /usr/bin/mclock.py""" #Set here your pre remove script
  49. #Text with changelog information to be displayed in the package "Details" tab of the Maemo Application Manager
  50. changeloginformation = p.upgradedescription
  51. 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
  52. #Thanks to DareTheHair from talk.maemo.org for this snippet that recursively builds the file list
  53. for root, dirs, files in os.walk(dir_name):
  54. real_dir = root[len(dir_name):]
  55. fake_file = []
  56. for f in files:
  57. if f.endswith(".pyc") or f.endswith(".pyo"):
  58. continue
  59. fake_file.append(root + os.sep + f + "|" + f)
  60. if len(fake_file) > 0:
  61. p[real_dir] = fake_file
  62. print p
  63. r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)