summaryrefslogtreecommitdiffhomepage
path: root/PKGBUILD
blob: 446a7ece69d884d17ecb9d33a77f3fad67c22a78 (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
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Maintainer: Steven Allen <steven@stebalien.com>

pkgname=stapler-git
pkgver=0.3.2.r16.g7c153e6
pkgrel=1
pkgdesc="Manipulate PDF documents from the command line"
url="http://github.com/hellerbarde/stapler"
arch=('any')
license=('BSD')
depends=('python2-pypdf2' 'python2-setuptools' 'python2-more-itertools')
makedepends=('git')
source=('git+https://github.com/hellerbarde/stapler.git')
md5sums=('SKIP')
_gitname="stapler"

pkgver() {
  cd "$srcdir/$_gitname"
  git describe --tags --always | sed -e 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$srcdir/$_gitname"
  sed -i '1s+python+python2+' stapler
  sed -i '1s+python+python2+' staplelib/tests.py
  sed -i '1s+python+python2+' staplelib/stapler.py
}

check() {
  cd "$srcdir/$_gitname"
  python2 setup.py test
}

package() {
  cd "$srcdir/$_gitname"
  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE $pkgdir/usr/share/licenses/stapler-git/LICENSE
  install -Dm644 README.rst $pkgdir/usr/share/doc/stapler-git/README
}