blob: 1677ff4863681b216f43ef28992429f2e53a4752 [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
Brad Bishop316dfdd2018-06-25 12:45:53 -04008SRCREV_kubernetes = "fc32d2f3698e36b93322a3465f63a14e9f0eaead"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05009SRC_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"
Brad Bishop316dfdd2018-06-25 12:45:53 -040019PACKAGES =+ "kube-proxy"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020
21ALLOW_EMPTY_${PN} = "1"
22
23# Note: we are explicitly *not* adding docker to the rdepends, since we allow
24# backends like cri-o to be used.
25RDEPENDS_${PN} += "kubeadm \
26 kubectl \
27 kubelet \
28 cni"
29
30RDEPENDS_kubeadm = "kubelet kubectl"
Brad Bishop316dfdd2018-06-25 12:45:53 -040031RDEPENDS_kubelet = "iptables socat util-linux ethtool iproute2 ebtables iproute2-tc"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032
33LICENSE = "Apache-2.0"
34LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
35
36GO_IMPORT = "import"
37
Brad Bishop316dfdd2018-06-25 12:45:53 -040038PV = "1.10.0+git${SRCREV_kubernetes}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050039
40inherit systemd
41inherit go
42inherit goarch
43
44do_compile() {
45 export GOARCH="${TARGET_GOARCH}"
46 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
47 export GOPATH="${S}/src/import:${S}/src/import/vendor"
48
49 # Pass the needed cflags/ldflags so that cgo
50 # can find the needed headers files and libraries
51 export CGO_ENABLED="1"
52 export CFLAGS=""
53 export LDFLAGS=""
54 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
55 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
56
57 # link fixups for compilation
58 rm -f ${S}/src/import/vendor/src
59 ln -sf ./ ${S}/src/import/vendor/src
60
61 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
62 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
63
64 # Pass the needed cflags/ldflags so that cgo
65 # can find the needed headers files and libraries
66 export CGO_ENABLED="1"
67 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
68 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
69
70 cd ${S}/src/import
71 # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
72 make all
73}
74
75do_install() {
76 install -d ${D}${bindir}
77 install -d ${D}${systemd_unitdir}/system/
78 install -d ${D}${systemd_unitdir}/system/kubelet.service.d/
79
80 install -d ${D}${sysconfdir}/kubernetes/manifests/
81
82 install -m 755 -D ${S}/src/import/_output/bin/kube* ${D}/${bindir}
83
84 install -m 0644 ${S}/src/import/build/debs/kubelet.service ${D}${systemd_unitdir}/system/
85 install -m 0644 ${S}/src/import/build/debs/10-kubeadm.conf ${D}${systemd_unitdir}/system/kubelet.service.d/
86}
87
88SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet','',d)}"
89SYSTEMD_SERVICE_kubelet = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet.service','',d)}"
90SYSTEMD_AUTO_ENABLE_kubelet = "enable"
91
92FILES_kubeadm = "${bindir}/kubeadm ${systemd_unitdir}/system/kubelet.service.d/*"
93FILES_kubectl = "${bindir}/kubectl"
Brad Bishop316dfdd2018-06-25 12:45:53 -040094FILES_kube-proxy = "${bindir}/kube-proxy"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050095FILES_kubelet = "${bindir}/kubelet ${systemd_unitdir}/system/kubelet.service ${sysconfdir}/kubernetes/manifests/"
96
97INHIBIT_PACKAGE_STRIP = "1"
98INSANE_SKIP_${PN} += "ldflags already-stripped"
99
100deltask compile_ptest_base