APKBUILD 1.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
# 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"