actions.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. MOZAPPDIR= "/usr/lib/thunderbird"
  11. shelltools.export("SHELL", "/bin/sh")
  12. locales = "be ca da de el 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()
  13. xpidir = "%s/xpi" % get.workDIR()
  14. arch = get.ARCH()
  15. ver = ".".join(get.srcVERSION().split(".")[:3])
  16. def setup():
  17. pisitools.dosed(".mozconfig", "##JOBCOUNT##", get.makeJOBS())
  18. # LOCALE
  19. shelltools.system("rm -rf langpack-tb/*/browser/defaults")
  20. if not shelltools.isDirectory(xpidir): shelltools.makedirs(xpidir)
  21. for locale in locales:
  22. 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))
  23. shelltools.makedirs("langpack-tb/langpack-%s@thunderbird.mozilla.org" % locale)
  24. shelltools.system("unzip -uo %s/%s.xpi -d langpack-tb/langpack-%s@thunderbird.mozilla.org" % (xpidir, locale, locale))
  25. def build():
  26. #shelltools.system("sed -i '/^ftglyph.h/ i ftfntfmt.h' mozilla/config/system-headers")
  27. autotools.make("-f ./client.mk")
  28. def install():
  29. autotools.rawInstall("-f client.mk DESTDIR=%s" % get.installDIR())
  30. # Install fix language packs
  31. pisitools.insinto("/usr/lib/thunderbird/extensions", "./langpack-tb/*")
  32. # Install icons
  33. pisitools.insinto("/usr/share/pixmaps", "other-licenses/branding/thunderbird/mailicon256.png", "thunderbird.png")
  34. pisitools.insinto("%s/icons" % MOZAPPDIR, "other-licenses/branding/thunderbird/mailicon16.png")
  35. for s in (16, 22, 24, 32, 48, 256):
  36. pisitools.insinto("/usr/share/icons/hicolor/%dx%d/apps" % (s,s), "other-licenses/branding/thunderbird/mailicon%d.png" % s, "thunderbird.png")
  37. # We don't want the development stuff
  38. pisitools.removeDir("/usr/lib/thunderbird-devel*")
  39. pisitools.removeDir("/usr/share/idl")
  40. pisitools.removeDir("/usr/include")
  41. # Install docs
  42. pisitools.dodoc("mozilla/LEGAL", "mozilla/LICENSE")