2014-04-12 05:39:24 +08:00
|
|
|
# Maintainer: UtG <utg[dot]chakra.linux[at]gmail[dot]com>
|
2011-08-26 06:53:14 +08:00
|
|
|
# Contributor: Giuseppe Calà <jiveaxe@gmail.com>
|
|
|
|
|
2014-04-12 05:39:24 +08:00
|
|
|
_pypiname=pycurl
|
|
|
|
pkgbase=python-$_pypiname
|
|
|
|
pkgname=('python3-pycurl' 'python2-pycurl')
|
2016-03-17 05:36:13 +08:00
|
|
|
pkgver=7.43.0
|
2011-08-26 06:53:14 +08:00
|
|
|
pkgrel=1
|
2014-04-12 05:39:24 +08:00
|
|
|
arch=('x86_64')
|
2011-08-26 06:53:14 +08:00
|
|
|
url="http://pycurl.sourceforge.net"
|
2014-04-12 05:39:24 +08:00
|
|
|
license=('LGPL' 'MIT')
|
2016-03-17 05:36:13 +08:00
|
|
|
makedepends=('python3' 'python2' 'curl' 'git')
|
2014-04-12 05:39:24 +08:00
|
|
|
source=("git+https://github.com/pycurl/pycurl.git#tag=REL_${pkgver//./_}")
|
|
|
|
sha1sums=('SKIP')
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cp -r ${_pypiname} python2-${_pypiname}
|
|
|
|
|
|
|
|
cd "${srcdir}/${_pypiname}"
|
|
|
|
find . -name '*.py' -exec sed -i -e "s|#! /usr/bin/env python|#!/usr/bin/env python3|" {} +
|
|
|
|
sed -i 's/"share", "doc", PACKAGE/"share", "doc", "python3-pycurl"/' setup.py
|
2014-09-07 02:06:09 +08:00
|
|
|
sed -i "s/nosetests/nosetests3/" Makefile
|
2014-04-12 05:39:24 +08:00
|
|
|
|
|
|
|
cd "${srcdir}/python2-${_pypiname}"
|
|
|
|
find . -name '*.py' -exec sed -i -e "s|#! /usr/bin/env python|#!/usr/bin/env python2|" {} +
|
|
|
|
sed -i 's/"share", "doc", PACKAGE/"share", "doc", "python2-pycurl"/' setup.py
|
2014-09-07 02:06:09 +08:00
|
|
|
sed -i "s/nosetests/nosetests2/" Makefile
|
2014-04-12 05:39:24 +08:00
|
|
|
}
|
|
|
|
|
2011-08-26 06:53:14 +08:00
|
|
|
build() {
|
2014-04-12 05:39:24 +08:00
|
|
|
cd "${srcdir}/${_pypiname}"
|
2014-09-07 02:06:09 +08:00
|
|
|
make
|
2014-04-12 05:39:24 +08:00
|
|
|
python3 setup.py build --with-ssl
|
|
|
|
|
|
|
|
cd "${srcdir}/python2-${_pypiname}"
|
2014-09-07 02:06:09 +08:00
|
|
|
make
|
2014-04-12 05:39:24 +08:00
|
|
|
python2 setup.py build --with-ssl
|
2011-08-26 06:53:14 +08:00
|
|
|
}
|
2014-04-12 05:39:24 +08:00
|
|
|
|
2014-09-07 02:06:09 +08:00
|
|
|
check() {
|
|
|
|
export PYCURL_VSFTPD_PATH=vsftpd
|
|
|
|
|
|
|
|
cd "$srcdir/$_pypiname"
|
|
|
|
PYTHONPATH="$PWD/build/lib.linux-$CARCH-3.4:$PYTHONPATH" make test || warning "Tests failed"
|
|
|
|
|
|
|
|
cd "${srcdir}/python2-${_pypiname}"
|
|
|
|
PYTHONPATH="$PWD/build/lib.linux-$CARCH-2.7:$PYTHONPATH" make test || warning "Tests failed"
|
|
|
|
}
|
|
|
|
|
2014-04-12 05:39:24 +08:00
|
|
|
package_python3-pycurl() {
|
|
|
|
pkgdesc="A Python 3.x interface to libcurl"
|
|
|
|
depends=('python3' 'curl')
|
2014-04-14 06:11:22 +08:00
|
|
|
provides=('pycurl')
|
2014-04-12 05:39:24 +08:00
|
|
|
|
|
|
|
cd ${_pypiname}
|
2014-09-07 02:06:09 +08:00
|
|
|
python3 setup.py install -O1 --root="${pkgdir}"
|
2014-04-12 05:39:24 +08:00
|
|
|
install -D -m644 COPYING-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
|
|
|
}
|
|
|
|
|
|
|
|
package_python2-pycurl() {
|
|
|
|
pkgdesc="A Python 2.x interface to libcurl"
|
|
|
|
depends=('python2' 'curl')
|
2014-04-12 05:53:55 +08:00
|
|
|
provides=('pycurl' 'python-pycurl')
|
2014-04-14 06:11:22 +08:00
|
|
|
conflicts=('python-pycurl')
|
|
|
|
replaces=('python-pycurl')
|
2014-04-12 05:39:24 +08:00
|
|
|
|
|
|
|
cd python2-${_pypiname}
|
2014-09-07 02:06:09 +08:00
|
|
|
python2 setup.py install -O1 --root="${pkgdir}"
|
2014-04-12 05:39:24 +08:00
|
|
|
install -D -m644 COPYING-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
|
|
|
}
|