summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0a4e26326d1d042e61ce6bf6ee9afe52d5e9e554 (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
# Maintainer: George Raven <GeorgeRavenCommunity AT pm dot me>
pkgname=python-pimoroni-bme680-git
_pkgsrcname="bme680-python"
url="https://github.com/pimoroni/${_pkgsrcname}"

pkgver=v1.0.5.r14.91434ca
pkgrel=1
pkgdesc="Python library for the BME680 gas, temperature, humidity, and pressure sensor."
arch=('any')

_branch="master" # sets the branch desired to pull and swap to later on
license=('MIT') # MIT is a special case store a copy in /usr/share/pkgname
groups=()
depends=("python")
makedepends=("git")
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=

source=("${_pkgsrcname}::git+${url}#branch=${_branch}")
noextract=()
md5sums=('SKIP')

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

prepare() {
	cd "$srcdir/${_pkgsrcname}"
	git checkout ${_branch} # get off of makepkg branch
}

build() {
	cd "$srcdir/${_pkgsrcname}"
}

check() {
	cd "$srcdir/${_pkgsrcname}"
}

package() {
	cd "$srcdir/${_pkgsrcname}/library" # they store their setup.py here
	python3 setup.py install --prefix=/usr --root="$pkgdir/" --optimize=1
	cd "$srcdir/${_pkgsrcname}" # returning to standard location
	install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}