# Maintainer: Kiyoshi Aman pkgname=python3 pkgver=3.4.2 _pkgver=3.4 pkgrel=0 pkgdesc="A high-level scripting language" url="http://www.python.org" arch="all" license="custom" subpackages="$pkgname-dev $pkgname-doc $pkgname-tests" depends="" makedepends="expat-dev openssl-dev zlib-dev ncurses-dev bzip2-dev sqlite-dev libffi-dev tcl-dev" source="http://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz posix_close.patch" _builddir="$srcdir"/Python-$pkgver prepare() { 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" ./configure \ --prefix=/usr \ --enable-shared \ --with-threads \ --with-system-ffi \ --enable-unicode=ucs4 \ --with-dbmliborder=ndbm \ --disable-rpath \ || return 1 make || return 1 } package() { cd "$_builddir" make -j1 DESTDIR="$pkgdir" install || return 1 mv "$pkgdir"/usr/bin/2to3 "$pkgdir"/usr/bin/2to3-3.3 install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE } _mv_files() { cd "$pkgdir"/usr/lib/python$_pkgver for i in */test */tests; do mkdir -p "$subpkgdir"/usr/lib/python$_pkgver/"$i" mv "$i"/* "$subpkgdir"/usr/lib/python$_pkgver/"$i" rm -rf "$i" done mv "$pkgdir"/usr/lib/python$_pkgver/test "$subpkgdir"/usr/lib/python$_pkgver } tests() { pkgdesc="The test modules from the main python package" arch="noarch" cd "$pkgdir" _mv_files } md5sums="36fc7327c02c6f12fa24fc9ba78039e3 Python-3.4.2.tar.xz 47be456068550c4239efbfa8866b5d6a posix_close.patch" sha256sums="1c6d9682d145c056537e477bbfa060ce727f9edd38df1827e0f970dcf04b2def Python-3.4.2.tar.xz c34c2959e06e71d61116595d337dfa7f3c468ea775004a4fc53acc400972afe5 posix_close.patch" sha512sums="12de5309cfaf91f5292efd660b5abe31581b902fdcc302317b597ffa74c9f5ec14ec1dd55994bcccd50d40473ae344ae19bf917ccfb8ab4906c8777d6ea95b17 Python-3.4.2.tar.xz a7f73fe2f114727999849cb8cecfd822025a129e57ae14ec0c1adc0ce6204c556467ea2d1008ce55745e692d2224f23774e1775316e3fdae812ac6c85e6780a2 posix_close.patch"