# $Id: PKGBUILD 145771 2015-11-03 09:15:43Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=('python-zope-security' 'python2-zope-security')
pkgver=4.0.3
pkgrel=1
pkgdesc="Zope Security Framework"
arch=('i686' 'x86_64')
url="https://github.com/zopefoundation/zope.security"
license=('ZPL')
makedepends=('python-setuptools' 'python2-setuptools' 'python-zope-interface'
             'python2-zope-interface' 'python-zope-component' 'python2-zope-component'
             'python-zope-i18nmessageid' 'python2-zope-i18nmessageid' 'python-zope-location'
             'python2-zope-location' 'python-zope-proxy' 'python2-zope-proxy'
             'python-zope-schema' 'python2-zope-schema' 'git')
checkdepends=('python-nose' 'python2-nose' 'python-zope-configuration' 'python2-zope-configuration'
              'python-zope-testing' 'python2-zope-testing' 'python-zope-testrunner'
              'python2-zope-testrunner')
source=("git+https://github.com/zopefoundation/zope.security.git#tag=$pkgver")
sha256sums=('SKIP')

prepare() {
  cp -a zope.security{,-py2}
}

build() {
  cd "$srcdir/zope.security"
  python setup.py build

  cd "$srcdir/zope.security-py2"
  python2 setup.py build
}

check() {
  cd "$srcdir/zope.security"
  python setup.py test

  cd "$srcdir/zope.security-py2"
  python2 setup.py test
}

package_python-zope-security() {
  depends=('python-setuptools')

  cd "$srcdir/zope.security"
  python setup.py install --root="$pkgdir/" --optimize=1
}

package_python2-zope-security() {
  depends=('python2-setuptools')

  cd "$srcdir/zope.security-py2"
  python2 setup.py install --root="$pkgdir/" --optimize=1
}

# vim:set ts=2 sw=2 et:
