# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=py-webcolors _pkgname=webcolors pkgver=1.5 pkgrel=0 pkgdesc="A library for working with color names and color value formats" url="https://github.com/ubernostrum/webcolors" arch="noarch" license="BSD" makedepends="python2-dev python3-dev py-setuptools" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" builddir="$srcdir"/$_pkgname-$pkgver prepare() { local i cd "$builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$builddir" python2 setup.py build || return 1 python3 setup.py build || return 1 } package() { mkdir -p "$pkgdir" } _py2() { replaces="$pkgname" _py python2 } _py3() { _py python3 } _py() { local python="$1" pkgdesc="$pkgdesc (for $python)" depends="$depends $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } md5sums="2e9da1bbb7a087c6108e05be64640afb webcolors-1.5.tar.gz" sha256sums="b3b1c3a41e9c69d1982b76b6531239115519f91cc034a24e975749832dc51b8e webcolors-1.5.tar.gz" sha512sums="84ce8cbbbdb4523bb146cf379845b549570623411a56651a7f9b9687152b7adc9dc42a3a0f684b55b61fb7a3d51d49d3871100b56725c86a727e3374b53c84b6 webcolors-1.5.tar.gz"