archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-mock / trunk / PKGBUILD
blobff8e529a37f521fcad045b4b543f256ed7df24c9
1 # Maintainer: jelle van der Waa <jelle@vdwaa.nl>
2 # Contributor: Felix Kaiser <felix.kaiser@fxkr.net>
4 pkgname=python-mock
5 pkgver=3.0.5
6 pkgrel=11
7 pkgdesc='Mocking and Patching Library for Testing'
8 url='http://www.voidspace.org.uk/python/mock/'
9 depends=('python' 'python-six' 'python-pbr')
10 license=('BSD')
11 arch=('any')
12 source=(mock-$pkgver.tar.gz::https://github.com/testing-cabal/mock/archive/$pkgver.tar.gz)
13 sha512sums=('9ab4f0c794f5701ba1367d982cf79a5662d4233753d12ed9c88ae20282db1f44be73f84c4d9f6d03ff64926b8c1b6d0c9a79b2a4724a3eb36c247ffd4ab03e2d')
15 prepare() {
16   cd "$srcdir/mock-$pkgver"
17   # use unittest instead of unittest2 as they are the same on recent python*
18   sed -i 's/unittest2/unittest/g' mock/tests/*.py
21 build() {
22   cd "$srcdir/mock-$pkgver"
23   python3 setup.py build
26 check() {
27   cd "$srcdir/mock-$pkgver"
28   echo 'python tests'
29   python -m unittest discover
32 package() {
33   cd "$srcdir/mock-$pkgver"
34   python3 setup.py install --optimize=1 --root="$pkgdir"
35   install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE