actions.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. pisitools.cflags.add("-D_LARGEFILE64_SOURCE", "-D_FILE_OFFSET_BITS=64")
  11. def setup():
  12. # fix linkage
  13. pisitools.dosed("pam_cap/Makefile", "(.*<\s\$\(LDLIBS\))", r"\1 -lpam")
  14. # no static libs
  15. pisitools.dosed("libcap/Makefile", "install.*STALIBNAME", deleteLine=True)
  16. # change shared libs mode
  17. pisitools.dosed("libcap/Makefile", "(.*?install -m) 0644 (.*?MINLIBNAME.*)", r"\1 0755 \2")
  18. # use pisilinux flags
  19. pisitools.dosed("Make.Rules", "^(CC|CFLAGS|LD)\s:=.*", deleteLine=True)
  20. pisitools.dosed("Make.Rules", "^(PAM_CAP\s:=).*", r"\1 %s" % ("no" if get.buildTYPE() == "emul32" else "yes"))
  21. def build():
  22. autotools.make("lib_prefix=/usr lib=lib%s" % ("32" if get.buildTYPE() == "emul32" else ""))
  23. def install():
  24. if get.buildTYPE() == "emul32":
  25. autotools.rawInstall("prefix=/emul32 lib=../usr/lib32 DESTDIR=%s RAISE_SETFCAP=no" % get.installDIR())
  26. return
  27. autotools.rawInstall("prefix=/usr DESTDIR=%s SBINDIR=/sbin RAISE_SETFCAP=no" % (get.installDIR()))
  28. pisitools.insinto("/etc/security", "pam_cap/capability.conf")
  29. pisitools.dodoc("CHANGELOG", "License", "README", "doc/capability.notes")