diff options
author | Rahil Bhimjiani <me@rahil.rocks> | 2024-06-13 19:33:54 +0530 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2024-06-28 20:15:02 -0700 |
commit | c71311afdc753b26e63fc74e732103521effa04a (patch) | |
tree | a2fe06c005c937995504d0aff938db5f27314605 /www-servers | |
parent | dev-python/ipython: Bump to 8.26.0 (diff) | |
download | gentoo-c71311afdc753b26e63fc74e732103521effa04a.tar.gz gentoo-c71311afdc753b26e63fc74e732103521effa04a.tar.bz2 gentoo-c71311afdc753b26e63fc74e732103521effa04a.zip |
www-servers/caddy: update to 2.8.4
* code cleanup related to beta versions because I don't want to maintain
those anymore
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
From: https://github.com/gentoo/gentoo/pull/37141
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/caddy/Manifest | 3 | ||||
-rw-r--r-- | www-servers/caddy/caddy-2.8.4.ebuild | 131 | ||||
-rw-r--r-- | www-servers/caddy/caddy-9999.ebuild | 8 |
3 files changed, 137 insertions, 5 deletions
diff --git a/www-servers/caddy/Manifest b/www-servers/caddy/Manifest index bfd4a8eabc22..2038371954be 100644 --- a/www-servers/caddy/Manifest +++ b/www-servers/caddy/Manifest @@ -4,3 +4,6 @@ DIST caddy-2.7.6.tar.gz 606077 BLAKE2B 1237edc164ec6095c9dff27c332925c4ce9d91a60 DIST caddy-2.8.0_beta2-deps.tar.xz 9983432 BLAKE2B 5ce369219b03688a18f01d7e0f14158a4831bdb02f90c9d4cd2554c8a516f8575155473134197c58c6b65b8752b2fc6a2cdf56b4eaacde20a01233c3f5b1dd38 SHA512 e4fd9432adb4cc98b1f765d5b7f3920030fc433e838a5b7f388f8ba220fe0f23e0c0ce5da01507e3241d03f3e7f010a49dde6ba49402f363fb005bb879c2c1a6 DIST caddy-2.8.0_beta2-docs.tar.gz 24678 BLAKE2B 5e03bada381b63a4549715c25f651e51eed81fc97d9e89cadb1128db55ba8344335590b10ac57a70395f7b57aa8ece93c5a8c2b6f4dd8e199f703bbed2147631 SHA512 d185e77d8020e7afd05a8dd7798fc29a9688268088129be8f813768f2fdd19abbd9e14440d80445c16844976f0740f5aa377ffc8084263c337d313c03adf7556 DIST caddy-2.8.0_beta2.tar.gz 656863 BLAKE2B 6d1364798629949611c8cc5094e0f91928c9a50fc7de2a084b85402cce07e553d9da2652f1fa55daac8c94c877beb08de7226b7f3befd57367b901e593be1d2c SHA512 64c3f6fb4e32947ff55307f71b416aeb8610d8fd3273514c59c6ebcf323a3552ceea0e3f6281ba4a879d24f1fa02d232e6f634e53fa9edebbce76f78c174032d +DIST caddy-2.8.4-deps.tar.xz 9995236 BLAKE2B c19901a458eae2d395fddb9ef8b02225f56e1cf5032a85493de58a9f797369997cb8be8fe52d6ec85333d26d879316f48af73fbd429ae2a4a3c6d2a5e57caea0 SHA512 2ff16025abb9b9a26abd2e2261b487ac34c31c09227ab573cdacad3a5206603a74a5585fa08041c2372469651d8a2a3410f2c562041aef3038c7ecc4fc8baec8 +DIST caddy-2.8.4-docs.tar.gz 24660 BLAKE2B 39628524c155b97f20ba00dec592d33e363086278ef96bd216807347d7b61a1a10d7bb50be84f84f3c4a6a972ff5034840700bf2bcd763cbcec75414a667b964 SHA512 c40a3e2b911ac106706e54022563685a0c920e35fe4716d878b79a3ebd8f422aa3bec847b3a0767a53453e40d8b21a3af1804a3c7bf62ddf61fc290c4129de0b +DIST caddy-2.8.4.tar.gz 662064 BLAKE2B 77aa671c22e55dff6bab3d251fa9f0a082e41176bf82f5cc9be5b9bee4a234e568c73b8865da116d0db26efbccdd58eeadac80f9160a06946426277640cec11c SHA512 5c354d0ceb3e927b918594c8c7de51f658aba798ac23d41b751c55b728f9fc5c46fa1f8c2e86c838e58d7b3514bc11937a765b36fd87971ea1757c92a70e9665 diff --git a/www-servers/caddy/caddy-2.8.4.ebuild b/www-servers/caddy/caddy-2.8.4.ebuild new file mode 100644 index 000000000000..da0106f31184 --- /dev/null +++ b/www-servers/caddy/caddy-2.8.4.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit fcaps go-module systemd shell-completion + +DESCRIPTION="Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS" +HOMEPAGE="https://caddyserver.com" + +if [[ "${PV}" == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/caddyserver/caddy.git" +else + SRC_URI=" + https://github.com/caddyserver/caddy/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/caddyserver/dist/archive/refs/tags/v${PV}.tar.gz -> ${P}-docs.tar.gz +" + KEYWORDS="~amd64 ~arm64 ~loong ~riscv" +fi + +# MAIN +LICENSE="Apache-2.0" +# deps +LICENSE+=" BSD ECL-2.0 MIT CC0-1.0" +SLOT="0" + +IUSE='events-handlers-exec security' +RESTRICT="test" + +RDEPEND=" + acct-user/http + acct-group/http" +DEPEND="${RDEPEND}" + +FILECAPS=( + -m 755 'cap_net_bind_service=+ep' usr/bin/"${PN}" +) + +PATCHES=( + "${FILESDIR}"/remove-binary-altering-commands-2.7.5.patch +) + +# takes a module as an only arg +add_custom_module() { + local LINE_NO=$(grep -n 'plug in Caddy modules here' cmd/caddy/main.go | awk -F: '{print $1;}' || die) + sed -i -e "${LINE_NO:?}a \ _ \"$1\"" cmd/caddy/main.go || die +} + +src_unpack() { + declare -A MOOMODULES || die + + use events-handlers-exec && { MOOMODULES[exec]="github.com/mholt/caddy-events-exec" || die ; } + use security && { MOOMODULES[sec]="github.com/greenpau/caddy-security" || die ; } + + export MY_MODULES="${MOOMODULES[@]}" || die + + if [[ "${PV}" == 9999* ]]; then + # clone main git repo + git-r3_src_unpack + + # get extra modules + pushd "${P}" || die + for moo in ${MY_MODULES}; do + add_custom_module "${moo}" + ego get "${moo}" + done + popd || die + + # clone dist repo (docs and misc) + EGIT_REPO_URI="https://github.com/caddyserver/dist.git" + EGIT_CHECKOUT_DIR="${WORKDIR}/dist-${PV}" + git-r3_src_unpack + + go-module_live_vendor + else + default + fi +} + +src_prepare() { + default + sed -i -e "s|User=caddy|User=http|g;s|Group=caddy|Group=http|g;" ../dist-*/init/*service || die + + if [[ "${PV}" != 9999* ]]; then + ln -sv ../vendor ./ || die + eapply ../go-mod-sum.patch + + for moo in ${MY_MODULES}; do + add_custom_module "${moo}" + done + fi +} + +src_compile() { + # https://github.com/caddyserver/caddy/blob/master/caddy.go#L843 + if [[ ${PV} == 9999* ]]; then + local CUSTOM_VER="git-$(git rev-parse --short HEAD)" + else + local CUSTOM_VER="${PV}" + fi + + ego build -ldflags "-X github.com/caddyserver/caddy/v2.CustomVersion=${CUSTOM_VER}" ./cmd/caddy + local sh + for sh in bash fish zsh; do + ./caddy completion "${sh}" > completion."${sh}" || die + done + ./caddy manpage -o manpages || die +} + +src_install() { + default + + dobin "${PN}" + insinto /etc/"${PN}" + doins ../dist-*/config/Caddyfile + systemd_dounit ../dist-*/init/*.service + newinitd "${FILESDIR}"/initd-2.7.5 "${PN}" + newconfd "${FILESDIR}"/confd-2.7.5 "${PN}" + insinto /etc/logrotate.d + newins "${FILESDIR}/logrotated" "${PN}" + insinto /usr/share/"${PN}" + doins ../dist-*/welcome/index.html + + newbashcomp completion.bash "${PN}" + newfishcomp completion.fish "${PN}".fish + newzshcomp completion.zsh _"${PN}" + newdoc ../dist-*/init/README.md systemd-services-README.md + doman manpages/* +} diff --git a/www-servers/caddy/caddy-9999.ebuild b/www-servers/caddy/caddy-9999.ebuild index c66b0a78cfe2..da0106f31184 100644 --- a/www-servers/caddy/caddy-9999.ebuild +++ b/www-servers/caddy/caddy-9999.ebuild @@ -13,15 +13,13 @@ if [[ "${PV}" == 9999* ]]; then EGIT_REPO_URI="https://github.com/caddyserver/caddy.git" else SRC_URI=" - https://github.com/caddyserver/caddy/archive/v${PV/_beta/-beta.}.tar.gz -> ${P}.tar.gz + https://github.com/caddyserver/caddy/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/caddyserver/dist/archive/refs/tags/v${PV/_beta/-beta.}.tar.gz -> ${P}-docs.tar.gz + https://github.com/caddyserver/dist/archive/refs/tags/v${PV}.tar.gz -> ${P}-docs.tar.gz " - [[ ${PV} != *beta* ]] && \ - KEYWORDS="~amd64 ~arm64 ~loong ~riscv" + KEYWORDS="~amd64 ~arm64 ~loong ~riscv" fi -S="${WORKDIR}/${PN}-${PV/_beta/-beta.}" # MAIN LICENSE="Apache-2.0" # deps |