blob: 02e8de2698bcb7557fdbf1cefcacf752fa0ae689 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module linux-info systemd
DESCRIPTION="Standard networking plugins for container networking"
HOMEPAGE="https://github.com/containernetworking/plugins"
SRC_URI="https://github.com/containernetworking/plugins/archive/v${PV}.tar.gz -> ${P}.tar.gz"
S=${WORKDIR}/plugins-${PV}
LICENSE="Apache-2.0"
# Dependent licenses
LICENSE+=" Apache-2.0 BSD BSD-2 MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv"
IUSE="hardened"
RDEPEND="net-firewall/iptables"
CONFIG_CHECK="~BRIDGE_VLAN_FILTERING ~NETFILTER_XT_MATCH_COMMENT
~NETFILTER_XT_MATCH_MULTIPORT"
src_compile() {
local -x CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')"
local f
for f in plugins/{meta,main,ipam}/*; do
[[ ${f} == *windows* ]] && continue
einfo "Building ${f}"
ego build -mod=vendor -o "bin/${f##*/}" "./${f}"
done
}
src_install() {
exeinto /opt/cni/bin
doexe bin/*
dodoc README.md
local f
for f in plugins/{meta,main,ipam}/*/README.md; do
[[ ${f} == *windows* ]] && continue
f=${f%/*}
newdoc "${f}/README.md" "${f##*/}.README.md"
done
systemd_dounit plugins/ipam/dhcp/systemd/cni-dhcp.{service,socket}
newinitd "${FILESDIR}"/cni-dhcp.initd cni-dhcp
}
|