PKGBUILDs/extra/python-setuptools/PKGBUILD
2016-04-26 12:39:46 +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.10.1
pkgrel=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/d3/16/21cf5dc6974280197e42d57bf7d372380562ec69aef9bb796b5e2dbbed6e/setuptools-20.10.1.tar.gz")
sha512sums=('12fb2694dfa549cf6b43cc34449247e476c0df92f23495bcd1e1f9cc4a0a20759169f3cbab0940803936be0cef0babd60cf74ef884359adfb116d22ea16d334c')
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
}