mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-11 08:03:16 -04:00
71 lines
1.7 KiB
Bash
71 lines
1.7 KiB
Bash
# Copyright 2022 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
EGIT_COMMIT="18822f9a4fb35d1349eb256f4cd2bfd372474d84"
|
|
MY_PN=${PN//-cni-plugin}
|
|
MY_P=${MY_PN}-${PV}
|
|
|
|
inherit go-module
|
|
|
|
DESCRIPTION="name resolution for containers"
|
|
HOMEPAGE="https://github.com/containers/dnsname"
|
|
|
|
if [[ ${PV} == *9999 ]]; then
|
|
inherit git-r3
|
|
EGIT_REPO_URI="https://github.com/containers/dnsname.git"
|
|
RESTRICT="fetch mirror test"
|
|
else
|
|
SRC_URI="https://github.com/containers/dnsname/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
SRC_URI+=" https://github.com/ran-dall/portage-deps/raw/master/${P}-deps.tar.xz"
|
|
KEYWORDS="~amd64 ~arm64"
|
|
RESTRICT="mirror test"
|
|
S="${WORKDIR}"/${MY_P}
|
|
fi
|
|
|
|
LICENSE="Apache-2.0"
|
|
SLOT="0"
|
|
|
|
DEPEND="
|
|
app-containers/podman
|
|
app-containers/cni-plugins
|
|
net-dns/dnsmasq
|
|
"
|
|
RDEPEND="${DEPEND}"
|
|
|
|
src_unpack() {
|
|
default
|
|
if [[ ${PV} == *9999 ]]; then
|
|
git-r3_fetch
|
|
git-r3_checkout
|
|
pushd ${MY_P}/plugins/meta/dnsname || die "location change for module building failed"
|
|
ego get
|
|
popd || die "location reset from module building failed"
|
|
fi
|
|
}
|
|
|
|
src_prepare() {
|
|
default
|
|
rm LICENSE || die "removal of unneeded LICENSE failed"
|
|
rm CODE-OF-CONDUCT.md || die "removal of unneeded CODE-OF-CONDUCT.md failed"
|
|
rm RELEASE_NOTES.md || die "removal of unneeded RELEASE_NOTES.md failed"
|
|
rm OWNERS || die "a removal of an unneeded documentation file failed"
|
|
}
|
|
|
|
src_compile() {
|
|
local git_commit=${EGIT_COMMIT}
|
|
export -n GOCACHE GOPATH XDG_CACHE_HOME
|
|
GOBIN="${S}/bin" \
|
|
emake all \
|
|
GIT_BRANCH=master \
|
|
GIT_BRANCH_CLEAN=master \
|
|
COMMIT_NO="${git_commit}" \
|
|
GIT_COMMIT="${git_commit}"
|
|
}
|
|
|
|
src_install() {
|
|
exeinto /opt/cni/bin
|
|
doexe bin/*
|
|
dodoc README.md README_PODMAN.md SECURITY.md
|
|
}
|