# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=flannel _pkgname=flanneld pkgver=0.21.5 pkgrel=0 pkgdesc="An etcd backed network fabric for containers" url="https://github.com/flannel-io/flannel" arch="x86_64" license="Apache-2.0" options="net" makedepends="go linux-headers" subpackages="$pkgname-openrc $pkgname-contrib-cni:contrib_cni:noarch" source="$pkgname-$pkgver.tar.gz::https://github.com/flannel-io/flannel/archive/refs/tags/v$pkgver.tar.gz $_pkgname.logrotated $_pkgname.initd $_pkgname.confd" builddir="$srcdir/$pkgname-$pkgver" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { mkdir -p out go build \ -mod=readonly \ -ldflags "-s -w -X github.com/flannel-io/flannel/version.Version=$pkgver" \ -o "out/$_pkgname" } check() { ./out/flanneld --version } package() { install -Dm0755 out/$_pkgname "$pkgdir"/usr/bin/$_pkgname install -Dm755 "$srcdir"/$_pkgname.initd \ "$pkgdir"/etc/init.d/$_pkgname install -Dm755 "$srcdir"/$_pkgname.confd \ "$pkgdir"/etc/conf.d/$_pkgname install -Dm644 "$srcdir"/$_pkgname.logrotated \ "$pkgdir"/etc/logrotate.d/$_pkgname install -d "$pkgdir"/var/log/$pkgname install -d "$pkgdir"/var/run/$pkgname } contrib_cni() { pkgdesc="$pkgname contrib cni config files" mkdir -p "$subpkgdir"/etc/cni/net.d install -Dm0755 "$builddir"/dist/mk-docker-opts.sh "$subpkgdir"/usr/bin/mk-docker-opts.sh install -Dm0755 "$builddir"/dist/iptables-wrapper-installer.sh "$subpkgdir"/usr/bin/iptables-wrapper-installer.sh install -Dm0644 "$builddir"/Documentation/kube-flannel.yml \ "$subpkgdir"/etc/kube-flannel/kube-flannel.yml install -Dm0644 "$builddir"/Documentation/k8s-old-manifests/kube-flannel-legacy.yml \ "$subpkgdir"/etc/kube-flannel/kube-flannel-legacy.tml } cleanup_srcdir() { export GOPATH="$srcdir" go clean -modcache default_cleanup_srcdir } sha512sums=" 29a2f5ffb53cf7dcdf87c30aea7365ee9405761ac2481c2428cbadc13dadea4afa833723f4e9b292e4e192d00cbefd7c15d8a3a16363c6d98832bcdf8cfe9600 flannel-0.21.5.tar.gz d84258a164adcec0f1cef7fcafcf0cadb3bf3959b393b905c4897274adeff476279ce96ec42e9aa9d574c6bd7d37649d92c7c52563975f85d303cade990a3942 flanneld.logrotated 3f6f33fe90adca1dd17b503ce0cd3a7f3cc0ca7fc10d0ca5b631f4c87ed513c0133dfd7679618cf95540b252b3176f9bbefd6454867ef792258c46cafc039d86 flanneld.initd 353b98bfc1a73d8f691b6f79489e0224961b5af8ca36ce2edde2d7a86790612de1d597c3455222f38a1c9f09b377e1bf3adfeedc04bd6b0b75c653a732d58988 flanneld.confd "