Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | HOMEPAGE = "git://github.com/kubernetes/kubernetes" |
| 2 | SUMMARY = "Production-Grade Container Scheduling and Management" |
| 3 | DESCRIPTION = "Kubernetes is an open source system for managing containerized \ |
| 4 | applications across multiple hosts, providing basic mechanisms for deployment, \ |
| 5 | maintenance, and scaling of applications. \ |
| 6 | " |
| 7 | |
| 8 | SRCREV_kubernetes = "4b839465f84e7faf876c51703aaf49b37fd10d9c" |
| 9 | SRC_URI = "git://github.com/kubernetes/kubernetes.git;nobranch=1;name=kubernetes \ |
| 10 | " |
| 11 | |
| 12 | DEPENDS += "rsync-native \ |
| 13 | coreutils-native \ |
| 14 | " |
| 15 | |
| 16 | PACKAGES =+ "kubeadm" |
| 17 | PACKAGES =+ "kubectl" |
| 18 | PACKAGES =+ "kubelet" |
| 19 | |
| 20 | ALLOW_EMPTY_${PN} = "1" |
| 21 | |
| 22 | # Note: we are explicitly *not* adding docker to the rdepends, since we allow |
| 23 | # backends like cri-o to be used. |
| 24 | RDEPENDS_${PN} += "kubeadm \ |
| 25 | kubectl \ |
| 26 | kubelet \ |
| 27 | cni" |
| 28 | |
| 29 | RDEPENDS_kubeadm = "kubelet kubectl" |
| 30 | RDEPENDS_kubelet = "iptables socat util-linux ethtool iproute2 ebtables" |
| 31 | |
| 32 | LICENSE = "Apache-2.0" |
| 33 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" |
| 34 | |
| 35 | GO_IMPORT = "import" |
| 36 | |
| 37 | PV = "1.9.0-alpha.1+git${SRCREV_kubernetes}" |
| 38 | |
| 39 | inherit systemd |
| 40 | inherit go |
| 41 | inherit goarch |
| 42 | |
| 43 | do_compile() { |
| 44 | export GOARCH="${TARGET_GOARCH}" |
| 45 | export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" |
| 46 | export GOPATH="${S}/src/import:${S}/src/import/vendor" |
| 47 | |
| 48 | # Pass the needed cflags/ldflags so that cgo |
| 49 | # can find the needed headers files and libraries |
| 50 | export CGO_ENABLED="1" |
| 51 | export CFLAGS="" |
| 52 | export LDFLAGS="" |
| 53 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 54 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 55 | |
| 56 | # link fixups for compilation |
| 57 | rm -f ${S}/src/import/vendor/src |
| 58 | ln -sf ./ ${S}/src/import/vendor/src |
| 59 | |
| 60 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" |
| 61 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" |
| 62 | |
| 63 | # Pass the needed cflags/ldflags so that cgo |
| 64 | # can find the needed headers files and libraries |
| 65 | export CGO_ENABLED="1" |
| 66 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 67 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 68 | |
| 69 | cd ${S}/src/import |
| 70 | # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet |
| 71 | make all |
| 72 | } |
| 73 | |
| 74 | do_install() { |
| 75 | install -d ${D}${bindir} |
| 76 | install -d ${D}${systemd_unitdir}/system/ |
| 77 | install -d ${D}${systemd_unitdir}/system/kubelet.service.d/ |
| 78 | |
| 79 | install -d ${D}${sysconfdir}/kubernetes/manifests/ |
| 80 | |
| 81 | install -m 755 -D ${S}/src/import/_output/bin/kube* ${D}/${bindir} |
| 82 | |
| 83 | install -m 0644 ${S}/src/import/build/debs/kubelet.service ${D}${systemd_unitdir}/system/ |
| 84 | install -m 0644 ${S}/src/import/build/debs/10-kubeadm.conf ${D}${systemd_unitdir}/system/kubelet.service.d/ |
| 85 | } |
| 86 | |
| 87 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet','',d)}" |
| 88 | SYSTEMD_SERVICE_kubelet = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet.service','',d)}" |
| 89 | SYSTEMD_AUTO_ENABLE_kubelet = "enable" |
| 90 | |
| 91 | FILES_kubeadm = "${bindir}/kubeadm ${systemd_unitdir}/system/kubelet.service.d/*" |
| 92 | FILES_kubectl = "${bindir}/kubectl" |
| 93 | FILES_kubelet = "${bindir}/kubelet ${systemd_unitdir}/system/kubelet.service ${sysconfdir}/kubernetes/manifests/" |
| 94 | |
| 95 | INHIBIT_PACKAGE_STRIP = "1" |
| 96 | INSANE_SKIP_${PN} += "ldflags already-stripped" |
| 97 | |
| 98 | deltask compile_ptest_base |