summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7f295abe656d30e7db78c93d29ee09cab9103ed0 (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
pkgname=receptor-git
_pkgname=receptor
pkgver=r149.6255f9f
provides=('synapse')
conflicts=('synapse')
pkgrel=1
pkgdesc='Web frontend for the synapse bittorrent client'
arch=('any')
url='https://git.sr.ht/~sircmpwn/receptor'
license=('BSD')
makedepends=('git' 'npm')
source=(git+https://git.sr.ht/~sircmpwn/receptor)
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$_pkgname"
  git submodule update --init --recursive
}

build() {
  cd "$_pkgname"
  npm install --cache "${srcdir}/npm-cache"
  npm run build:production
}

package() {
  cd "$srcdir"/"$_pkgname"
  _instdir="$pkgdir"/usr/share/webapps/"$_pkgname"
  mkdir -p "$_instdir" "$_instdir"/dist
  install -Dm 644 index.html "$_instdir"
  install -Dm 644 dist/* "$_instdir"/dist
}