python-curl: rewrite to fix cross build

This commit is contained in:
Alessio Sergi 2014-06-27 10:01:47 +02:00
parent 22cf71846c
commit d3d8f7874a
1 changed files with 12 additions and 39 deletions

View File

@ -1,7 +1,7 @@
# Template file for 'python-curl'
pkgname=python-curl
version=7.19.3.1
revision=1
revision=2
wrksrc="pycurl-${version}"
build_style=python-module
python_versions="2.7 3.4"
@ -19,45 +19,20 @@ checksum=c0d673fe99a9de07239eabe77c798f1b043f60c02afaec1430ceaf59d7501a4f
CFLAGS="${CFLAGS} -fno-strict-aliasing"
post_extract() {
cp -a ${wrksrc} /tmp/python2-build
cp -a ${wrksrc} /tmp/python3.4-build
mv /tmp/python{2,3.4}-build ${wrksrc}
}
pre_build() {
cd ${wrksrc}/python2-build
sed -i -e 's/"COPYING-LGPL", "COPYING-MIT",//' \
-e 's/"share", "doc", PACKAGE/"share", "doc", "python-curl"/' setup.py
cd ${wrksrc}/python3.4-build
find . -name '*.py' -exec sed -i -e 's|#! /usr/bin/env python|&3.4|' {} +
sed -i -e 's/"COPYING-LGPL", "COPYING-MIT",//' \
-e 's/"share", "doc", PACKAGE/"share", "doc", "python3.4-curl"/' setup.py
}
do_build() {
cd ${wrksrc}/python2-build
python setup.py build
cd ${wrksrc}/python3.4-build
python3.4 setup.py build
}
do_install() {
cd ${wrksrc}/python2-build
python setup.py install --root=${DESTDIR}
cd ${wrksrc}/python3.4-build
python3.4 setup.py install --root=${DESTDIR}
}
post_install() {
_doc_install() {
vmkdir /usr/share/doc/${pkgname}
vcopy "doc examples tests AUTHORS ChangeLog INSTALL.rst README.rst" /usr/share/doc/${pkgname}
# install licenses
vinstall COPYING-LGPL 644 usr/share/licenses/${pkgname}
vinstall COPYING-MIT 644 usr/share/licenses/${pkgname}
}
post_install() {
# remove documentation as installed by setup.py
rm -rf ${DESTDIR}/usr/share/doc
_doc_install
}
python3.4-curl_package() {
depends="python3.4 curl"
pycompile_version="3.4"
@ -65,10 +40,8 @@ python3.4-curl_package() {
short_desc="${short_desc/Python2/Python3.4}"
pkg_install() {
vmove /usr/lib/python3.4
vmove /usr/share/doc/python3.4-curl
# install licenses
cd ${wrksrc}
vinstall COPYING-LGPL 644 usr/share/licenses/${pkgname}
vinstall COPYING-MIT 644 usr/share/licenses/${pkgname}
find . -name '*.py' -exec sed -i -e 's,#! /usr/bin/env python,&3.4,' {} +
_doc_install
}
}