desktop/python-py-cpuinfo/PKGBUILD

55 lines
1.5 KiB
Bash

# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgbase=python-py-cpuinfo
pkgname=('python3-py-cpuinfo' 'python2-py-cpuinfo')
pkgver=3.3.0
_commit=894ff3fdbf67953b089e93597b0c361e50968170
pkgrel=1
arch=('any')
pkgdesc='Get CPU info with pure Python 2 & 3'
url='https://github.com/workhorsy/py-cpuinfo'
license=('MIT')
makedepends=('python3-setuptools' 'python2-setuptools')
checkdepends=('python3-pytest-runner' 'python2-pytest-runner')
source=("$pkgbase-$_commit.tar.gz::https://github.com/workhorsy/py-cpuinfo/archive/$_commit.tar.gz")
sha512sums=('b26ba68b1eb28e71c131b979672deeede95de9a8986aa8dc448002a7d0b2baa05264974102f01d258c0201d507c3bd7a3c683ef64add5271751808cf86b83bf3')
prepare() {
mv py-cpuinfo-{$_commit,$pkgver}
cp -a py-cpuinfo-$pkgver{,-py2}
}
build() {
cd "$srcdir"/py-cpuinfo-$pkgver
python3 setup.py build
cd "$srcdir"/py-cpuinfo-$pkgver-py2
python2 setup.py build
}
check() {
cd "$srcdir"/py-cpuinfo-$pkgver
python3 setup.py pytest
cd "$srcdir"/py-cpuinfo-$pkgver-py2
python2 setup.py pytest
}
package_python3-py-cpuinfo() {
depends=('python3')
cd py-cpuinfo-$pkgver
python3 setup.py install --root "$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-py-cpuinfo() {
depends=('python2')
cd py-cpuinfo-$pkgver-py2
python2 setup.py install --root "$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
mv "$pkgdir"/usr/bin/cpuinfo{,2}
}