73 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			73 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.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'
 | 
						|
            '8a9cf23bbc3ea34a5b163804cba6d7485040cc68b562cab29383680aa8c885d85ad14fa516b581a7d16443a2debb5005f92c3f27a1b21a53f8063ed9636de822'
 | 
						|
            '1b55382e1a98ee3b26a092c0f5f7cd24c2e50dcac294c7c2eb764573eb2ae2a097ca93dbae0d7dacc4a2767539e11ea7a8143ad549f692044f87bb05e21d60a1'
 | 
						|
            '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"
 | 
						|
}
 | 
						|
 | 
						|
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"
 | 
						|
}
 |