# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-telnetsrv
_pkgname=telnetsrv
pkgver=0.4
pkgrel=0
pkgdesc="A Python Telnet server handler library"
url="https://github.com/ianepperson/telnetsrvlib"
arch="noarch"
license="LGPL+"
depends="python2 py-gevent py-paramiko"
depends_dev=""
makedepends="python2-dev py-setuptools"
install=""
subpackages=""
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"

_builddir="$srcdir"/$_pkgname-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	python2 setup.py build || return 1
}

package() {
	cd "$_builddir"
	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
}

md5sums="eb59ce5a765c4f9acb85f60342ae0be9  telnetsrv-0.4.tar.gz"
sha256sums="195fa7acdeba7bb46a1a320c0afd66e23b5d7ab8810393468a05936113d84799  telnetsrv-0.4.tar.gz"
sha512sums="75c69378fecc5f344560d05f2195d9832add03c53a2955b95b030e2f72da3351cc9712fedd08ae576f2e175f8a887f3bc3f67155760fdc2749cb270cef5d4fba  telnetsrv-0.4.tar.gz"
