summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7421a44a315fbf6b094e68c3884edce943489984 (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
# Maintainer: Star_caorui <Star_caorui@hotmail.com>
pkgname=caddy-dnspod
pkgver=2.6.2
pkgrel=1
pkgdesc="Caddy web server"
arch=('any')
url="https://github.com/caddyserver/caddy"
license=('Apache-2.0')
makedepends=('go' 'xcaddy')
provides=("caddy")
conflicts=("caddy")
source=(
  "Caddyfile"
  "caddy.service"
  "caddy.sysusers"
  "caddy.tmpfiles"
  "Caddyfile-example"
)
sha256sums=(
  "SKIP"
  "SKIP"
  "SKIP"
  "SKIP"
  "SKIP"
)

build() {
  xcaddy build v${pkgver} --with github.com/caddy-dns/dnspod
}

package() {
  # Install the executables
  install -d "$pkgdir"/usr/bin/
  install -m 755 caddy "$pkgdir"/usr/bin/

  # Basic configuration with example
  install -Dm 644 "${srcdir}/Caddyfile" "${pkgdir}/etc/caddy/Caddyfile"
  install -d "${pkgdir}/etc/caddy/conf.d"
  install -Dm 644 "${srcdir}/Caddyfile-example" -t "${pkgdir}/etc/caddy/conf.d"

  # Systemd service setup
  install -Dm 644 "${srcdir}/caddy.service" -t "${pkgdir}/usr/lib/systemd/system"
  install -Dm 644 "${srcdir}/caddy.sysusers" "${pkgdir}/usr/lib/sysusers.d/caddy.conf"
  install -Dm 644 "${srcdir}/caddy.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/caddy.conf"
}