PKGBUILDs/extra/python-setuptools/PKGBUILD
2016-04-20 00:41:20 +00:00

70 lines
2.2 KiB
Bash

# $Id$
# Maintainer: Angel Velasquez <angvp@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - revert to non-git sources, there's something wrong with building from that
pkgbase=python-setuptools
pkgname=('python-setuptools' 'python2-setuptools')
pkgver=20.9.0
pkgrel=1.1
epoch=1
pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages"
arch=('any')
license=('PSF')
url="http://pypi.python.org/pypi/setuptools"
makedepends=('python-packaging' 'python2-packaging')
checkdepends=('python-mock' 'python2-mock' 'python-pytest-runner' 'python2-pytest-runner' 'git')
source=("https://pypi.python.org/packages/source/s/setuptools/setuptools-$pkgver.tar.gz")
sha512sums=('b793b5c071748e955273eb24b51cd8c19323ab1252be1ef1e3ac4868498f3609a5938e2c93494f2a95255a78d3b6fd95f2f2c3831991fcc718f0924a88a2e9c2')
prepare() {
# We ship separated python{,2}-{packaging,six} packages.
rm -rv setuptools-$pkgver/pkg_resources/_vendor
cp -a setuptools-${pkgver}{,-py2}
cd "$srcdir"/setuptools-$pkgver
sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python3|" setuptools/command/easy_install.py
cd "$srcdir"/setuptools-$pkgver-py2
sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python2|" setuptools/command/easy_install.py
}
build() {
cd "$srcdir"/setuptools-$pkgver
python3 setup.py build
cd "$srcdir"/setuptools-$pkgver-py2
python2 setup.py build
}
check() {
# Workaround UTF-8 tests by setting LC_CTYPE
cd "$srcdir"/setuptools-$pkgver
LC_CTYPE=en_US.utf8 python3 setup.py ptr
cd "$srcdir"/setuptools-$pkgver-py2
LC_CTYPE=en_US.utf8 python2 setup.py ptr
}
package_python-setuptools() {
depends=('python-packaging')
provides=('python-distribute')
replaces=('python-distribute')
cd "$srcdir"/setuptools-$pkgver
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
}
package_python2-setuptools() {
depends=('python2-packaging')
provides=('python2-distribute' 'setuptools')
replaces=('python2-distribute' 'setuptools')
cd "$srcdir"/setuptools-$pkgver-py2
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
rm "$pkgdir"/usr/bin/easy_install
}