# Maintainer: Levente Polyak # Maintainer: Christian Rebischke # Contributor: Wei Congrui < crvv.mail at gmail dot com > # Contributor: Carl George < arch at cgtx dot us > # Contributor: Eric Engeström # Contributor: Andreas Linz # Contributor: Akshay S Dinesh pkgname=caddy pkgver=2.3.0 _gitcommit=b4989773ebb2dff21283ee50ec667f9138bdd292 pkgrel=1 pkgdesc='Fast web server with automatic HTTPS' url='https://caddyserver.com' arch=('x86_64') license=('Apache') depends=('glibc') makedepends=('go' 'git') backup=('etc/caddy/Caddyfile') source=("git+https://github.com/caddyserver/caddy#tag=${_gitcommit}?signed" index.html caddy.service caddy-api.service caddy.tmpfiles caddy.sysusers Caddyfile) sha512sums=('SKIP' '2abccd41f770daebf61285dc017249f20c707877ea3c870f4a2375bbbd2bf481a8652d1fd3c7afd7d6b5c54838e9d8474a33e2c9790ef67dcf9d79c4e52953b4' '6333b18707ed59283fc8e64870a7deb484042b4e32a005ee25a1d409b114fd6f55768e10af0d26f112edd16dd20ab579796441e82cf78d6bc9656296f69bff3e' '1b55382e1a98ee3b26a092c0f5f7cd24c2e50dcac294c7c2eb764573eb2ae2a097ca93dbae0d7dacc4a2767539e11ea7a8143ad549f692044f87bb05e21d60a1' '997e6e72bd02355f1139e2875eb190ed9e6fa8c1e72cea7824df764d1264e0925aeccb354cd939c1bf0c0803820a6f3d6c571fb89ce18491b9f4b196c3f5de06' 'c893d88fec89e37da6596030c8dce7103e7e575371e8542a24d2a0741e877358d85219f2d8ade9d6aa0f515efe1156a4badd9fef5f65f553a5b0c72330c4728f' '399c177475e299bf5736dba1a9d045477072594390b73c7dd2e13e12785abe029d48e480aee98216f7a8735addd353ce4a07b56ed14364f641b138e4fca0ebcd') validpgpkeys=( 29D0817A67156E4F25DC24782A349DD577D586A5 # Matthew Holt ) pkgver() { cd ${pkgname} git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { sed 's|/var/www/html|/srv/http|g' -i "${srcdir}/index.html" } build() { cd "${pkgname}/cmd/caddy/" export CGO_LDFLAGS="${LDFLAGS}" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" go build . } check() { cd "${pkgname}" go test ./... } package() { cd "${pkgname}" install -Dm 755 cmd/caddy/caddy -t "${pkgdir}/usr/bin" install -Dm 644 "${srcdir}/caddy.service" -t "${pkgdir}/usr/lib/systemd/system" install -Dm 644 "${srcdir}/caddy-api.service" -t "${pkgdir}/usr/lib/systemd/system" install -Dm 644 "${srcdir}/caddy.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/caddy.conf" install -Dm 644 "${srcdir}/caddy.sysusers" "${pkgdir}/usr/lib/sysusers.d/caddy.conf" install -Dm 644 "${srcdir}/Caddyfile" -t "${pkgdir}/etc/caddy" install -d "${pkgdir}/etc/caddy/conf.d" install -Dm 644 "${srcdir}/index.html" "${pkgdir}/usr/share/caddy/index.html" }