summaryrefslogtreecommitdiff
path: root/community/python-cchardet/PKGBUILD
blob: 9c9267c9113019255a23a0d7f4cd3f8750c48cd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# $Id: PKGBUILD 96112 2013-08-20 06:32:47Z lcarlier $
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>

pkgname=python-cchardet
pkgname=(python-cchardet python2-cchardet)
pkgver=0.3.5
pkgrel=1
pkgdesc="Universal encoding detector faster than chardet."
url="http://pypi.python.org/pypi/cchardet/"
makedepends=('cython' 'cython2' 'python-setuptools' 'python2-setuptools')
license=('MIT')
arch=('i686' 'x86_64')
source=(http://pypi.python.org/packages/source/c/cchardet/cchardet-$pkgver.tar.gz)
sha256sums=('51094c573d248a4908a968e75edd05bab136f10fcc8a70b87c8243b6d45731f8')

build() {
    cd "$srcdir/cchardet-$pkgver"

    rm -rf ../buildpy3; mkdir ../buildpy3
    python setup.py build -b ../buildpy3

    rm -rf ../buildpy2; mkdir ../buildpy2
    python2 setup.py build -b ../buildpy2
    find ../buildpy2 -name \*.py -exec sed -r 's|^#!(.*)python$|#!\1python2|' -i {} +
}

package() {
    cd "$srcdir/cchardet-$pkgver"
    python setup.py install --root="$pkgdir"
	install -m0644 -D "README.rst" "$pkgdir/usr/share/licenses/$pkgname/README.rst"
}

package_python-cchardet() {
    depends=(python)


    cd "$srcdir/cchardet-$pkgver"
    rm -rf build; ln -s ../buildpy3 build
    python setup.py install --skip-build -O1 --root="$pkgdir"
	install -m0644 -D "README.rst" "$pkgdir/usr/share/licenses/$pkgname/README.rst"
}

package_python2-cchardet() {
    depends=(python2)

    cd "$srcdir/cchardet-$pkgver"
    rm -rf build; ln -s ../buildpy2 build
    python2 setup.py install --skip-build -O1 --root="$pkgdir"
	install -m0644 -D "README.rst" "$pkgdir/usr/share/licenses/$pkgname/README.rst"
}