Date: Monday, August 19, 2013 @ 11:53:32 Author: angvp Revision: 95996
archrelease: copy trunk to community-testing-any Added: python-cssutils/repos/community-testing-any/ python-cssutils/repos/community-testing-any/PKGBUILD (from rev 95995, python-cssutils/trunk/PKGBUILD) ----------+ PKGBUILD | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) Copied: python-cssutils/repos/community-testing-any/PKGBUILD (from rev 95995, python-cssutils/trunk/PKGBUILD) =================================================================== --- community-testing-any/PKGBUILD (rev 0) +++ community-testing-any/PKGBUILD 2013-08-19 09:53:32 UTC (rev 95996) @@ -0,0 +1,65 @@ +# $Id$ +# Maintainer: Giovanni Scafora <giova...@archlinux.org> +# Contributor: Simon Sapin <simon dot sapin at exyr dot org> +# Contributor: Michal Marek <reqamst at gmail dot com> +# Contributor: Rick W. Chena <stuffcor...@archlinux.us> +# Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com> + +pkgbase=python-cssutils +pkgname=('python2-cssutils' 'python-cssutils') +pkgver=0.9.10 +pkgrel=2 +pkgdesc="A CSS Cascading Style Sheets library for Python" +arch=('any') +url="http://cthedot.de/cssutils/" +license=('LGPL3') +makedepends=('python2-setuptools' 'python-setuptools') +source=("http://pypi.python.org/packages/source/c/cssutils/cssutils-${pkgver}.zip") +md5sums=('81b5c0294c54479a54548769eaa236f8') + +build() { + cd "${srcdir}" + + # Create python2 build dir + cp -a cssutils-${pkgver} cssutils-py2-${pkgver} +} + +package_python2-cssutils() { + depends=('python2') + + cd "${srcdir}/cssutils-py2-${pkgver}" + + python2 setup.py install --root="${pkgdir}/" --optimize=1 + + sed -i -e "s:#!/usr/bin/env python:#!/usr/bin/env python2:g" \ + $(find "${pkgdir}" -name '*.py') + + # Don't install tests (FS#27567) + rm -rf "${pkgdir}/usr/lib/python2.7/site-packages/tests" +} + +package_python-cssutils() { + depends=('python') + + cd "${srcdir}/cssutils-${pkgver}" + + python3 setup.py install --root="${pkgdir}/" --optimize=1 + + # Avoid a conflict: only keep the Py2 executables. + rm -rf "${pkgdir}/usr/bin" + + # Don't install tests (FS#27567) + rm -rf "${pkgdir}/usr/lib/python3.3/site-packages/tests" + + # Use #!/usr/bin/python3 + cd $pkgdir/usr/lib/python3.3/site-packages/cssutils + find . -maxdepth 2 -mindepth 1 -type f -iname '*.py' -exec sed -i 's/env python/python3/' '{}' \; + +} + +#check() { +# cd "${srcdir}/cssutils-${pkgver}" +# # Currently broken.. +## python3 setup.py test +## python2 setup.py test +#}