Date: Sunday, March 30, 2014 @ 16:23:23 Author: fyan Revision: 209242
archrelease: copy trunk to testing-any Added: python-setuptools/repos/testing-any/ python-setuptools/repos/testing-any/PKGBUILD (from rev 209241, python-setuptools/trunk/PKGBUILD) ----------+ PKGBUILD | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) Copied: python-setuptools/repos/testing-any/PKGBUILD (from rev 209241, python-setuptools/trunk/PKGBUILD) =================================================================== --- testing-any/PKGBUILD (rev 0) +++ testing-any/PKGBUILD 2014-03-30 14:23:23 UTC (rev 209242) @@ -0,0 +1,68 @@ +# $Id$ +# Maintainer: Angel Velasquez <an...@archlinux.org> +# Maintainer: Felix Yan <felixonm...@gmail.com> + +pkgbase=python-setuptools +pkgname=('python-setuptools' 'python2-setuptools') +pkgver=3.4 +pkgrel=1 +pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages" +arch=('any') +license=('PSF') +url="http://pypi.python.org/pypi/setuptools" +makedepends=('python' 'python2') +checkdepends=('python-pytest' 'python2-pytest') +source=("http://pypi.python.org/packages/source/s/setuptools/setuptools-${pkgver}.tar.gz") +md5sums=('30dd95909a50284a95e5241a9bad6e02') + +check() { + # Disabled tests for 3.4: https://bitbucket.org/pypa/setuptools/issue/180/34-release-fails-tests + # Check python3 module + cd "${srcdir}"/setuptools-${pkgver} + #python3 setup.py test -r 'unittest:TextTestRunner' + + # Check python2 module + cd "${srcdir}"/setuptools-${pkgver}-python2 + #python2 setup.py test -r 'unittest:TextTestRunner' +} + +prepare() { + cp -a setuptools-${pkgver}{,-python2} + + cd "${srcdir}"/setuptools-${pkgver} + sed -i -e "s|^#\!.*/usr/bin/python|#!/usr/bin/python3|" setuptools/tests/test_resources.py + sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python3|" setuptools/command/easy_install.py + + cd "${srcdir}"/setuptools-${pkgver}-python2 + sed -i -e "s|^#\!.*/usr/bin/python|#!/usr/bin/python2|" setuptools/tests/test_resources.py + sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python2|" setuptools/command/easy_install.py +} + +build() { + # Build python 3 module + cd "${srcdir}"/setuptools-${pkgver} + python3 setup.py build + + # Build python 2 module + cd "${srcdir}"/setuptools-${pkgver}-python2 + python2 setup.py build +} + +package_python-setuptools() { + depends=('python>=3.3') + 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>=2.7') + provides=('python2-distribute' 'setuptools') + replaces=('python2-distribute' 'setuptools') + + cd "${srcdir}/setuptools-${pkgver}-python2" + python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build + rm "${pkgdir}/usr/bin/easy_install" +}