diff options
Diffstat (limited to 'recipes-networking')
-rw-r--r-- | recipes-networking/netns/netns_git.bb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/recipes-networking/netns/netns_git.bb b/recipes-networking/netns/netns_git.bb new file mode 100644 index 00000000..073022e5 --- /dev/null +++ b/recipes-networking/netns/netns_git.bb | |||
@@ -0,0 +1,44 @@ | |||
1 | HOMEPAGE = "https://github.com/jfrazelle/netns" | ||
2 | SUMMARY = "Runc hook for setting up default bridge networking." | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1" | ||
5 | DEPENDS = "go-cross" | ||
6 | |||
7 | SRC_URI = "git://github.com/jfrazelle/netns;branch=master" | ||
8 | SRCREV = "2804050eeab661bfa75c3aa06bdcf60273b02ca7" | ||
9 | PV = "0.1.0+git${SRCPV}" | ||
10 | |||
11 | S = "${WORKDIR}/git" | ||
12 | |||
13 | inherit go-osarchmap | ||
14 | |||
15 | do_compile() { | ||
16 | export GOARCH="${TARGET_GOARCH}" | ||
17 | |||
18 | # Setup vendor directory so that it can be used in GOPATH. | ||
19 | # | ||
20 | # Go looks in a src directory under any directory in GOPATH but netns | ||
21 | # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink. | ||
22 | # | ||
23 | # We also need to link in the ipallocator directory as that is not under | ||
24 | # a src directory. | ||
25 | ln -sfn . "${S}/vendor/src" | ||
26 | mkdir -p "${S}/vendor/src/github.com/jfrazelle/netns" | ||
27 | ln -sfn "${S}/ipallocator" "${S}/vendor/src/github.com/jfrazelle/netns/ipallocator" | ||
28 | export GOPATH="${S}/vendor" | ||
29 | |||
30 | # Pass the needed cflags/ldflags so that cgo | ||
31 | # can find the needed headers files and libraries | ||
32 | export CGO_ENABLED="1" | ||
33 | export CFLAGS="" | ||
34 | export LDFLAGS="" | ||
35 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
36 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
37 | |||
38 | oe_runmake static | ||
39 | } | ||
40 | |||
41 | do_install() { | ||
42 | install -d ${D}/${sbindir} | ||
43 | install ${S}/netns ${D}/${sbindir}/netns | ||
44 | } | ||