summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4acc96541be22e0435e43283d247c48c8d8bbb51 (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
pkgname=pb-git
pkgver=r311.529e8fc
pkgrel=1
pkgdesc="My attempt at a light pastebin"
arch=('any')
url="https://github.com/ptpb/pb"
license=('GPLv3')

depends=('python' 'python-werkzeug' 'python-flask-git' 'python-yaml'
         'python-requests' 'python-docutils' 'python-xdg'
         'python-pymongo' 'python-markdown' 'python-dateutil'
         'uwsgi' 'uwsgi-plugin-python'
         'python-click' 'python-pygments' 'python-pytz')

makedepends=('python-setuptools' 'git' 'graphicsmagick' 'npm')
#checkdepends=('tox' 'python-pytest' 'python-pytest-cov')

provides=('pb')
backup=('etc/xdg/pb/config.yaml' 'etc/uwsgi/pb.ini')

source=("$pkgname::git+https://github.com/ptpb/pb.git")
md5sums=('SKIP')

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

prepare() {
  cd $pkgname

  npm install
  npm install grunt-cli

  # npm and grunt are retarded pieces of shit
  (
    cd node_modules/pbs
    npm install
  )

  node_modules/grunt-cli/bin/grunt
}

build() {
  cd $pkgname

  python setup.py build
}

#check() {
#  cd $pkgname
#
#  tox
#}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --optimize=1

  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/$pkgname"
  install -D -m644 config.yaml.example "${pkgdir}/etc/xdg/pb/config.yaml"
  install -D -m644 pkg/pb.ini.example "${pkgdir}/etc/uwsgi/pb.ini"
  install -D -m644 pkg/pb.service "${pkgdir}/usr/lib/systemd/system/pb.service"
}