app-crypt/lego - 5.0.4 (gentoo)

Search

Install

Install this version:

emerge -a =app-crypt/lego-5.0.4

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =app-crypt/lego-5.0.4

Or alternatively:

emerge --autounmask-write -a =app-crypt/lego-5.0.4

Package Information

Description:
Let's Encrypt/ACME client (like certbot or acme.sh) and library written in Go
Homepage:
https://github.com/go-acme/lego/
License:
MIT Apache-2.0 BSD-2 BSD ISC MPL-2.0

Ebuild Details

Version EAPI Keywords Slot
5.0.4 8 ~amd64 ~arm64 0
View Raw Ebuild
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="Let's Encrypt/ACME client (like certbot or acme.sh) and library written in Go"
HOMEPAGE="https://github.com/go-acme/lego/"

DOCUMENTATION_COMMIT=0a8af4b4f612255dde1b1d5d2c8f6769405de5cf

if [[ ${PV} == 9999* ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/go-acme/lego.git"
else
	SRC_URI="
	https://github.com/go-acme/lego/archive/v${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/go-acme/lego/archive/${DOCUMENTATION_COMMIT}.tar.gz -> ${P}-docs.tar.gz
	https://distfiles.gentoo.org/pub/dev/ceamac@gentoo.org/${CATEGORY}/${PN}/${PN}-5.0.0-deps.tar.xz
"
	KEYWORDS="~amd64 ~arm64"
fi

# main
LICENSE="MIT"
# deps
LICENSE+=" Apache-2.0 BSD-2 BSD ISC MPL-2.0"
SLOT="0"

# some tests require network access otherwise get following error
# expected: "zoneee: unexpected status code: [status code: 401] body: Unauthorized"
# actual  : "zoneee: could not find zone for domain \"prefix.example.com\" (_acme-challenge.prefix.example.com.): could not find the start of authority for _acme-challenge.prefix.example.com.: read udp 10.0.0.1:54729->10.0.0.1:53: read: connection refused"
PROPERTIES="test_network"
RESTRICT="test"

BDEPEND=">=dev-lang/go-1.25.0"

src_unpack() {
	if [[ ${PV} == 9999* ]]; then
		git-r3_src_unpack
		go-module_live_vendor
		EGIT_BRANCH="gh-pages"
		EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}-${DOCUMENTATION_COMMIT}"
		git-r3_src_unpack
	else
		default
	fi
}

src_prepare() {
	default
	find ../"${PN}"-"${DOCUMENTATION_COMMIT}"/ -type f -not -name '*.html' -delete || die

	# Use the same dependencies bundle as 5.0.0
	mv "${WORKDIR}"/${PN}-5.0.0/vendor vendor || die
}

src_compile() {
	export CGO_ENABLED=0

	local VERSION
	if [[ ${PV} == 9999* ]]; then
		VERSION="$(git rev-parse HEAD)" || die
	else
		VERSION="${PV}"
	fi

	ego build -trimpath -ldflags "-X main.version=${VERSION}" -o dist/"${PN}" .
}

src_test() {
	ego test -v -cover ./...
}

src_install() {
	# primary program
	dobin dist/"${PN}"

	# docs
	einstalldocs
	dodoc -r ../"${PN}"-"${DOCUMENTATION_COMMIT}"/*
}

Inherited Eclasses

Dependencies

BDEPEND

>=dev-lang/go-1.25.0

Manifest for 5.0.4

Type File Size Source URLs
DIST lego-5.0.0-deps.tar.xz 7064280 bytes https://distfiles.gentoo.org/pub/dev/ceamac@gentoo.org//lego/lego-5.0.0-deps.tar.xz
DIST lego-5.0.4-docs.tar.gz 4255239 bytes https://github.com/go-acme/lego/archive/0a8af4b4f612255dde1b1d5d2c8f6769405de5cf.tar.gz
DIST lego-5.0.4.tar.gz 1248257 bytes https://github.com/go-acme/lego/archive/v5.0.4.tar.gz