blob: b01b801200631abc37abbd2a2db83751d290cf06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# Maintainer: Wei Congrui < crvv.mail at gmail dot com >
# Maintainer: 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>
_gopkgname='github.com/mholt/caddy'
pkgname=caddy
pkgver=0.10.10
pkgrel=3
pkgdesc='HTTP/2 Web Server with Automatic HTTPS'
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url='https://caddyserver.com'
license=('Apache')
backup=('etc/caddy/caddy.conf')
install='caddy.install'
makedepends=('go>=1.8.1' 'git')
source=("https://$_gopkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
'https://caddyserver.com/resources/images/brand/caddy-at-your-service-white.svg'
'index.html'
'caddy.service'
'caddy.tmpfiles'
'caddy.conf'
'plugins.go')
sha256sums=('aafaeb092e7b1bcff8ec31f19a1ded1253ff95cfdd4441378e5a530508614e8d'
'e679dd79fd92dc351fc190c7af529c73e3896986aaa6b7c0ae01e561398d6b85'
'6db7aec45e95bbbf770ce4d120a60d8e4992d2262a8ebf668521179279aa5ae7'
'0466a41290db84402ca41cf32c0fc5b66b112a9d85b71d1619ae97b5a3dd2740'
'c8f002f5ba59985a643600dc3c871e18e110903aa945ef3f2da7c9edd39fbd7a'
'80520b80ccabf077a3269f6a1bf55faa3811ef5adce115131b35ef2044d37b64'
'f5a0fbb961e7c9ecf99e88d0959a3164cbea54660c1c08c3ba3cdf1d45563929')
patch_plugins() {
IFS=''
n=0
while read -r line; do
echo "$line"
if [[ $n = 0 && $line =~ ^import ]]; then
go run $srcdir/plugins.go "${plugins[@]}"
n=1
fi
done
}
prepare() {
export GOPATH="$srcdir/build"
rm -rf "$GOPATH/src/$gopkgname"
mkdir --parents `dirname "$GOPATH/src/$_gopkgname"`
mv -Tv "$srcdir/$pkgname-$pkgver" "$GOPATH/src/$_gopkgname"
if [ ${#plugins[@]} -gt 0 ]; then
echo enabled plugins: ${plugins[@]}
cd $GOPATH/src/$_gopkgname/caddy/caddymain/
patch_plugins < run.go > run1.go
mv run1.go run.go
go get -v -d $_gopkgname/caddy/caddymain
fi
}
build() {
export GOPATH="$srcdir/build"
go build -v -o $srcdir/caddy -ldflags "-X $_gopkgname/caddy/caddymain.gitTag=v$pkgver" $_gopkgname/caddy
}
package() {
install -D -m 0755 caddy "$pkgdir/usr/bin/caddy"
install -D -m 0644 caddy-at-your-service-white.svg "$pkgdir/usr/share/caddy/caddy-at-your-service-white.svg"
install -D -m 0644 index.html "$pkgdir/usr/share/caddy/index.html"
install -D -m 0644 caddy.service "$pkgdir/usr/lib/systemd/system/caddy.service"
install -D -m 0644 caddy.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/caddy.conf"
install -D -m 0644 caddy.conf "$pkgdir/etc/caddy/caddy.conf"
install -d -m 0755 "$pkgdir/etc/caddy/caddy.conf.d"
}
plugins=(
# 'dns'
# 'hook.service'
# 'http.authz'
# 'http.awses'
# 'http.awslambda'
# 'http.cache'
# 'http.cgi'
# 'http.cors'
# 'http.datadog'
# 'http.expires'
# 'http.filemanager'
# 'http.filter'
# 'http.forwardproxy'
# 'http.git'
# 'http.gopkg'
# 'http.grpc'
# 'http.hugo'
# 'http.ipfilter'
# 'http.jekyll'
# 'http.jwt'
# 'http.login'
# 'http.mailout'
# 'http.minify'
# 'http.nobots'
# 'http.prometheus'
# 'http.proxyprotocol'
# 'http.ratelimit'
# 'http.realip'
# 'http.reauth'
# 'http.restic'
# 'http.upload'
# 'http.webdav'
# 'net'
# 'tls.dns.cloudflare'
# 'tls.dns.digitalocean'
# 'tls.dns.dnsimple'
# 'tls.dns.dnspod'
# 'tls.dns.dyn'
# 'tls.dns.exoscale'
# 'tls.dns.gandi'
# 'tls.dns.googlecloud'
# 'tls.dns.linode'
# 'tls.dns.namecheap'
# 'tls.dns.ovh'
# 'tls.dns.rackspace'
# 'tls.dns.rfc2136'
# 'tls.dns.route53'
# 'tls.dns.vultr'
)
|