1 include $(TOPDIR
)/rules.mk
3 PKG_NAME
:=oci-runtime-tools
4 PKG_VERSION
:=1.0.0-pre20210326
6 PKG_LICENSE
:=Apache-2.0
7 PKG_LICENSE_FILES
:=LICENSE
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
:=59cdde06764be8d761db120664020f0415f36045
14 PKG_MIRROR_HASH
:=ef331e3ad5f99220583399fe1c2ded243f4b01f8dabc7acd152d46304da70f6f
16 PKG_MAINTAINER
:=Daniel Golle
<daniel@makrotopia.org
>
18 PKG_BUILD_DEPENDS
:=golang
/host
20 PKG_BUILD_FLAGS
:=no-mips16
22 GO_PKG
:=github.com
/opencontainers
/runtime-tools
/
23 GO_PKG_LDFLAGS_X
:=main.gitCommit
=$(PKG_SOURCE_VERSION
) main.version
=$(PKG_SOURCE_VERSION
)
25 BUSYBOX_STATIC_VERSION
:=1.31.0
27 include $(INCLUDE_DIR
)/package.mk
28 include ..
/..
/lang
/golang
/golang-package.mk
30 define Download
/busybox-static-armv8l
31 URL
:=https
://busybox.net
/downloads
/binaries
/$$(BUSYBOX_STATIC_VERSION
)-defconfig-multiarch-musl
/
32 URL_FILE
:=busybox-armv8l
33 FILE
:=busybox-
$(BUSYBOX_STATIC_VERSION
)-static-armv8l
34 HASH
:=141adb1b625a6f44c4b114f76b4387b4ea4f7ab802b88eb40e0d2f6adcccb1c3
37 define Package
/oci-runtime-tool
40 TITLE
:=oci-runtime-tool
41 URL
:=https
://github.com
/opencontainers
/runtime-tools
42 DEPENDS
:=$(GO_ARCH_DEPENDS
)
45 define Package
/oci-runtime-tool
/description
46 OCI
(Open Container Initiative
) runtime tools
47 Generate OCI runtime spec configuration files and validate OCI bundles.
50 define Package
/oci-runtime-tests
53 TITLE
:=OCI runtimetest tool
54 URL
:=https
://github.com
/opencontainers
/runtime-tools
55 DEPENDS
:=@
(aarch64||i386||i686||x86_64
) oci-runtime-tool
+tar
58 define Package
/oci-runtime-tests
/description
59 OCI
(Open Container Initiative
) runtime tools
60 This package provides
test cases
as well
as artifacts required to
61 validate an OCI runtime.
62 Best used in combination with a TAP consumer like
'node-tap',
66 GO_PKG_BUILD_VARS
+= GO111MODULE
=auto
69 $(call Build
/Prepare
/Default
)
71 $(eval
$(call Download
,busybox-static-armv8l
))
73 mkdir
-p
$(PKG_BUILD_DIR
)/rootfs-armv8l
;\
74 cd
$(PKG_BUILD_DIR
)/rootfs-armv8l
;\
75 $(TAR
) xzf ..
/rootfs-amd64.
tar.gz
;\
76 $(CP
) $(DL_DIR
)/busybox-
$(BUSYBOX_STATIC_VERSION
)-static-armv8l bin
/busybox
;\
77 chmod
0755 bin
/busybox
;\
78 $(TAR
) czf ..
/rootfs-arm64.
tar.gz .
;\
84 $(call GoPackage
/Build
/Compile
)
85 $(call GoPackage
/Package
/Install
/Bin
,$(PKG_INSTALL_DIR
))
88 define Package
/oci-runtime-tool
/install
89 $(INSTALL_DIR
) $(1)/usr
/bin
90 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/oci-runtime-tool
$(1)/usr
/bin
93 define Package
/oci-runtime-tests
/install
94 $(INSTALL_DIR
) $(1)/usr
/libexec
/oci-runtime-test
95 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/runtimetest
$(1)/usr
/libexec
/oci-runtime-test
/
96 ( cd
$(PKG_BUILD_DIR
) ; $(FIND
) .
/validation
/ -name
*.go | grep
-v util | \
97 xargs
-I
'%' -n
1 basename % .go | while read testbin
; do \
98 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$$$${testbin} \
99 $(1)/usr
/libexec
/oci-runtime-test
/$$$${testbin}.t
; \
102 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rootfs-386.
tar.gz
$(1)/usr
/libexec
/oci-runtime-test
104 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rootfs-amd64.
tar.gz
$(1)/usr
/libexec
/oci-runtime-test
108 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/rootfs-arm64.
tar.gz
$(1)/usr
/libexec
/oci-runtime-test
112 $(eval
$(call GoBinPackage
,oci-runtime-tools
))
113 $(eval
$(call BuildPackage
,oci-runtime-tool
))
114 $(eval
$(call BuildPackage
,oci-runtime-tests
))