From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 93FDC158041 for ; Mon, 25 Mar 2024 04:21:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92E34E29BA; Mon, 25 Mar 2024 04:21:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6D769E29BA for ; Mon, 25 Mar 2024 04:21:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 07F5B34307D for ; Mon, 25 Mar 2024 04:20:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 45247103F for ; Mon, 25 Mar 2024 04:20:57 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1711340393.56473ed6635c9701ea1bbec933a57c76581bc57e.zmedico@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/coredns/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-dns/coredns/Manifest net-dns/coredns/coredns-1.11.2-r1.ebuild X-VCS-Directories: net-dns/coredns/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 56473ed6635c9701ea1bbec933a57c76581bc57e X-VCS-Branch: master Date: Mon, 25 Mar 2024 04:20:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 927fea30-412a-44bb-8abb-098da8fdafe5 X-Archives-Hash: 50081f8ee09ac82828cfbcc91c16817f commit: 56473ed6635c9701ea1bbec933a57c76581bc57e Author: Zac Medico gentoo org> AuthorDate: Mon Mar 25 04:10:36 2024 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Mar 25 04:19:53 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56473ed6 net-dns/coredns: 1.11.2-r1 revbump for smaller deps tarball Only include `go mod vendor` output in the deps tarball, which reduces size significantly: $ du -h /var/cache/distfiles/coredns-1.11.2*deps* 250M /var/cache/distfiles/coredns-1.11.2-deps.tar.xz 6.3M /var/cache/distfiles/coredns-1.11.2-r1-deps.tar.xz Since https://github.com/gentoo/gentoo/pull/35773 we've been doing this for caddy as well. Signed-off-by: Zac Medico gentoo.org> net-dns/coredns/Manifest | 1 + net-dns/coredns/coredns-1.11.2-r1.ebuild | 121 +++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) diff --git a/net-dns/coredns/Manifest b/net-dns/coredns/Manifest index 1887ae958822..9f5b7a662200 100644 --- a/net-dns/coredns/Manifest +++ b/net-dns/coredns/Manifest @@ -1,2 +1,3 @@ DIST coredns-1.11.2-deps.tar.xz 261482588 BLAKE2B 39e30800ac1fc404dc60f859b929c4a69614b9f0be8937c3fd7b1a872ec1e163ab4f6a313ed7661d2a101318187aaa2419168c0511cf2108c43ada38db0d1e0b SHA512 91282766d10d28d564d14fb20d8d82808507e509c58b7bb1959bb03a2665a287057aa4d547bfc8cc60ff080eea807af1c57d86bf9ff000125ef0642d8557e47f +DIST coredns-1.11.2-r1-deps.tar.xz 6547080 BLAKE2B 19a067a5b402ebe3b8a462e534bbdcf9baade4b5f434c6f24fe8ede0cbe623e2d5d8bdf0ffc06954d796441095688f19caa40f2255a2cc56102fdef36d327ac5 SHA512 caf6e0f1c9be4857059244019d6556f907e4f6907a932c201c856355c3e0b86c1752a90a226d5904c511d0db08ce4869cc5d24203bb4b9e2e1be02e725990332 DIST coredns-1.11.2.tar.gz 651994 BLAKE2B 1a7a272756eaf83170e242a573c8a765d6ea7b70fe422d36a87850b600a88287291aa0fe0d49462c34453d4d3c4d33f9497be409379ff8fccc87f41e2195efc1 SHA512 0e90ef4793555bd46aa5ce84cf639c015d1869b407627c69746eb948abff1920f891c45e5f00c0127f23e2c6394c07cc55c1776af840881210f90faa6ec22b40 diff --git a/net-dns/coredns/coredns-1.11.2-r1.ebuild b/net-dns/coredns/coredns-1.11.2-r1.ebuild new file mode 100644 index 000000000000..745049a5ed09 --- /dev/null +++ b/net-dns/coredns/coredns-1.11.2-r1.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit fcaps go-module multiprocessing systemd tmpfiles toolchain-funcs + +DESCRIPTION="CoreDNS is a DNS server that chains plugins" +HOMEPAGE="https://github.com/coredns/coredns" + +if [[ ${PV} == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/coredns/coredns.git" +else + #SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + # The v1.11.2 tag went missing upstream, so use a previously fetched copy. + SRC_URI="https://dev.gentoo.org/~zmedico/dist/${P}.tar.gz" + SRC_URI+=" https://dev.gentoo.org/~zmedico/dist/${PF}-deps.tar.xz" + KEYWORDS="~amd64" +fi + +# main +LICENSE="Apache-2.0" +# deps +LICENSE+=" MIT BSD ISC MPL-2.0 BSD-2" + +SLOT="0" +IUSE="test" +# TODO: debug test failure with deps tarball +RESTRICT="test" + +RDEPEND="acct-user/coredns + acct-group/coredns" + +FILECAPS=( + -m 755 'cap_net_bind_service=+ep' usr/bin/${PN} +) + +src_unpack() { + if [[ ${PV} == *9999* ]]; then + git-r3_src_unpack + go-module_live_vendor + else + go-module_src_unpack + fi +} + +src_prepare() { + default + use test || sed -i -e 's|coredns: $(CHECKS)|coredns:|' Makefile +} + +src_compile() { + # For non-live versions, prevent git operations which causes sandbox violations + # https://github.com/gentoo/gentoo/pull/33531#issuecomment-1786107493 + [[ ${PV} != 9999* ]] && export GITCOMMIT='' + + # Mimicking go-module.eclass's GOFLAGS + if use amd64 || use arm || use arm64 || + ( use ppc64 && [[ $(tc-endian) == "little" ]] ) || use s390 || use x86; then + local buildmode="-buildmode=pie" + fi + export BUILDOPTS="-buildvcs=false -modcacherw -v -x -p=$(makeopts_jobs) ${buildmode}" + + default +} + +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 +}