diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-06-29 12:04:12 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-06-29 12:04:12 +0100 |
commit | 0f558761aa2dee1017b4751e4017205e015a9560 (patch) | |
tree | 037df795519468a25d9362b4e95cdaeb84eb1cf9 /net-dns/coredns/coredns-1.9.3.ebuild | |
parent | 752d6256e5204b958b0ef7905675a940b5e9172f (diff) |
gentoo resync : 29.12.2022
Diffstat (limited to 'net-dns/coredns/coredns-1.9.3.ebuild')
-rw-r--r-- | net-dns/coredns/coredns-1.9.3.ebuild | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/net-dns/coredns/coredns-1.9.3.ebuild b/net-dns/coredns/coredns-1.9.3.ebuild new file mode 100644 index 000000000000..f2aae567db44 --- /dev/null +++ b/net-dns/coredns/coredns-1.9.3.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# Don't forget to update when bumping. Used in --version output +EGIT_COMMIT="45b0a11294c59bfd806a57807aaa2a185f761cd5" + +inherit fcaps go-module systemd tmpfiles + +ARCHIVE_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI="${ARCHIVE_URI} https://dev.gentoo.org/~zmedico/dist/${P}-deps.tar.xz" + +KEYWORDS="~amd64" + +DESCRIPTION="A DNS server that chains middleware" +HOMEPAGE="https://github.com/coredns/coredns" + +LICENSE="Apache-2.0 MIT BSD ISC MPL-2.0 BSD-2" +SLOT="0" +RDEPEND="acct-user/coredns + acct-group/coredns" + +# TODO: debug test failure with deps tarball +RESTRICT+=" test" + +FILECAPS=( + -m 755 'cap_net_bind_service=+ep' usr/bin/${PN} +) + +src_compile() { + go build -v -ldflags="-X github.com/coredns/coredns/coremain.GitCommit=${EGIT_COMMIT}" || + die "go build failed" +} + +src_install() { + dobin "${PN}" + einstalldocs + doman man/* + + newinitd "${FILESDIR}"/coredns.initd coredns + newconfd "${FILESDIR}"/coredns.confd coredns + + insinto /etc/coredns/ + newins "${FILESDIR}"/Corefile.example Corefile + + insinto /etc/logrotate.d + newins "${FILESDIR}"/coredns.logrotated coredns + + systemd_dounit "${FILESDIR}"/coredns.service + newtmpfiles "${FILESDIR}"/coredns.tmpfiles "${PN}.conf" +} + +src_test() { + # eclass default '-x' makes tests output unreadable + export GOFLAGS="-v -mod=readonly" + + local known_fail=( + "TestZoneExternalCNAMELookupWithProxy" + "TestMetricsSeveralBlocs" + "TestMetricsAvailable" + "TestMetricsAvailableAfterReload" + "TestMetricsAvailableAfterReloadAndFailedReload" + ) + # concat as '|^Test1$|^Test2$|^Test3...$': + local known_fail_re="$(printf '|^%s$' "${known_fail[@]}")" + # drop '|' in the begining: + known_fail_re="${known_fail_re:1}" + + local working_tests_re="$( + # get list of all test: + { GOFLAGS="-mod=readonly" go test -list . ./... || + die "Can't get list of tests"; } | + # skip "no tests" messages as well as know failures: + grep -v -E " |${known_fail_re}" | + # format a regexp: + sed -z 's/\n/$|^/g' + )" + # drop '|^' in the end: + working_tests_re="^${working_tests_re::-2}" + + go test -race -run "${working_tests_re}" ./... || die "Tests failed" + go test -race -run "${known_fail_re}" ./... || ewarn "Known test failure" +} + +pkg_postinst() { + fcaps_pkg_postinst + tmpfiles_process ${PN}.conf +} |