summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 658bac666e661e3891beb2bc48412801eea97df0 (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
# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=konnect
pkgver=0.30.0
_commit=b6b61ad87817f6eacea1223c062544f78812d792
pkgrel=1
pkgdesc='Konnect implements an OpenID provider (OP) with integrated web login and consent forms'
arch=('x86_64')
url="https://stash.kopano.io/projects/KC/repos/konnect"
license=('Apache')
depends=(glibc)
makedepends=('go-pie' 'git' 'yarn' 'scour' 'imagemagick')
backup=("etc/konnect/identifier-registration.yaml" "etc/konnect/scopes.yaml")
source=("git+https://github.com/Kopano-dev/konnect.git#tag=v${pkgver}?signed" konnect.sysusers)
validpgpkeys=('9DDB6CAD455D63112CAD26D8CA499C410B3C3354')
sha256sums=('SKIP'
            '29f9c23d317f769940537d186a30ca355e107d440047e516ff149d70b70b589f')

prepare() {
  cd $pkgname
  make vendor
}

build() {
  cd $pkgname

  go build \
    -mod=vendor \
    -trimpath \
    -ldflags "-extldflags $LDFLAGS" \
    -o $pkgname ./cmd/konnectd/

  make -C identifier
}

check() {
  cd $pkgname
  go test -mod=vendor ./...
}

package() {
  cd $pkgname
  install -Dm755 $pkgname "$pkgdir"/usr/bin/konnectd

  # sysusers files
  install -D -m 0644 "${srcdir}"/${pkgname}.sysusers "${pkgdir}"/usr/lib/sysusers.d/${pkgname}.conf

  # conf files
  install -d "$pkgdir"/etc/konnect
  install -Dm644 identifier-registration.yaml.in "$pkgdir"/etc/konnect/identifier-registration.yaml
  install -Dm644 scopes.yaml.in "$pkgdir"/etc/konnect/scopes.yaml

  # web application
  install -d ${pkgdir}/usr/share/webapps/${pkgname}/identifier-webapp
  cp -av identifier/build/* ${pkgdir}/usr/share/webapps/${pkgname}/identifier-webapp/
}