void-packages/srcpkgs/python-chardet/template

59 lines
1.5 KiB
Plaintext
Raw Normal View History

# Template file for 'python-chardet'
pkgname=python-chardet
version=2.2.1
revision=1
noarch=yes
wrksrc="${pkgname#*-}-${version}"
build_style="python-module"
python_versions="2.7 3.4"
hostmakedepends="python-setuptools python3.4-setuptools"
makedepends="python-devel python3.4-devel"
depends="python"
pycompile_module="chardet"
short_desc="Universal encoding detector for Python 2 and 3 (Python2)"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://github.com/chardet/chardet"
license="LGPL-2.1"
distfiles="https://pypi.python.org/packages/source/c/${pkgname#*-}/${pkgname#*-}-${version}.tar.gz"
checksum=f1964f73f5ee9b7e0309098b9512d587fbba6dd5d1f3797b1c95529e5241bf09
post_extract() {
cp -a ${wrksrc} /tmp/python2.7-build
cp -a ${wrksrc} /tmp/python3.4-build
mv /tmp/python{2.7,3.4}-build ${wrksrc}
}
pre_build() {
cd ${wrksrc}/python3.4-build
sed -i 's,chardetect ,chardetect3 ,' setup.py
sed -i 's,#!/usr/bin/env python,&3.4,' chardet/chardetect.py
}
do_build() {
cd ${wrksrc}/python2.7-build
python setup.py build
cd ${wrksrc}/python3.4-build
python3.4 setup.py build
}
do_install() {
cd ${wrksrc}/python2.7-build
python setup.py install --root=${DESTDIR}
cd ${wrksrc}/python3.4-build
python3.4 setup.py install --root=${DESTDIR}
}
python3.4-chardet_package() {
noarch=yes
depends="python3.4"
pycompile_version="3.4"
pycompile_module="chardet"
short_desc="${short_desc/Python2/Python3.4}"
pkg_install() {
vmove usr/bin/chardetect3
vmove usr/lib/python3.4
}
}