SUMMARY="Console interface to Gerrit Code Review"
DESCRIPTION="Gertty is a console-based interface to the Gerrit Code Review \
system.

As compared to the web interface, the main advantages are:
* Workflow: the interface is designed to support a workflow similar to reading \
network news or mail. In particular, it is designed to deal with a large \
number of review requests across a large number of projects.
* Offline Use: Gertty syncs information about changes in subscribed projects \
to a local database and local git repos. All review operations are performed \
against that database and then synced back to Gerrit.
* Speed: user actions modify locally cached content and need not wait for \
server interaction.
* Convenience: because Gertty downloads all changes to local git repos, a \
single command instructs it to checkout a change into that repo for detailed \
examination or testing of larger changes."
HOMEPAGE="https://github.com/openstack/gertty"
COPYRIGHT="2014-2018 OpenStack Foundation, Hewlett-Packard Development Company, L.P."
LICENSE="Apache v2"
SOURCE_URI="https://files.pythonhosted.org/packages/67/b2/a19b590919cfc659b64e7dcd21ed8b7d3aa46844227e172c2ffe67d64413/gertty-$portVersion.tar.gz"
CHECKSUM_SHA256="290e4dc688b2f4d6886f0493b861c01a8c0419dd6c49a925fba0b936d3f28b23"
REVISION="2"
PATCHES="gertty-$portVersion.patchset"

ARCHITECTURES="any"

PROVIDES="
	gertty = $portVersion
	cmd:gertty = $portVersion
	"
REQUIRES="
	haiku
	cmd:python3
	dateutil_python3
	gitdb_python3
	gitpython_python3
	pbr_python3
	ply_python3
	pypandoc_python3
	six_python3
	smmap_python3
	sqlalchemy_python3
	"

BUILD_REQUIRES="
	haiku_devel
	"

PYTHON_PACKAGES=(python3)
PYTHON_VERSIONS=(3.7)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
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]}

		python=python$pythonVersion
		installLocation=$prefix/lib/$python/vendor-packages/
		export PYTHONPATH=$installLocation:$PYTHONPATH
		mkdir -p $installLocation
		rm -rf build
		$python setup.py build install \
			--root=/ --prefix=$prefix
	done
}

