actions.py 1.4 KB

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