summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dc70abee502c5923eb82b8f844fc0b800102134e (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
_npmname=vinefeed
pkgname="nodejs-$_npmname"
pkgver=0.1.0
pkgrel=2
pkgdesc="RSS/Atom feed generator for Vine users"
arch=(any)
url="http://github.com/tremby/vinefeed"
license=('GPL')
depends=('nodejs' 'npm')
optdepends=()
source=("$_npmname".{service,socket}
        'binary.patch'
        'socket-activation.patch')
md5sums=('e91569a2035064f52e321653ba26172e'
         '0de7e38748a53ec8d96c2dd645e8bb2e'
         '8b8cd5d387347f3632a80827b161bd76'
         '8f4df9f6102f3078bebe89213320492a')

makedepends+=('git')
source+=("${_gitname:=${pkgname%-git}}::${_giturl:-git+$url}")
md5sums+=('SKIP')
provides+=("$_gitname=$pkgver")
conflicts+=("$_gitname")

prepare() {
  cd "$_gitname"
  patch -p1 -i ../binary.patch
  patch -F3 -p1 -i ../socket-activation.patch
}

pkgver() {
  cd "$_gitname"
  grep -Po '(?<="version": ").*(?=")' package.json | tr '\n' '.'
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  install -Dt "$pkgdir/usr/lib/systemd/user/" "$_npmname".{service,socket}

  cd "$_gitname"
  npm install -g --prefix "$pkgdir/usr" --production
  rmdir "$pkgdir/usr/etc"
}