# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
setvar pkgname = 'py-pgen'
setvar pkgver = '2.7.10'
setvar _verbase = ${pkgver%.*}
setvar pkgrel = '0'
setvar pkgdesc = ""Python Parser Generator""
setvar url = ""http://www.python.org""
setvar arch = ""all""
setvar license = ""custom""
setvar makedepends = "$depends_dev"
setvar source = ""http://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz""

proc prepare {
	local i
	cd $_builddir
	for i in $source {
		case (i) {
		*.patch { msg $i; patch -p1 -i "$srcdir"/$i || return 1}
		}
	}
}

proc build {
	cd "$srcdir/Python-$pkgver"
        export OPT="$CFLAGS"
        ./configure \
                --build=$CBUILD \
                --host=$CHOST \
                --prefix=/usr \
                --enable-shared \
                --with-threads \
                --enable-ipv6 \
                --with-system-ffi \
                --with-system-expat \
                --with-system-zlib \
                --enable-unicode=ucs4 \
                || return 1
        make Parser/pgen || return 1
}

proc package {
	cd "$srcdir/Python-$pkgver"
	mkdir -p "$pkgdir"/usr/bin
	install -Dm755 Parser/pgen "$pkgdir"/usr/bin/pgen
}

setvar md5sums = ""c685ef0b8e9f27b5e3db5db12b268ac6  Python-2.7.10.tar.xz""
setvar sha256sums = ""1cd3730781b91caf0fa1c4d472dc29274186480161a150294c42ce9b5c5effc0  Python-2.7.10.tar.xz""
setvar sha512sums = ""67615a6defbcda062f15a09f9dd3b9441afd01a8cc3255e5bc45b925378a0ddc38d468b7701176f6cc153ec52a4f21671b433780d9bde343aa9b9c1b2ae29feb  Python-2.7.10.tar.xz""