diff options
author | Repository mirror & CI <repomirrorci@gentoo.org> | 2025-01-01 02:03:17 +0000 |
---|---|---|
committer | Repository mirror & CI <repomirrorci@gentoo.org> | 2025-01-01 02:03:17 +0000 |
commit | 066a79f63d11c58f4775e6f6306550afc92723df (patch) | |
tree | ab8655d8bab605a665dfad0b0f669619effb0dbd | |
parent | 2025-01-01 00:18:33 UTC (diff) | |
parent | www-servers/caddy: add 2.9.0 (diff) | |
download | gentoo-066a79f63d11c58f4775e6f6306550afc92723df.tar.gz gentoo-066a79f63d11c58f4775e6f6306550afc92723df.tar.bz2 gentoo-066a79f63d11c58f4775e6f6306550afc92723df.zip |
Merge updates from master
-rw-r--r-- | www-servers/caddy/Manifest | 3 | ||||
-rw-r--r-- | www-servers/caddy/caddy-2.9.0.ebuild | 127 | ||||
-rw-r--r-- | www-servers/caddy/caddy-9999.ebuild | 4 |
3 files changed, 130 insertions, 4 deletions
diff --git a/www-servers/caddy/Manifest b/www-servers/caddy/Manifest index 093a34e468d7..6b66de814525 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.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 +DIST caddy-2.9.0-deps.tar.xz 10147016 BLAKE2B 3f33fa41cea04e47ef30f3eba5de7b88731154e1598fd37bc55cb63905a98c2c3ee1119a7b386b2c9f278465484c6d4d00dd8bc90962d472fe0acd559f8675fa SHA512 74124dcb80f87eff1d6834569ac3e8428d55b99044f6cac043f6e997e3b2de1e31089ab712c1b2f4fb0d64b6732291dd30316bfc92c6b9000bd2cda39b4d0a90 +DIST caddy-2.9.0-docs.tar.gz 24713 BLAKE2B c022672d818bf56160a561c307bc2526f0e0c6cc920286a744fc800273c9240e2852955c8c7035edad7591a168a177bf5c15822bbaee8704c4c3ca44bc44314d SHA512 f6f8a8d465373b4b2672bdf5a8124d3cedc90c8eea933f1494e6e6eab85ee788320a04c6ca7ccedac0ecbb8a335e0e179a8dd4ba07aeca685f297e525d21c368 +DIST caddy-2.9.0.tar.gz 700749 BLAKE2B 299e5bcda972af0b50d51c135a844221222fef91a1b38d9fda70113087f3587253c8c1d6efda1895a1b64a42444b4d95cd4a80822bc9af7979b55b93b3e6a492 SHA512 e2e7f38d11a69159ef347acb93779a35778267440d55a80b90da75739aabc95ee385fb9256eb79e25326d5e16cf831746d98dc03ccfe97e11d8d52f521154a68 diff --git a/www-servers/caddy/caddy-2.9.0.ebuild b/www-servers/caddy/caddy-2.9.0.ebuild new file mode 100644 index 000000000000..c5b4c02a8bcf --- /dev/null +++ b/www-servers/caddy/caddy-2.9.0.ebuild @@ -0,0 +1,127 @@ +# 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://dev.gentoo.org/~zmedico/dist/${PF}-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}" +) + +# 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 da0106f31184..15958c6dfe2c 100644 --- a/www-servers/caddy/caddy-9999.ebuild +++ b/www-servers/caddy/caddy-9999.ebuild @@ -38,10 +38,6 @@ 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) |