# Contributor: Michał Polański # Maintainer: Michał Polański pkgname=caddy pkgver=2.2.1 pkgrel=1 pkgdesc="Fast, multi-platform web server with automatic HTTPS" url="https://caddyserver.com/" arch="all !mips !mips64" # limited by go arch="$arch !s390x" # Doesn't compile fully static caddy 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" export CGO_ENABLED=0 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="9d59bc87c923da61caa7b6be2e4a360dac859b17c24a46207924b44dab46498931eb64cc877ed9e32d0b70f6b62798c85db741b58f52379c73052e9e4bf8e38f caddy-2.2.1.tar.gz 970fb6e9bd1e58118b056a8932c09fe75bb4dadcad167e32acd3bc17d35682bc83b073093074b05ce3c1641efcceb3f65380a5e68976fb69667c70af17251c59 caddy.initd c3f87910aa43633e406b1a575f1c98941077644fa5bc2378aa0d8b6cf182f4dca9555896f3ad04ccaae11d41590616ef64668eac8d980046e431e626bcf14d5e caddy.confd d3110dd79f7d5e602a34d42569104dc97603994e42daf5f6b105303a3d034b52b91ef5fb156d5bf7b7a3a58ec0aeff58afc402618d0555af053771952a866f76 Caddyfile"