actions.py 1.8 KB

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