summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b437c467a57e4829ceced19be20fe8bec829ad66 (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
# Maintainer: Alex Forencich <alex@alexforencich.com>
pkgname=python-hpgl-git
pkgver=0.1.0.r0.gc06e73b
pkgrel=1
pkgdesc="Python HPGL Parsing Library"
arch=('any')
url="https://github.com/alexforencich/python-hpgl"
license=('MIT')
depends=('python')
makedepends=('git')
provides=('python-hpgl')

_gitroot='https://github.com/alexforencich/python-hpgl.git'
_gitname='python-hpgl'

source=("$_gitname::git+$_gitroot")
md5sums=('SKIP')

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

build() {
  cd "$srcdir/$_gitname"
  sed -i "s/'hpgl2svg/'python-hpgl2svg/" setup.py
  sed -i "s/'hprtl2bmp/'python-hprtl2bmp/" setup.py
}

package() {
  cd "$srcdir/$_gitname"
  python setup.py install --prefix=/usr --root="$pkgdir/" --optimize=1
  cd "$pkgdir/usr/bin"
  ln -s python-hpgl2svg hpgl2svg
  ln -s python-hprtl2bmp hprtl2bmp
}