74 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			74 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
 | 
						|
# Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
 | 
						|
# Contributor: Wei Congrui < crvv.mail at gmail dot com >
 | 
						|
# Contributor: Carl George < arch at cgtx dot us >
 | 
						|
# Contributor: Eric Engeström <eric at engestrom dot ch>
 | 
						|
# Contributor: Andreas Linz <klingt.net at gmail dot com>
 | 
						|
# Contributor: Akshay S Dinesh <asdofindia at gmail dot com>
 | 
						|
 | 
						|
pkgname=caddy
 | 
						|
pkgver=2.0.0
 | 
						|
_gitcommit=e051e119d1dff75972ed9b07cf97bbb989ba8daa
 | 
						|
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/caddy.conf')
 | 
						|
source=("git+https://github.com/caddyserver/caddy#commit=${_gitcommit}?signed"
 | 
						|
        index.html
 | 
						|
        caddy.service
 | 
						|
        caddy-api.service
 | 
						|
        caddy.tmpfiles
 | 
						|
        caddy.sysusers
 | 
						|
        caddy.conf)
 | 
						|
sha512sums=('SKIP'
 | 
						|
            '2abccd41f770daebf61285dc017249f20c707877ea3c870f4a2375bbbd2bf481a8652d1fd3c7afd7d6b5c54838e9d8474a33e2c9790ef67dcf9d79c4e52953b4'
 | 
						|
            '41e88f85972c5680c919b556f3f163e7908f5a6226b9c38bde0d7cfb32c62e2975fadaaa07534109c29dcdeceb5b696169dccaf8a1c132d578a327c6cf97b76d'
 | 
						|
            '9e990237a75618a727b68b849be6d88e000a97d0059512abfc030fc89dce2ddd94d9d1b41a374cb71c0feffa8e39c8d405385273d2c0961fb901640609d46a85'
 | 
						|
            '997e6e72bd02355f1139e2875eb190ed9e6fa8c1e72cea7824df764d1264e0925aeccb354cd939c1bf0c0803820a6f3d6c571fb89ce18491b9f4b196c3f5de06'
 | 
						|
            'c893d88fec89e37da6596030c8dce7103e7e575371e8542a24d2a0741e877358d85219f2d8ade9d6aa0f515efe1156a4badd9fef5f65f553a5b0c72330c4728f'
 | 
						|
            '399c177475e299bf5736dba1a9d045477072594390b73c7dd2e13e12785abe029d48e480aee98216f7a8735addd353ce4a07b56ed14364f641b138e4fca0ebcd')
 | 
						|
validpgpkeys=(
 | 
						|
  29D0817A67156E4F25DC24782A349DD577D586A5 # Matthew Holt <mholt@users.noreply.github.com>
 | 
						|
)
 | 
						|
 | 
						|
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"
 | 
						|
  sed 's|/etc/caddy/Caddyfile|/etc/caddy/caddy.conf|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"
 | 
						|
  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}/caddy.conf" "${pkgdir}/etc/caddy/caddy.conf"
 | 
						|
  install -d "${pkgdir}/etc/caddy/conf.d"
 | 
						|
  install -Dm 644 "${srcdir}/index.html" "${pkgdir}/usr/share/caddy/index.html"
 | 
						|
}
 |