SUMMARY="Interfaces for Python"
DESCRIPTION="
This package provides an implementation of 'object interfaces' for Python. \
Interfaces are a mechanism for labeling objects as conforming to a given \
API or contract. So, this package can be considered as implementation of the \
Design By Contract methodology support in Python.

For detailed documentation, please see http://docs.zope.org/zope.interface"
HOMEPAGE="http://pypi.python.org/pypi/zope.interface"
COPYRIGHT="2004-2014 Zope Foundation and Contributors"
LICENSE="ZPL 2.1"
REVISION="1"
SOURCE_URI="https://pypi.io/packages/source/z/zope.interface/zope.interface-$portVersion.tar.gz"
CHECKSUM_SHA256="8251f06a77985a2729a8bdbefbae79ee78567dddc3acbd499b87e705ca59fe24"
SOURCE_DIR="zope.interface-$portVersion"

ARCHITECTURES="all"

PROVIDES="
	$portName = $portVersion
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc
	"
PYTHON_PACKAGES=(python python3 python38 python39)
PYTHON_VERSIONS=(2.7 3.7 3.8 3.9)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
	${portName}_$pythonPackage = $portVersion\
	\"; \
REQUIRES_$pythonPackage=\"\
	haiku\n\
	cmd:python$pythonVersion\
	\""
BUILD_REQUIRES="$BUILD_REQUIRES
	setuptools_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
	cmd:python$pythonVersion"
done

INSTALL()
{
	for i in "${!PYTHON_PACKAGES[@]}"; do
		pythonPackage=${PYTHON_PACKAGES[i]}
		pythonVersion=${PYTHON_VERSIONS[$i]}

		# GENERIC: all python_setuptools-based installs need this
		python=python$pythonVersion
		pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
		installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
		export PYTHONPATH=$installLocation:$PYTHONPATH
		mkdir -p $installLocation
		rm -rf build
		$python setup.py build install \
			--root=/ --prefix=$prefix

		packageEntries  $pythonPackage \
			$prefix/lib/python*
	done
}
