Commit 6865ddb0 authored by Michał Polański's avatar Michał Polański Committed by Leo

community/caddy: upgrade to 2.1.1

This version is incompatible with 1.x.x releases.
See https://caddyserver.com/docs/v2-upgrade for upgrade guide.

Caddy 1 is now packaged as community/caddy1.
parent e27d7a41
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=caddy
pkgver=2.1.1
pkgrel=0
pkgdesc="Fast, multi-platform web server with automatic HTTPS"
url="https://caddyserver.com/"
arch="all !mips !mips64" # limited by go
license="Apache-2.0"
depends="ca-certificates"
makedepends="go libcap"
subpackages="$pkgname-openrc"
pkgusers="$pkgname"
pkggroups="$pkgname"
install="$pkgname.pre-install"
source="$pkgname-$pkgver.tar.gz::https://github.com/caddyserver/caddy/archive/v$pkgver.tar.gz
$pkgname.initd
$pkgname.confd
Caddyfile"
export GOPATH="$srcdir"
build() {
go build -trimpath -ldflags="-s -w" -v -o bin/caddy ./cmd/caddy
}
check() {
go test ./...
}
package() {
install -Dm755 bin/caddy "$pkgdir"/usr/sbin/caddy
setcap cap_net_bind_service=+ep "$pkgdir"/usr/sbin/caddy
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
install -Dm644 "$srcdir"/Caddyfile "$pkgdir"/etc/$pkgname/Caddyfile
}
cleanup_srcdir() {
go clean -modcache
default_cleanup_srcdir
}
sha512sums="4359935f4267ada37e0ab2f3c3daeb30cb1853b03a11f988e0f25716ba385d90237d76334b66a66f914bc21b3b36bbc5112e572f17a9453a865c088013ad4ca6 caddy-2.1.1.tar.gz
970fb6e9bd1e58118b056a8932c09fe75bb4dadcad167e32acd3bc17d35682bc83b073093074b05ce3c1641efcceb3f65380a5e68976fb69667c70af17251c59 caddy.initd
c3f87910aa43633e406b1a575f1c98941077644fa5bc2378aa0d8b6cf182f4dca9555896f3ad04ccaae11d41590616ef64668eac8d980046e431e626bcf14d5e caddy.confd
d3110dd79f7d5e602a34d42569104dc97603994e42daf5f6b105303a3d034b52b91ef5fb156d5bf7b7a3a58ec0aeff58afc402618d0555af053771952a866f76 Caddyfile"
# Caddy's configuration file
# see: https://caddyserver.com/docs/caddyfile
# Configuration for /etc/init.d/caddy
caddy_opts="--config /etc/caddy/Caddyfile --adapter caddyfile"
#!/sbin/openrc-run
supervisor=supervise-daemon
name="Caddy web server"
description="Fast, multi-platform web server with automatic HTTPS"
description_checkconfig="Check configuration"
description_reload="Reload configuration without downtime"
command=/usr/sbin/caddy
command_args="run $caddy_opts"
command_user=caddy:caddy
extra_commands="checkconfig"
extra_started_commands="reload"
depend() {
need net localmount
after firewall
}
checkconfig() {
ebegin "Checking configuration for $name"
su ${command_user%:*} -s /bin/sh -c "$command validate $caddy_opts"
eend $?
}
reload() {
ebegin "Reloading $name"
su ${command_user%:*} -s /bin/sh -c "$command reload $caddy_opts"
eend $?
}
stop_pre() {
if [ "$RC_CMD" = restart ]; then
checkconfig || return $?
fi
}
#!/bin/sh
addgroup -S -g 82 www-data 2>/dev/null
addgroup -S caddy 2>/dev/null
adduser -S -D -h /var/lib/caddy -s /sbin/nologin -G caddy -g caddy caddy 2>/dev/null
adduser caddy www-data 2>/dev/null
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment