diff options
author | Rahil Bhimjiani <me@rahil.website> | 2023-12-08 09:30:37 +0530 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2023-12-10 14:54:31 -0800 |
commit | 99e38d1a15fe35a426eb8636735689b9b30ec9a9 (patch) | |
tree | 068458f2443f701480f8fa1aab3141d317188d7b /www-servers | |
parent | sys-devel/gcc: add 14.0.0_pre20231210 (diff) | |
download | gentoo-99e38d1a15fe35a426eb8636735689b9b30ec9a9.tar.gz gentoo-99e38d1a15fe35a426eb8636735689b9b30ec9a9.tar.bz2 gentoo-99e38d1a15fe35a426eb8636735689b9b30ec9a9.zip |
www-servers/caddy: add 2.7.6
1. remove pkg_postinst function as fcaps.eclass already exports it
Signed-off-by: Rahil Bhimjiani <me@rahil.website>
Closes: https://github.com/gentoo/gentoo/pull/34172
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.7.6.ebuild | 94 | ||||
-rw-r--r-- | www-servers/caddy/caddy-9999.ebuild | 8 |
3 files changed, 99 insertions, 6 deletions
diff --git a/www-servers/caddy/Manifest b/www-servers/caddy/Manifest index 2842321a2dc5..73698a62c2e7 100644 --- a/www-servers/caddy/Manifest +++ b/www-servers/caddy/Manifest @@ -4,3 +4,6 @@ DIST caddy-2.7.4.tar.gz 625647 BLAKE2B be4749a2298d2e00e2a24324ee31090847be9ec4d DIST caddy-2.7.5-deps.tar.xz 161234532 BLAKE2B 130e3fd75d7d2976ef27c2afe0cede8da957ad1c8db7b2140ef69a732cf25c6a04bde43c836832a0f7c14dbb4ab9cd48b496b8ea644da411181ba79b4116d892 SHA512 3dcc834e8cc9851f114d173a812de4b3a5256f8458f2d20ed0c66109d1ede1ee8e1d85053347a194818495cdfcaab2bf86d1b12f94fe2f917e22bf25b8d9c411 DIST caddy-2.7.5-docs.tar.gz 24578 BLAKE2B e08bfa37b157d8d4300198384bfc4c19cb0f539cc293311eaedcddffd4469026605c92f4388202db68beeadb2353666860daf3845ff5d69bb11afdb29eefe02b SHA512 635fdc1f2767cceacbddbbf56ba7207d558475c66ff9434a2b6edffd59d3711be0c6a4b4ffd2a6cf2eee53dcf22097c2b11eb44f0e9cc1d8455c1ea7c01bc498 DIST caddy-2.7.5.tar.gz 611282 BLAKE2B 86c28922f80f931452e81b0c3fa52ed0b86b2325eb2a1adf1de830a7a339772063955fd3cb5ee888cbf8c1c905b98bb6a292b592a2983012ad4fefe33c361e82 SHA512 45f6790b7c3683a8001445e932d5678fd27d204500f7301d92c4d8421f24574e113bf7c335bd277b16abe07eb3d24258358f87c68cee38905fa6d0e6bcc1c24c +DIST caddy-2.7.6-deps.tar.xz 128958740 BLAKE2B ffbe682df64a88dac9f50e9712f1d6697e58f2d9854c270321f7a0325f0b5ead7f93316756136a4435b70c5e08742c7130ce507ee4aa4696f4fb906f4eba8754 SHA512 f467144e235e09a7718cffe5ed3c40ec2d63038a6a948fe4f85d34717877af8a9959ef7e2c3ac32fd0cce522d693ccac883877f061f5cefc9512f7eed556b336 +DIST caddy-2.7.6-docs.tar.gz 24583 BLAKE2B d3dbbb701d86cbfaf538f10911fdd3613b8c3c0f49ef9e229487d2a4fcef9eff79b56e9852d5c1ccd5a8d1d1898861fc8183c343c129901562b03a9092af9e61 SHA512 62e534d41e714b47265fd8089ad9e03a1a89903460976d8af27fa5f71173e076bab8574282213595e495be701b769e1a70ff9e7ec9576fbf8e821e672207faa5 +DIST caddy-2.7.6.tar.gz 606077 BLAKE2B 1237edc164ec6095c9dff27c332925c4ce9d91a60e629770463bbffb1503b8b11e36033e852df3eb5bb69ffa448833b6ee2891dc0ba6dc9b43b6cce27d492179 SHA512 ef0cb6fd7f6f2a296290b4bb520300e043ad31cc612e734632ffa25cdaa23fd7d601ac4ceaa1c76285d54a07ee773360f795103ef3c2ec79516a4f18a5e844b5 diff --git a/www-servers/caddy/caddy-2.7.6.ebuild b/www-servers/caddy/caddy-2.7.6.ebuild new file mode 100644 index 000000000000..5657c0607730 --- /dev/null +++ b/www-servers/caddy/caddy-2.7.6.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2023 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" + SRC_URI+=" https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz" + SRC_URI+=" https://github.com/caddyserver/dist/archive/refs/tags/v${PV}.tar.gz -> ${P}-docs.tar.gz" + KEYWORDS="~amd64 ~arm64 ~loong ~riscv" +fi + +LICENSE="Apache-2.0" +LICENSE+=" BSD ECL-2.0 MIT CC0-1.0" +SLOT="0" +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 +) + +src_unpack() { + if [[ "${PV}" == 9999* ]]; then + # unpack code + git-r3_src_unpack + + # unpack 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 + go-module_src_unpack + fi +} + +src_prepare(){ + default + sed -i -e "s|User=caddy|User=http|g;s|Group=caddy|Group=http|g;" ../dist-"${PV}"/init/*service || die +} + +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-"${PV}"/config/Caddyfile + systemd_dounit ../dist-"${PV}"/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-"${PV}"/welcome/index.html + + newbashcomp completion.bash "${PN}" + newfishcomp completion.fish "${PN}".fish + newzshcomp completion.zsh _"${PN}" + newdoc ../dist-"${PV}"/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 4940f75d7169..5657c0607730 100644 --- a/www-servers/caddy/caddy-9999.ebuild +++ b/www-servers/caddy/caddy-9999.ebuild @@ -8,7 +8,7 @@ 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 +if [[ "${PV}" == 9999* ]]; then inherit git-r3 EGIT_REPO_URI="https://github.com/caddyserver/caddy.git" else @@ -36,7 +36,7 @@ PATCHES=( ) src_unpack() { - if [[ "${PV}" == *9999* ]]; then + if [[ "${PV}" == 9999* ]]; then # unpack code git-r3_src_unpack @@ -92,7 +92,3 @@ src_install() { newdoc ../dist-"${PV}"/init/README.md systemd-services-README.md doman manpages/* } - -pkg_postinst() { - fcaps_pkg_postinst -} |