blob: 2c7161ec06502a8244cab3d49388cd7a73cb2c70 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001HOMEPAGE = "git://github.com/kubernetes/kubernetes"
2SUMMARY = "Production-Grade Container Scheduling and Management"
3DESCRIPTION = "Kubernetes is an open source system for managing containerized \
4applications across multiple hosts, providing basic mechanisms for deployment, \
5maintenance, and scaling of applications. \
6"
7
8SRCREV_kubernetes = "4b839465f84e7faf876c51703aaf49b37fd10d9c"
9SRC_URI = "git://github.com/kubernetes/kubernetes.git;nobranch=1;name=kubernetes \
10 "
11
12DEPENDS += "rsync-native \
13 coreutils-native \
14 "
15
16PACKAGES =+ "kubeadm"
17PACKAGES =+ "kubectl"
18PACKAGES =+ "kubelet"
19
20ALLOW_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.
24RDEPENDS_${PN} += "kubeadm \
25 kubectl \
26 kubelet \
27 cni"
28
29RDEPENDS_kubeadm = "kubelet kubectl"
30RDEPENDS_kubelet = "iptables socat util-linux ethtool iproute2 ebtables"
31
32LICENSE = "Apache-2.0"
33LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
34
35GO_IMPORT = "import"
36
37PV = "1.9.0-alpha.1+git${SRCREV_kubernetes}"
38
39inherit systemd
40inherit go
41inherit goarch
42
43do_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
74do_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
87SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet','',d)}"
88SYSTEMD_SERVICE_kubelet = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet.service','',d)}"
89SYSTEMD_AUTO_ENABLE_kubelet = "enable"
90
91FILES_kubeadm = "${bindir}/kubeadm ${systemd_unitdir}/system/kubelet.service.d/*"
92FILES_kubectl = "${bindir}/kubectl"
93FILES_kubelet = "${bindir}/kubelet ${systemd_unitdir}/system/kubelet.service ${sysconfdir}/kubernetes/manifests/"
94
95INHIBIT_PACKAGE_STRIP = "1"
96INSANE_SKIP_${PN} += "ldflags already-stripped"
97
98deltask compile_ptest_base