summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4d6ae825a82df06fb9aa76079ef3db976682182e (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
# Maintainer: Antonin Décimo <antonin dot decimo at gmail dot com>
# shellcheck disable=SC2034,SC2154,SC2164
pkgname=galene
pkgver=1.2
pkgrel=1
pkgdesc="A videoconferencing server"
arch=('x86_64')
url='https://galene.org'
license=('MIT')
install='galene.install'
depends=('go')
makedepends=('git')
optdepends=('galene-file-transfer: transfer large files without a browser'
            'galene-stt: real-time speech-to-text')
source=("https://github.com/jech/$pkgname/archive/$pkgname-$pkgver.tar.gz"
        'galene.service'
        'galene.sysusers'
        'galene.tmpfiles')
sha256sums=('34de09188f0ff80228310ba7a62eab9afed79620ee96eeed0602d10ca5c0027b'
            'a4f1d12c230d305124da4045f85c8c496f12f5202d9d82a6b560b1cfe0355ca0'
            'a1b933ff4034cce2da2607e81df547acd7efa6f4236c18fec144047f50361f84'
            '85680da8ab202280b92b6dd32e920906570fb8070db06b2ef0275462d0f5a16d')

prepare() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"
  mkdir -p _build
}

build() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"
  export CGO_ENABLED=0
  go build \
     -trimpath \
     -buildmode=pie \
     -mod=readonly \
     -modcacherw \
     -ldflags "-s -w" \
     -o _build \
     ./...
}

check() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"
  # go test ./...
  _build/galene -help >/dev/null
}

package() {
  cd "$srcdir"
  install -Dm644 galene.service "$pkgdir/usr/lib/systemd/system/galene.service"
  install -Dm644 galene.sysusers "$pkgdir/usr/lib/sysusers.d/galene.conf"
  install -Dm644 galene.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/galene.conf"

  cd "$pkgname-$pkgname-$pkgver"

  install -dm755 "${pkgdir}/usr/bin"
  install -m755 "_build/galene" "${pkgdir}/usr/bin"
  install -m755 "_build/galenectl" "${pkgdir}/usr/bin"

  install -dm755 "$pkgdir/usr/share/galene"
  cp -r static "$pkgdir/usr/share/galene"

  local doc="$pkgdir/usr/share/doc/galene"
  install -dm755 "$doc"
  install -Dm644 README.md galene-api.md galene-client.md galene-install.md \
                 galene-protocol.md \
                 "$doc"

  install -Dm644 LICENCE "$pkgdir/usr/share/licenses/$pkgname/LICENCE"
}