actions.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # -*- coding: utf-8 -*-
  2. #
  3. # Licensed under the GNU General Public License, version 3.
  4. # See the file http://www.gnu.org/licenses/gpl.txt
  5. from pisi.actionsapi import autotools
  6. from pisi.actionsapi import pisitools
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import get
  9. WorkDir = "."
  10. NoStrip = ["/"]
  11. def setup():
  12. for package in shelltools.ls("*-*"):
  13. shelltools.cd(package)
  14. autotools.configure("--with-fontrootdir=/usr/share/fonts")
  15. shelltools.cd("../")
  16. def build():
  17. for package in shelltools.ls("*-*"):
  18. shelltools.cd(package)
  19. autotools.make()
  20. shelltools.cd("../")
  21. def install():
  22. for package in shelltools.ls("*-*"):
  23. shelltools.cd(package)
  24. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  25. shelltools.cd("../")
  26. # Trailing slash is important since it is used with dosed.
  27. encodingsDir = "/usr/share/fonts/encodings/"
  28. # Create encodings.dir scanning installed files only
  29. encdir = get.installDIR() + encodingsDir
  30. shelltools.system("/usr/bin/mkfontdir -n -e %s -e %slarge ." % (encdir, encdir))
  31. pisitools.dosed("encodings.dir", encdir, "")
  32. pisitools.insinto(encodingsDir, "encodings.dir")
  33. fontpaths = {
  34. "misc" : "misc:unscaled:pri=10",
  35. "75dpi" : "75dpi:unscaled",
  36. "100dpi" : "100dpi:unscaled",
  37. "cyrillic" : "cyrillic",
  38. }
  39. for fontdir, sym in fontpaths.items():
  40. fontpath = "/usr/share/fonts/%s" % fontdir
  41. pisitools.dosym(fontpath, "/etc/X11/fontpath.d/%s" % sym)
  42. # These will be generated by the package handler in xorg-app package
  43. pisitools.remove("/usr/share/fonts/*/fonts.dir")