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