# Contributor: Carlo Landmeter # Maintainer: Carlo Landmeter pkgname=caddy pkgver=0.10.12 pkgrel=0 pkgdesc="Fast, cross-platform HTTP/2 web server with automatic HTTPS" url="https://caddyserver.com/" arch="all !s390x" license="Apache-2.0" depends="ca-certificates" makedepends="go libcap bash" install="$pkgname.pre-install" pkgusers="$pkgname" pkggroups="$pkgname" source="$pkgname-$pkgver.tar.gz::https://github.com/mholt/$pkgname/archive/v$pkgver.tar.gz $pkgname.initd $pkgname.confd $pkgname.conf " builddir="$srcdir/src/github.com/mholt/$pkgname" prepare() { mkdir -p ${builddir%/*} mv "$srcdir"/$pkgname-$pkgver "$builddir"/ cd "$builddir" default_prepare } build() { cd "$builddir"/caddy export GOPATH="$srcdir" go build -v -o caddy -ldflags \ "-X github.com/mholt/caddy/caddy/caddymain.gitTag=$pkgver" } check() { "$builddir"/caddy/caddy -version > /dev/null } package() { cd "$builddir" install -Dm755 caddy/caddy "$pkgdir"/usr/sbin/caddy # caddy currently does not support dropping privileges so we # change attributes with setcat to allow access to priv ports # https://caddyserver.com/docs/faq setcap cap_net_bind_service=+ep \ "$pkgdir"/usr/sbin/caddy install -d -o caddy -g caddy \ "$pkgdir"/var/lib/caddy \ "$pkgdir"/etc/caddy \ "$pkgdir"/var/www install -Dm755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname install -Dm644 "$srcdir"/$pkgname.confd \ "$pkgdir"/etc/conf.d/$pkgname install -Dm644 "$srcdir"/$pkgname.conf \ "$pkgdir"/etc/$pkgname/$pkgname.conf } sha512sums="4764c69ea50aaa2019b53185ad0def88210c2fe0238cc6c6dec531a0c3cefa10c822639719cc87580dfc5399ddd58a10f9d025e9865eba308325929fa5341191 caddy-0.10.12.tar.gz 00fe095efd8d801f0c2c69832c7240858080407ea3696ca07f6b53d3304f7e2784566d8a6b447cb83d7dc4542db551f1b4fa48ff031da7e4a1d4a26e59fc05c5 caddy.initd 7808688e92ab9950403a9b8ad29777f5bd0f75aa8cccc1d49958bb1e5af1b972dfba0c6d31931354f702a3a13933d0a1b8f28b82eed263773d71b79ec95cc15c caddy.confd c24805d17234e6cf40fe1dd102c03f05cf6129d43f58f5567d540a0e4400ce89994820bb0e317f611c65459ae26bcf7110e23a8fecaae11ca78a561892b45d75 caddy.conf"