actions.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from pisi.actionsapi import get
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import shelltools
  10. ObjDir = "build"
  11. MOZAPPDIR= "/usr/lib/thunderbird"
  12. shelltools.export("SHELL", "/bin/sh")
  13. shelltools.export("MACH_USE_SYSTEM_PYTHON", "1")
  14. shelltools.export("MOZBUILD_STATE_PATH", "mozbuild")
  15. locales = "be ca da de el en-GB en-US es-AR es-ES fi fr hr hu it lt nl pl pt-BR pt-PT ro ru sr sv-SE tr uk".split()
  16. xpidir = "%s/xpi" % get.workDIR()
  17. arch = get.ARCH()
  18. ver = ".".join(get.srcVERSION().split(".")[:3])
  19. def setup():
  20. pisitools.dosed(".mozconfig", "##JOBCOUNT##", get.makeJOBS())
  21. # LOCALE
  22. shelltools.system("rm -rf langpack-tb/*/browser/defaults")
  23. if not shelltools.isDirectory(xpidir): shelltools.makedirs(xpidir)
  24. for locale in locales:
  25. shelltools.system("wget -c -P %s http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%s/linux-%s/xpi/%s.xpi" % (xpidir, ver, arch, locale))
  26. shelltools.makedirs("langpack-tb")
  27. shelltools.system("cp %s/%s.xpi langpack-tb/langpack-%s@thunderbird.mozilla.org.xpi" % (xpidir, locale, locale))
  28. #shelltools.makedirs("langpack-tb/langpack-%s@thunderbird.mozilla.org" % locale)
  29. #shelltools.system("unzip -uo %s/%s.xpi -d langpack-tb/langpack-%s@thunderbird.mozilla.org" % (xpidir, locale, locale))
  30. shelltools.makedirs(ObjDir)
  31. shelltools.cd(ObjDir)
  32. shelltools.system("../mach configure")
  33. def build():
  34. shelltools.cd(ObjDir)
  35. shelltools.system("../mach build")
  36. shelltools.system("../mach buildsymbols")
  37. def install():
  38. shelltools.cd(ObjDir)
  39. shelltools.system("DESTDIR=%s ../mach install " % get.installDIR())
  40. shelltools.cd("..")
  41. # Install fix language packs
  42. pisitools.insinto("/usr/lib/thunderbird/extensions", "langpack-tb/*")
  43. pisitools.insinto("/usr/share/metainfo", "comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml")
  44. # Install icons
  45. pisitools.insinto("/usr/share/pixmaps", "comm/mail/branding/thunderbird/default256.png", "thunderbird.png")
  46. pisitools.insinto("%s/icons" % MOZAPPDIR, "comm/mail/branding/thunderbird/default16.png")
  47. for s in (16, 22, 24, 32, 48, 64, 128, 256):
  48. pisitools.insinto("/usr/share/icons/hicolor/%dx%d/apps" % (s,s), "comm/mail/branding/thunderbird/default%d.png" % s, "thunderbird.png")
  49. # We don't want the development stuff
  50. #pisitools.removeDir("/usr/lib/thunderbird-devel*")
  51. #pisitools.removeDir("/usr/share/idl")
  52. #pisitools.removeDir("/usr/include")
  53. # Install docs
  54. pisitools.dodoc("README*", "LICENSE")