summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1bee678d994bacc15c0226c86b93e782f5bfbb9d (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=r120.a730ef1
provides=('synapse')
conflicts=('synapse')
pkgrel=1
pkgdesc='Web frontend for the synapse bittorrent client'
arch=('any')
url='https://github.com/SirCmpwn/receptor'
license=('BSD')
makedepends=('git' 'npm')
source=(git+https://github.com/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
}