summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6523d91438fb1a51c061281835104e4e3ce320c9 (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
# Maintainer: Maxim Andersson <thesilentboatman@gmail.com>

pkgname=haste-server-git
_gitname=haste-server
pkgver=r298.8da37ea
pkgrel=1
pkgdesc="Prettiest, easiest to use pastebin ever made"
arch=('any')
url="https://github.com/seejohnrun/haste-server"
license=('MIT')
depends=('nodejs')
makedepends=('git' 'npm')
provides=('haste-server')
conflicts=('haste-server')
options=(!emptydirs)
source=('git://github.com/seejohnrun/haste-server.git')
sha256sums=('SKIP')

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

prepare() {
  cd "${srcdir}/${_gitname}"

  # Adding missing files to package.json
  sed -i '42i "config.js","about.md",' package.json

  # Changing defaut storage to file
  sed -i '36,40c "path": "./data","type": "file"' config.js

  # Unable to run haste from /usr/bin, so removing it
  sed -i '36,38d' package.json

  # Fix error with npm5 issue
  npm pack
}

package() {
  cd "${srcdir}/${_gitname}"

  install -Dm644 "../../${_gitname}.service" -t "${pkgdir}/usr/lib/systemd/system"
  npm install --cache ../cache --user root -g --prefix "${pkgdir}/usr" *.tgz
}

# vim:set ts=2 sw=2 et: