You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.7 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=oci-runtime-tools
  3. PKG_VERSION:=1.0.0-pre20210122
  4. PKG_RELEASE:=2
  5. PKG_LICENSE:=Apache-2.0
  6. PKG_LICENSE_FILES:=LICENSE
  7. PKG_SOURCE_PROTO:=git
  8. PKG_SOURCE_NAME:=runtime-tools
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://github.com/opencontainers/runtime-tools.git
  11. PKG_SOURCE_VERSION:=453547deb724af135587e654f52d86b8619f21b9
  12. PKG_MIRROR_HASH:=34f3aefc4f6f3bb93330ec7cbeb2eb987b82184da53d453e8b04b5750faa8728
  13. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  14. PKG_BUILD_DEPENDS:=golang/host
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_USE_MIPS16:=0
  17. GO_PKG:=github.com/opencontainers/runtime-tools/
  18. GO_PKG_LDFLAGS_X:=main.gitCommit=$(PKG_SOURCE_VERSION) main.version=$(PKG_SOURCE_VERSION)
  19. include $(INCLUDE_DIR)/package.mk
  20. include ../../lang/golang/golang-package.mk
  21. define Package/oci-runtime-tool
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=oci-runtime-tool
  25. URL:=https://github.com/opencontainers/runtime-tools
  26. DEPENDS:=$(GO_ARCH_DEPENDS)
  27. endef
  28. define Package/oci-runtime-tool/description
  29. OCI (Open Container Initiative) runtime tools
  30. Generate OCI runtime spec configuration files and validate OCI bundles.
  31. endef
  32. define Package/oci-runtime-tests
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. TITLE:=OCI runtimetest tool
  36. URL:=https://github.com/opencontainers/runtime-tools
  37. DEPENDS:=@(i386||i686||x86_64) oci-runtime-tool +tar
  38. endef
  39. define Package/oci-runtime-tests/description
  40. OCI (Open Container Initiative) runtime tools
  41. This package provides test cases as well as artifacts required to
  42. validate an OCI runtime.
  43. Best used in combination with a TAP consumer like 'node-tap',
  44. installable via npm.
  45. endef
  46. GO_PKG_BUILD_VARS += GO111MODULE=auto
  47. define Build/Compile
  48. $(call GoPackage/Build/Compile)
  49. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  50. endef
  51. define Package/oci-runtime-tool/install
  52. $(INSTALL_DIR) $(1)/usr/bin
  53. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/oci-runtime-tool $(1)/usr/bin
  54. endef
  55. define Package/oci-runtime-tests/install
  56. $(INSTALL_DIR) $(1)/usr/libexec/oci-runtime-test
  57. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/runtimetest $(1)/usr/libexec/oci-runtime-test/
  58. ( cd $(PKG_BUILD_DIR) ; $(FIND) ./validation/ -name *.go | grep -v util | \
  59. xargs -I'%' -n 1 basename % .go | while read testbin; do \
  60. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${testbin} \
  61. $(1)/usr/libexec/oci-runtime-test/$$$${testbin}.t ; \
  62. done )
  63. ifdef CONFIG_x86_64
  64. $(INSTALL_DATA) $(PKG_BUILD_DIR)/rootfs-amd64.tar.gz $(1)/usr/libexec/oci-runtime-test
  65. endif
  66. $(INSTALL_DATA) $(PKG_BUILD_DIR)/rootfs-386.tar.gz $(1)/usr/libexec/oci-runtime-test
  67. endef
  68. $(eval $(call GoBinPackage,oci-runtime-tools))
  69. $(eval $(call BuildPackage,oci-runtime-tool))
  70. $(eval $(call BuildPackage,oci-runtime-tests))