summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a55a795e85b3e6a3f2f7d13c3dcfda7af7d33583 (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
# Maintainer: endlesseden
_pkgname=python-hybridspi
pkgname=$_pkgname-git
pkgver=0.1.1.31.r44.g903e6ac
pkgrel=1
pkgdesc="A Python implementation of Hybrid Radio SPI"
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://github.com/magicbadger/$_pkgname"
license=('GPL2')
groups=()
depends=('python')
checkdepends=()
optdepends=()
provides=("$_pkgname" "$pkgname")
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  printf "$(git describe --tags | sed 's|-|.|g' | sed 's/v//g' | sed 's|.g|\n|g' | head -1).r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/$_pkgname"
  if [ ! "$(cat setup.py | grep -c bin/dump_binary)" -gt 0 ]; then
     sed -i "s|dump_binary|bin/dump_binary|g" setup.py
  fi
}

build() {
	cd "$srcdir/$_pkgname"
    python setup.py build
}

package() {
	cd "$srcdir/$_pkgname"
	python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
	install -Dm644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}