diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2023-05-02 23:18:12 +0200 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-05-08 18:42:14 -0400 |
commit | 8c599baea9003f13b0fad5334f5425ab85b8362c (patch) | |
tree | 2722c4f74c37afd73511c2f17d8bb7284ea49cf2 | |
parent | d903219b9edc18c5c2abeab2e6bcca033aa996ee (diff) | |
download | meta-virtualization-8c599baea9003f13b0fad5334f5425ab85b8362c.tar.gz |
netavark: Rewrite the recipe
The previous version of the recipe was generated by cargo-bitbake, which
expects that future updates to the recipe will also be done by
cargo-bitbake and therefore formats it to accomodate this.
Since we have now switched to the more commonly used (and supported)
cargo-update-recipe-crates bbclass for updating the crate URIs, the
recipe can be rewritten to better conform to common recipe standards.
This also folds netavark.inc into it as there is no longer any need
to keep it separate.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/netavark/netavark.inc | 49 | ||||
-rw-r--r-- | recipes-containers/netavark/netavark_1.2.0.bb | 70 |
2 files changed, 48 insertions, 71 deletions
diff --git a/recipes-containers/netavark/netavark.inc b/recipes-containers/netavark/netavark.inc deleted file mode 100644 index c15bbea6..00000000 --- a/recipes-containers/netavark/netavark.inc +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | inherit ptest | ||
2 | |||
3 | PACKAGECONFIG ?= "aardvark-dns" | ||
4 | |||
5 | # From the documentation of netavark | ||
6 | # https://github.com/containers/netavark/blob/v1.1.0/DISTRO_PACKAGE.md#dependency-on-aardvark-dns | ||
7 | # The aardvark-dns will be installed by default with netavark, but | ||
8 | # netavark will be functional without it. | ||
9 | PACKAGECONFIG[aardvark-dns]= " , , , aardvark-dns" | ||
10 | |||
11 | # Rdepends on aardvark-dns which rdepends on slirp4netns | ||
12 | inherit features_check | ||
13 | REQUIRED_DISTRO_FEATURES ?= "seccomp" | ||
14 | |||
15 | SRC_URI += " \ | ||
16 | file://run-ptest \ | ||
17 | file://tests.patch \ | ||
18 | " | ||
19 | |||
20 | # Cargo installs the binary to bin so move it to where podman expects it | ||
21 | do_install:append() { | ||
22 | install -d ${D}${libexecdir}/podman/ | ||
23 | mv ${D}${bindir}/* ${D}${libexecdir}/podman/ | ||
24 | rm -rf ${D}${bindir}/ | ||
25 | } | ||
26 | |||
27 | |||
28 | do_install_ptest () { | ||
29 | cp -r ${S}/test ${D}${PTEST_PATH} | ||
30 | } | ||
31 | |||
32 | RDEPENDS:${PN}-ptest += " \ | ||
33 | bats \ | ||
34 | bash \ | ||
35 | coreutils \ | ||
36 | jq \ | ||
37 | iproute2 \ | ||
38 | dbus-daemon-proxy \ | ||
39 | util-linux-unshare \ | ||
40 | nmap \ | ||
41 | procps-ps \ | ||
42 | util-linux-nsenter \ | ||
43 | bind-utils \ | ||
44 | " | ||
45 | |||
46 | |||
47 | # bind-utils is used to install dig | ||
48 | # procps is necessary because the ps from busybox is | ||
49 | # not having the same behavior | ||
diff --git a/recipes-containers/netavark/netavark_1.2.0.bb b/recipes-containers/netavark/netavark_1.2.0.bb index a3af0833..0643bc31 100644 --- a/recipes-containers/netavark/netavark_1.2.0.bb +++ b/recipes-containers/netavark/netavark_1.2.0.bb | |||
@@ -1,30 +1,56 @@ | |||
1 | # Auto-Generated by cargo-bitbake 0.3.16 | 1 | SUMMARY = "A container network stack" |
2 | # | 2 | HOMEPAGE = "https://github.com/containers/netavark" |
3 | inherit cargo cargo-update-recipe-crates | 3 | |
4 | LICENSE = "Apache-2.0" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
4 | 6 | ||
5 | # If this is git based prefer versioned ones if they exist | 7 | SRCREV = "90cccc1c21f26fbc473a201ce3b30d77667c7635" |
6 | # DEFAULT_PREFERENCE = "-1" | ||
7 | 8 | ||
8 | # how to get netavark could be as easy as but default to a git checkout: | 9 | # It is possible to fetch the source using the crate fetcher instead: |
9 | # SRC_URI += "crate://crates.io/netavark/1.2.0" | 10 | #SRC_URI = "crate://crates.io/${BPN}/${PV}" |
10 | SRC_URI += "git://github.com/containers/netavark.git;protocol=https;nobranch=1" | 11 | SRC_URI = "git://github.com/containers/netavark.git;protocol=https;nobranch=1 \ |
12 | file://tests.patch \ | ||
13 | file://run-ptest" | ||
11 | require ${BPN}-crates.inc | 14 | require ${BPN}-crates.inc |
12 | 15 | ||
13 | SRCREV = "90cccc1c21f26fbc473a201ce3b30d77667c7635" | ||
14 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
15 | CARGO_SRC_DIR = "" | ||
16 | 17 | ||
17 | # FIXME: update generateme with the real MD5 of the license file | 18 | PACKAGECONFIG ?= "aardvark-dns" |
18 | LIC_FILES_CHKSUM = " \ | ||
19 | file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
20 | " | ||
21 | 19 | ||
22 | SUMMARY = "A container network stack" | 20 | # From the documentation of netavark |
23 | HOMEPAGE = "https://github.com/containers/netavark" | 21 | # https://github.com/containers/netavark/blob/v1.1.0/DISTRO_PACKAGE.md#dependency-on-aardvark-dns |
24 | LICENSE = "Apache-2.0" | 22 | # The aardvark-dns will be installed by default with netavark, but |
23 | # netavark will be functional without it. | ||
24 | PACKAGECONFIG[aardvark-dns]= ",,, aardvark-dns" | ||
25 | |||
26 | inherit cargo cargo-update-recipe-crates features_check ptest | ||
27 | |||
28 | # Cargo installs the binary to bin so move it to where podman expects it | ||
29 | do_install:append() { | ||
30 | install -d ${D}${libexecdir} | ||
31 | mv ${D}${bindir} ${D}${libexecdir}/podman | ||
32 | } | ||
25 | 33 | ||
26 | # includes this file if it exists but does not fail | 34 | do_install_ptest() { |
27 | # this is useful for anything you may want to override from | 35 | cp -r ${S}/test ${D}${PTEST_PATH} |
28 | # what cargo-bitbake generates. | 36 | } |
29 | include netavark-${PV}.inc | 37 | |
30 | include netavark.inc | 38 | # rdepends on aardvark-dns which rdepends on slirp4netns |
39 | REQUIRED_DISTRO_FEATURES ?= "seccomp" | ||
40 | |||
41 | # bind-utils is used to install dig | ||
42 | # procps-ps is necessary because the ps from busybox is | ||
43 | # not having the same behavior | ||
44 | RDEPENDS:${PN}-ptest += " \ | ||
45 | bash \ | ||
46 | bats \ | ||
47 | bind-utils \ | ||
48 | coreutils \ | ||
49 | dbus-daemon-proxy \ | ||
50 | iproute2 \ | ||
51 | jq \ | ||
52 | nmap \ | ||
53 | procps-ps \ | ||
54 | util-linux-nsenter \ | ||
55 | util-linux-unshare \ | ||
56 | " | ||