Commit 430baceb authored by Jakub Jirutka's avatar Jakub Jirutka
Browse files

community/caddy: improve abuild, fix mixed tabs & spaces etc.

parent f7ff9adb
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=caddy
# when updating pkgver dont forget to run glide_init
# When updating pkgver don't forget to run glide_init.
pkgver=0.9.0
pkgrel=0
pkgdesc="Fast, cross-platform HTTP/2 web server with automatic HTTPS"
......@@ -9,10 +9,8 @@ url="https://caddyserver.com/"
arch="all"
license="ASL 2.0"
depends="ca-certificates"
depends_dev=""
makedepends="$depends_dev go libcap bash glide"
makedepends="go libcap bash glide"
install="$pkgname.pre-install"
subpackages=""
pkgusers="$pkgname"
pkggroups="$pkgname"
source="$pkgname-$pkgver.tar.gz::https://github.com/mholt/caddy/archive/v${pkgver}.tar.gz
......@@ -22,46 +20,57 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/mholt/caddy/archive/v${pkgve
glide.yaml
glide.lock
"
builddir="$srcdir"/caddy-$pkgver
builddir="$srcdir/caddy-$pkgver"
build() {
export GOPATH="$startdir"
cd "$builddir" || return 1
cp "$srcdir"/glide.yaml "$srcdir"/glide.lock .
glide install --skip-test || return 1
go fix || return 1
cd caddy
./build.bash || return 1
cd "$builddir" || return 1
cp "$srcdir"/glide.yaml "$srcdir"/glide.lock .
glide install --skip-test || return 1
go fix || return 1
cd caddy && ./build.bash || return 1
}
package() {
cd "$builddir"
install -Dm755 caddy/caddy "$pkgdir"/usr/sbin/caddy || return 1
# 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 || return 1
install -d -o caddy -g caddy $pkgdir/var/lib/caddy \
$pkgdir/etc/caddy $pkgdir/var/www || return 1
install -Dm755 $srcdir/$pkgname.initd \
$pkgdir/etc/init.d/$pkgname || return 1
install -Dm644 $srcdir/$pkgname.confd \
$pkgdir/etc/conf.d/$pkgname || return 1
install -Dm644 $srcdir/$pkgname.conf \
$pkgdir/etc/$pkgname/$pkgname.conf || return 1
install -d -o caddy -g caddy \
"$pkgdir"/var/lib/caddy \
"$pkgdir"/etc/caddy \
"$pkgdir"/var/www || return 1
install -Dm755 "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/$pkgname || return 1
install -Dm644 "$srcdir"/$pkgname.confd \
"$pkgdir"/etc/conf.d/$pkgname || return 1
install -Dm644 "$srcdir"/$pkgname.conf \
"$pkgdir"/etc/$pkgname/$pkgname.conf || return 1
}
glide_init() {
echo $startdir
export GOPATH="$startdir"
echo "GOPATH=$startdir"
abuild clean deps unpack prepare
cd $builddir
cd "$builddir"
rm -f glide.yaml glide.lock
glide init --non-interactive || return 1
glide update || return 1
cp glide.yaml glide.lock $startdir
cd $startdir && abuild checksum clean
cp glide.yaml glide.lock "$startdir"
cd "$startdir" && abuild checksum clean
}
md5sums="793baba3bb1b524916f1a566554e4b2a caddy-0.9.0.tar.gz
......
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