actions.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Copyright 2016 TUBITAK/UEKAE
  5. # Licensed under the GNU General Public License, version 2.
  6. # See the file http://www.gnu.org/copyleft/gpl.txt.
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import shelltools
  10. from pisi.actionsapi import get
  11. def build():
  12. shelltools.export("GOPATH", "%s" % get.workDIR())
  13. shelltools.cd("%s" % get.workDIR())
  14. shelltools.move("containerd-*", "containerd")
  15. shelltools.cd("containerd")
  16. shelltools.move("vendor", "src")
  17. # shelltools.makedirs("src/github.com/containerd")
  18. # shelltools.system("ln -rsf %s/containerd* src/github.com/containerd" % get.workDIR())
  19. # shelltools.cd("src/github.com/containerd/containerd")
  20. #shelltools.system("LDFLAGS= GOPATH=%s make GIT_COMMIT=72cec4b" % get.curDIR())
  21. # shelltools.system("LDFLAGS= make GIT_COMMIT=1677a17 EXTRA_LDFLAGS='-buildid='")
  22. shelltools.system("LDFLAGS= make GO_BUILD_FLAGS='' GO_GCFLAGS='' EXTRA_LDFLAGS='-buildid='")
  23. def install():
  24. shelltools.cd("%s/containerd" % get.workDIR())
  25. #pisitools.dobin("bin/*")
  26. autotools.rawInstall("PREFIX=/usr DESTDIR=%s" % get.installDIR())
  27. # symlink containerd/run (nice integration with docker)
  28. pisitools.dosym("/usr/bin/containerd", "/usr/bin/docker-containerd")
  29. pisitools.dosym("/usr/bin/containerd-shim", "/usr/bin/docker-containerd-shim")
  30. pisitools.dosym("/usr/bin/ctr", "/usr/bin/docker-containerd-ctr")
  31. pisitools.dodoc("LICENSE", "README*")