commit:     e63a41d91ce04e89df1f7aa18307b1b07f4942f1
Author:     Rahil Bhimjiani <me <AT> rahil <DOT> rocks>
AuthorDate: Sat Apr  5 06:02:29 2025 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sun Apr  6 06:25:55 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e63a41d9

app-crypt/lego: add 4.22.2 & live. New package. Moving it from GURU

Lego - Let's Encrypt/ACME client (like certbot or acme.sh) and library
written in Go

Signed-off-by: Rahil Bhimjiani <me <AT> rahil.rocks>
Closes: https://github.com/gentoo/gentoo/pull/34125
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-crypt/lego/Manifest           |  3 ++
 app-crypt/lego/lego-4.22.2.ebuild | 79 +++++++++++++++++++++++++++++++++++++++
 app-crypt/lego/lego-9999.ebuild   | 79 +++++++++++++++++++++++++++++++++++++++
 app-crypt/lego/metadata.xml       | 17 +++++++++
 4 files changed, 178 insertions(+)

diff --git a/app-crypt/lego/Manifest b/app-crypt/lego/Manifest
new file mode 100644
index 000000000000..eb96eddb1337
--- /dev/null
+++ b/app-crypt/lego/Manifest
@@ -0,0 +1,3 @@
+DIST lego-4.22.2-deps.tar.xz 7963988 BLAKE2B 
279adf06311ee0769acb7e8681da09fef75456f8ade9d45f0daaa031920fcb2198fd0cab5a37e04332fccfb30e195fcfc1e66f80644861a6a3d502fa650264c5
 SHA512 
24e9cdf1afe65845a6c7846e71f92532b3e7dad304f9ea4b04afb0f65d8842c67036578fa453ce6a9cd6835be97e86412a52d31fa958bf8b3645e6d3297137b8
+DIST lego-4.22.2-docs.tar.gz 10722353 BLAKE2B 
24dea7d335646d12c55e23e030a81767618da9c32a09e464d7fad0e91f914eaed4508c1d1a771725c9ea0e2eedb8cddc2e5cd6b0e2bb31c7d1ee89791d342ed9
 SHA512 
1b998ee4153e5621b7c53e9dc4941c6749c916c6c92d2dfe8e2373f6ee7ad86dd2d13c1ef1d227a464a182ec7c35484d524778e8e6dc4531941eccc2b6304c22
+DIST lego-4.22.2.tar.gz 804158 BLAKE2B 
a75a327988d46ed8715a3c28c34a5de1c9de607b396b3179645a7b4a0dd83aa408bad10df4e64cc5d402ddf8653d17c034019c4d4f162fb9a252d83013278314
 SHA512 
a69c15e65753ba428635804a0f47d708c13beab3cbd888cc6d9b80fc13ee0614c4a4e948b43972d201f95969171db4443b81672ad93b7a681b96af11f9250db1

diff --git a/app-crypt/lego/lego-4.22.2.ebuild 
b/app-crypt/lego/lego-4.22.2.ebuild
new file mode 100644
index 000000000000..e80722f65cd1
--- /dev/null
+++ b/app-crypt/lego/lego-4.22.2.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2025 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=f1411f1b397b637903fd2e62769d50b3974b97ec
+
+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/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz
 -> ${P}-deps.tar.xz
+       https://github.com/go-acme/lego/archive/${DOCUMENTATION_COMMIT}.tar.gz 
-> ${P}-docs.tar.gz
+"
+       KEYWORDS="~amd64"
+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"
+
+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
+}
+
+src_compile() {
+       export CGO_ENABLED=0
+
+       local VERSION
+       if [[ ${PV} == 9999* ]]; then
+               VERSION="$(git rev-parse HEAD)" || die
+       else
+               VERSION="${PV}"
+               ln -sv ../vendor ./ || die
+       fi
+
+       ego build -trimpath -ldflags "-X main.version=${VERSION}" -o 
dist/"${PN}" ./cmd/lego/
+}
+
+src_test() {
+       ego test -v -cover ./...
+}
+
+src_install() {
+       # primary program
+       dobin dist/"${PN}"
+
+       # docs
+       einstalldocs
+       dodoc -r ../"${PN}"-"${DOCUMENTATION_COMMIT}"/*
+}

diff --git a/app-crypt/lego/lego-9999.ebuild b/app-crypt/lego/lego-9999.ebuild
new file mode 100644
index 000000000000..e80722f65cd1
--- /dev/null
+++ b/app-crypt/lego/lego-9999.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2025 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=f1411f1b397b637903fd2e62769d50b3974b97ec
+
+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/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz
 -> ${P}-deps.tar.xz
+       https://github.com/go-acme/lego/archive/${DOCUMENTATION_COMMIT}.tar.gz 
-> ${P}-docs.tar.gz
+"
+       KEYWORDS="~amd64"
+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"
+
+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
+}
+
+src_compile() {
+       export CGO_ENABLED=0
+
+       local VERSION
+       if [[ ${PV} == 9999* ]]; then
+               VERSION="$(git rev-parse HEAD)" || die
+       else
+               VERSION="${PV}"
+               ln -sv ../vendor ./ || die
+       fi
+
+       ego build -trimpath -ldflags "-X main.version=${VERSION}" -o 
dist/"${PN}" ./cmd/lego/
+}
+
+src_test() {
+       ego test -v -cover ./...
+}
+
+src_install() {
+       # primary program
+       dobin dist/"${PN}"
+
+       # docs
+       einstalldocs
+       dodoc -r ../"${PN}"-"${DOCUMENTATION_COMMIT}"/*
+}

diff --git a/app-crypt/lego/metadata.xml b/app-crypt/lego/metadata.xml
new file mode 100644
index 000000000000..a150df1868ae
--- /dev/null
+++ b/app-crypt/lego/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Rahil Bhimjiani</name>
+       </maintainer>
+       <maintainer type="project" proxied="proxy">
+               <email>[email protected]</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">go-acme/lego</remote-id>
+               <bugs-to>https://github.com/go-acme/lego/issues</bugs-to>
+               <doc>https://go-acme.github.io/lego/</doc>
+       </upstream>
+</pkgmetadata>

Reply via email to