From b18acd8bc403dc8781e3a25bb534e14ba0c38fda Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 14 Feb 2017 22:47:03 -0500 Subject: oci: introduce oci-image-tools (and dependencies) The oci image tools allow the easy manipulation of containers and bundles. Signed-off-by: Bruce Ashfield --- recipes-containers/go-digest/go-digest_git.bb | 41 +++++++++++++++ recipes-containers/go-errors/go-errors_git.bb | 41 +++++++++++++++ .../go-spf13-cobra/spf13-cobra_git.bb | 41 +++++++++++++++ .../go-spf13-pflag/spf13-pflag_git.bb | 41 +++++++++++++++ .../oci-image-spec/oci-image-spec_git.bb | 41 +++++++++++++++ .../oci-image-tools/oci-image-tools_git.bb | 60 ++++++++++++++++++++++ .../oci-runtime-spec/oci-runtime-spec_git.bb | 41 +++++++++++++++ 7 files changed, 306 insertions(+) create mode 100644 recipes-containers/go-digest/go-digest_git.bb create mode 100644 recipes-containers/go-errors/go-errors_git.bb create mode 100644 recipes-containers/go-spf13-cobra/spf13-cobra_git.bb create mode 100644 recipes-containers/go-spf13-pflag/spf13-pflag_git.bb create mode 100644 recipes-containers/oci-image-spec/oci-image-spec_git.bb create mode 100644 recipes-containers/oci-image-tools/oci-image-tools_git.bb create mode 100644 recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb (limited to 'recipes-containers') diff --git a/recipes-containers/go-digest/go-digest_git.bb b/recipes-containers/go-digest/go-digest_git.bb new file mode 100644 index 00000000..a2f8cd69 --- /dev/null +++ b/recipes-containers/go-digest/go-digest_git.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "Common digest package used across the container ecosystem." +HOMEPAGE = "https://github.com/opencontainers/go-digest.git" +SECTION = "devel/go" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE.code;md5=9cd86830b557232ce55e2a6b47387471" + +SRCNAME = "go-digest" + +PKG_NAME = "github.com/opencontainers/${SRCNAME}" +SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}" + +SRCREV = "b6234c321f263c503268e3b205f3d9755f9d14ed" +PV = "v1.0.0-rc0+git${SRCPV}" + +S = "${WORKDIR}/git" + +# NO-OP the do compile rule because this recipe is source only. +do_compile() { +} + +do_install() { + install -d ${D}${prefix}/local/go/src/${PKG_NAME} + for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do + if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then + mkdir -p ${D}${prefix}/local/go/$(dirname $j) + fi + cp $j ${D}${prefix}/local/go/$j + done + cp -r ${S}/src/${PKG_NAME}/LICENSE.code ${D}${prefix}/local/go/src/${PKG_NAME}/ +} + +SYSROOT_PREPROCESS_FUNCS += "go_digest_file_sysroot_preprocess" + +go_digest_file_sysroot_preprocess () { + install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME} + cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME}) +} + +FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*" + +CLEANBROKEN = "1" \ No newline at end of file diff --git a/recipes-containers/go-errors/go-errors_git.bb b/recipes-containers/go-errors/go-errors_git.bb new file mode 100644 index 00000000..3bb74a7c --- /dev/null +++ b/recipes-containers/go-errors/go-errors_git.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "Simple error handling primitives" +HOMEPAGE = "https://github.com/pkg/errors" +SECTION = "devel/go" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=6fe682a02df52c6653f33bd0f7126b5a" + +SRCNAME = "errors" + +PKG_NAME = "github.com/pkg/${SRCNAME}" +SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}" + +SRCREV = "248dadf4e9068a0b3e79f02ed0a610d935de5302" +PV = "v0.8.0+git${SRCPV}" + +S = "${WORKDIR}/git" + +# NO-OP the do compile rule because this recipe is source only. +do_compile() { +} + +do_install() { + install -d ${D}${prefix}/local/go/src/${PKG_NAME} + for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do + if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then + mkdir -p ${D}${prefix}/local/go/$(dirname $j) + fi + cp $j ${D}${prefix}/local/go/$j + done + cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/ +} + +SYSROOT_PREPROCESS_FUNCS += "go_errors_file_sysroot_preprocess" + +go_errors_file_sysroot_preprocess () { + install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME} + cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME}) +} + +FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*" + +CLEANBROKEN = "1" \ No newline at end of file diff --git a/recipes-containers/go-spf13-cobra/spf13-cobra_git.bb b/recipes-containers/go-spf13-cobra/spf13-cobra_git.bb new file mode 100644 index 00000000..e942e4e3 --- /dev/null +++ b/recipes-containers/go-spf13-cobra/spf13-cobra_git.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "A Commander for modern Go CLI interactions" +HOMEPAGE = "https://github.com/spf13/cobra" +SECTION = "devel/go" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE.txt;md5=920d76114a32b0fb75b3f2718c5a91be" + +SRCNAME = "cobra" + +PKG_NAME = "github.com/spf13/${SRCNAME}" +SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}" + +SRCREV = "b5d8e8f46a2f829f755b6e33b454e25c61c935e1" +PV = "v0.0.1+git${SRCPV}" + +S = "${WORKDIR}/git" + +# NO-OP the do compile rule because this recipe is source only. +do_compile() { +} + +do_install() { + install -d ${D}${prefix}/local/go/src/${PKG_NAME} + for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do + if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then + mkdir -p ${D}${prefix}/local/go/$(dirname $j) + fi + cp $j ${D}${prefix}/local/go/$j + done + cp -r ${S}/src/${PKG_NAME}/LICENSE.txt ${D}${prefix}/local/go/src/${PKG_NAME}/ +} + +SYSROOT_PREPROCESS_FUNCS += "cobra_file_sysroot_preprocess" + +cobra_file_sysroot_preprocess () { + install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME} + cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME}) +} + +FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*" + +CLEANBROKEN = "1" \ No newline at end of file diff --git a/recipes-containers/go-spf13-pflag/spf13-pflag_git.bb b/recipes-containers/go-spf13-pflag/spf13-pflag_git.bb new file mode 100644 index 00000000..2fbcb439 --- /dev/null +++ b/recipes-containers/go-spf13-pflag/spf13-pflag_git.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags." +HOMEPAGE = "https://github.com/spf13/pflag" +SECTION = "devel/go" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=1e8b7dc8b906737639131047a590f21d" + +SRCNAME = "pflag" + +PKG_NAME = "github.com/spf13/${SRCNAME}" +SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}" + +SRCREV = "9ff6c6923cfffbcd502984b8e0c80539a94968b7" +PV = "v1.0.0-rc4+git${SRCPV}" + +S = "${WORKDIR}/git" + +# NO-OP the do compile rule because this recipe is source only. +do_compile() { +} + +do_install() { + install -d ${D}${prefix}/local/go/src/${PKG_NAME} + for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do + if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then + mkdir -p ${D}${prefix}/local/go/$(dirname $j) + fi + cp $j ${D}${prefix}/local/go/$j + done + cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/ +} + +SYSROOT_PREPROCESS_FUNCS += "pflag_file_sysroot_preprocess" + +pflag_file_sysroot_preprocess () { + install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME} + cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME}) +} + +FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*" + +CLEANBROKEN = "1" \ No newline at end of file diff --git a/recipes-containers/oci-image-spec/oci-image-spec_git.bb b/recipes-containers/oci-image-spec/oci-image-spec_git.bb new file mode 100644 index 00000000..92a83998 --- /dev/null +++ b/recipes-containers/oci-image-spec/oci-image-spec_git.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "The OCI Image Format project creates and maintains the software shipping container image format spec" +HOMEPAGE = "https://github.com/opencontainers/image-spec" +SECTION = "devel/go" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=27ef03aa2da6e424307f102e8b42621d" + +SRCNAME = "image-spec" + +PKG_NAME = "github.com/opencontainers/${SRCNAME}" +SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}" + +SRCREV = "91d3eaabebcdc329edd9b4ff0f28f8f90022201f" +PV = "v1.0.0-rc4+git${SRCPV}" + +S = "${WORKDIR}/git" + +# NO-OP the do compile rule because this recipe is source only. +do_compile() { +} + +do_install() { + install -d ${D}${prefix}/local/go/src/${PKG_NAME} + for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do + if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then + mkdir -p ${D}${prefix}/local/go/$(dirname $j) + fi + cp $j ${D}${prefix}/local/go/$j + done + cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/ +} + +SYSROOT_PREPROCESS_FUNCS += "image_spec_file_sysroot_preprocess" + +image_spec_file_sysroot_preprocess () { + install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME} + cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME}) +} + +FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*" + +CLEANBROKEN = "1" \ No newline at end of file diff --git a/recipes-containers/oci-image-tools/oci-image-tools_git.bb b/recipes-containers/oci-image-tools/oci-image-tools_git.bb new file mode 100644 index 00000000..48cae767 --- /dev/null +++ b/recipes-containers/oci-image-tools/oci-image-tools_git.bb @@ -0,0 +1,60 @@ +HOMEPAGE = "https://github.com/opencontainers/image-tools" +SUMMARY = "A collection of tools for working with the OCI image format specification" +LICENSE = "Apache-2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +DEPENDS = "go-cross \ + oci-image-spec \ + oci-runtime-spec \ + go-digest \ + go-errors \ + spf13-cobra \ + spf13-pflag \ + " + +SRC_URI = "git://github.com/opencontainers/image-tools.git" +SRCREV = "a358e03fde4e3628bf9fb7656bf643b63f975636" +PV = "0.1.0+git${SRCPV}" + +S = "${WORKDIR}/git" + +inherit go-osarchmap + +# This disables seccomp and apparmor, which are on by default in the +# go package. +EXTRA_OEMAKE="BUILDTAGS=''" + +do_compile() { + export GOARCH="${TARGET_GOARCH}" + + # Setup vendor directory so that it can be used in GOPATH. + # + # Go looks in a src directory under any directory in GOPATH but riddler + # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink. + # + # We also need to link in the ipallocator directory as that is not under + # a src directory. + ln -sfn . "${S}/vendor/src" + mkdir -p "${S}/vendor/src/github.com/opencontainers/image-tools/" + ln -sfn "${S}/image" "${S}/vendor/src/github.com/opencontainers/image-tools/image" + export GOPATH="${S}/vendor" + + # Pass the needed cflags/ldflags so that cgo + # can find the needed headers files and libraries + export CGO_ENABLED="1" + export CFLAGS="" + export LDFLAGS="" + export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" + export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" + + oe_runmake tools +} + +do_install() { + install -d ${D}/${sbindir} + install ${S}/oci-create-runtime-bundle ${D}/${sbindir}/ + install ${S}/oci-image-validate ${D}/${sbindir}/ + install ${S}/oci-unpack ${D}/${sbindir}/ +} + +INSANE_SKIP_${PN} += "ldflags" diff --git a/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb new file mode 100644 index 00000000..82f852f9 --- /dev/null +++ b/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "The Open Container Initiative develops specifications for standards on Operating System process and application containers" +HOMEPAGE = "https://github.com/opencontainers/runtime-spec" +SECTION = "devel/go" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c958f662c" + +SRCNAME = "runtime-spec" + +PKG_NAME = "github.com/opencontainers/${SRCNAME}" +SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}" + +SRCREV = "4af0c72f92aacf1b43618d7986197d8209fadf0b" +PV = "v1.0.0-rc4+git${SRCPV}" + +S = "${WORKDIR}/git" + +# NO-OP the do compile rule because this recipe is source only. +do_compile() { +} + +do_install() { + install -d ${D}${prefix}/local/go/src/${PKG_NAME} + for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do + if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then + mkdir -p ${D}${prefix}/local/go/$(dirname $j) + fi + cp $j ${D}${prefix}/local/go/$j + done + cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/ +} + +SYSROOT_PREPROCESS_FUNCS += "runtime_spec_file_sysroot_preprocess" + +runtime_spec_file_sysroot_preprocess () { + install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME} + cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME}) +} + +FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*" + +CLEANBROKEN = "1" \ No newline at end of file -- cgit v1.2.3-54-g00ecf