actions.py 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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("PYTHON", "/usr/bin/python3")
  14. shelltools.system("export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none")
  15. shelltools.export("MOZBUILD_STATE_PATH", "mozbuild")
  16. 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()
  17. xpidir = "%s/xpi" % get.workDIR()
  18. arch = get.ARCH()
  19. ver = ".".join(get.srcVERSION().split(".")[:3])
  20. def setup():
  21. pisitools.dosed(".mozconfig", "##JOBCOUNT##", get.makeJOBS())
  22. # LOCALE
  23. shelltools.system("rm -rf langpack-tb/*/browser/defaults")
  24. if not shelltools.isDirectory(xpidir): shelltools.makedirs(xpidir)
  25. for locale in locales:
  26. shelltools.system("wget -c -P %s http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/%sesr/linux-%s/xpi/%s.xpi" % (xpidir, ver, arch, locale))
  27. shelltools.makedirs("langpack-tb")
  28. shelltools.system("cp %s/%s.xpi langpack-tb/langpack-%s@thunderbird.mozilla.org.xpi" % (xpidir, locale, locale))
  29. #shelltools.makedirs("langpack-tb/langpack-%s@thunderbird.mozilla.org" % locale)
  30. #shelltools.system("unzip -uo %s/%s.xpi -d langpack-tb/langpack-%s@thunderbird.mozilla.org" % (xpidir, locale, locale))
  31. shelltools.system("./mach configure")
  32. def build():
  33. shelltools.system("./mach build")
  34. shelltools.system("./mach buildsymbols")
  35. def install():
  36. shelltools.system("DESTDIR=%s ./mach install " % get.installDIR())
  37. # Install fix language packs
  38. pisitools.insinto("/usr/lib/thunderbird/extensions", "./langpack-tb/*")
  39. pisitools.insinto("/usr/share/metainfo", "comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml")
  40. # Install icons
  41. pisitools.insinto("/usr/share/pixmaps", "comm/mail/branding/thunderbird/default256.png", "thunderbird.png")
  42. pisitools.insinto("%s/icons" % MOZAPPDIR, "comm/mail/branding/thunderbird/default16.png")
  43. for s in (16, 22, 24, 32, 48, 64, 128, 256):
  44. pisitools.insinto("/usr/share/icons/hicolor/%dx%d/apps" % (s,s), "comm/mail/branding/thunderbird/default%d.png" % s, "thunderbird.png")
  45. # We don't want the development stuff
  46. #pisitools.removeDir("/usr/lib/thunderbird-devel*")
  47. #pisitools.removeDir("/usr/share/idl")
  48. #pisitools.removeDir("/usr/include")
  49. # Install docs
  50. pisitools.dodoc("README*", "LICENSE")