summaryrefslogtreecommitdiff
path: root/www-servers/caddy/caddy-9999.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-30 03:36:21 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-10-30 03:36:21 +0000
commite6a2fd03865862c81d79bd32249728f20ce99354 (patch)
treee2ba9ebe3405d7f7b4fb3528818e50ff0097a24c /www-servers/caddy/caddy-9999.ebuild
parent6769d991d1a040381ab263b2eef043e6f50190a6 (diff)
gentoo auto-resync : 30:10:2023 - 03:36:20
Diffstat (limited to 'www-servers/caddy/caddy-9999.ebuild')
-rw-r--r--www-servers/caddy/caddy-9999.ebuild28
1 files changed, 20 insertions, 8 deletions
diff --git a/www-servers/caddy/caddy-9999.ebuild b/www-servers/caddy/caddy-9999.ebuild
index e60c54e02eb3..4940f75d7169 100644
--- a/www-servers/caddy/caddy-9999.ebuild
+++ b/www-servers/caddy/caddy-9999.ebuild
@@ -13,12 +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}.tar.gz -> ${P}.tar.gz"
- SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz"
+ 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 BSD ECL-2.0 MIT CC0-1.0"
+LICENSE="Apache-2.0"
+LICENSE+=" BSD ECL-2.0 MIT CC0-1.0"
SLOT="0"
RESTRICT="test"
RDEPEND="
@@ -30,6 +31,10 @@ 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
@@ -48,12 +53,19 @@ src_unpack() {
src_prepare(){
default
- sed -i -e "s|User=caddy|User=http|g;" ../dist-"${PV}"/init/*service || die
- sed -i -e "s|Group=caddy|Group=http|g;" ../dist-"${PV}"/init/*service || die
+ sed -i -e "s|User=caddy|User=http|g;s|Group=caddy|Group=http|g;" ../dist-"${PV}"/init/*service || die
}
src_compile() {
- ego build ./cmd/caddy
+ # 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
@@ -65,10 +77,10 @@ src_install() {
dobin "${PN}"
insinto /etc/"${PN}"
- newins ../dist-"${PV}"/config/Caddyfile Caddyfile.example
+ doins ../dist-"${PV}"/config/Caddyfile
systemd_dounit ../dist-"${PV}"/init/*.service
- newinitd "${FILESDIR}/initd" "${PN}"
- newconfd "${FILESDIR}/confd" "${PN}"
+ 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}"