python-numpy: fix symlink for python3 headers

Fix short_desc.
This commit is contained in:
Alessio Sergi 2015-01-27 17:55:01 +01:00
parent 8ecc0fd91a
commit 1ab40b3ab4

View file

@ -1,7 +1,7 @@
# Template file for 'python-numpy' # Template file for 'python-numpy'
pkgname=python-numpy pkgname=python-numpy
version=1.9.1 version=1.9.1
revision=1 revision=2
wrksrc="numpy-${version}" wrksrc="numpy-${version}"
build_style=python-module build_style=python-module
python_versions="2.7 3.4" python_versions="2.7 3.4"
@ -9,6 +9,7 @@ hostmakedepends="python-setuptools python3.4-setuptools gcc-fortran"
makedepends="python-devel python3.4-devel blas-devel lapack-devel" makedepends="python-devel python3.4-devel blas-devel lapack-devel"
pycompile_module="numpy" pycompile_module="numpy"
short_desc="Fast and sophisticated array facility to Python2" short_desc="Fast and sophisticated array facility to Python2"
_short_desc="${short_desc/Python2/Python3.4}"
maintainer="Alessio Sergi <al3hex@gmail.com>" maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://www.numpy.org/" homepage="http://www.numpy.org/"
license="3-clause-BSD" license="3-clause-BSD"
@ -29,34 +30,40 @@ pre_build() {
# remove *.c source files # remove *.c source files
sed -i "/config.add_data_files('mingw\/gfortran_vs2003_hack.c')/d" numpy/distutils/setup.py sed -i "/config.add_data_files('mingw\/gfortran_vs2003_hack.c')/d" numpy/distutils/setup.py
sed -i "/config.add_data_files/,+3d" numpy/f2py/setup.py sed -i "/config.add_data_files/,+3d" numpy/f2py/setup.py
}
# remove shebangs
find . -type f -name '*.py' -exec sed -i "s,^#!.*python$,," {} +
}
post_install() { post_install() {
# create symlinks for unversioned f2py* scripts # create symlinks for unversioned f2py* scripts
ln -sf f2py2.7 ${DESTDIR}/usr/bin/f2py ln -sf f2py2.7 ${DESTDIR}/usr/bin/f2py
ln -sf f2py3.4 ${DESTDIR}/usr/bin/f2py3 ln -sf f2py3.4 ${DESTDIR}/usr/bin/f2py3
# fix shebangs for python3.4 # create compat symlinks for .h files
cd ${DESTDIR}/usr/lib/python3.4/site-packages/numpy
find . -name '*.py' -exec sed -i -e 's,#!.*python$,&3.4,' {} +
# create symlinks for .h files
vmkdir usr/include/python2.7 vmkdir usr/include/python2.7
ln -sf /usr/lib/python2.7/site-packages/numpy/core/include/numpy ${DESTDIR}/usr/include/python2.7/numpy ln -sf /usr/lib/python2.7/site-packages/numpy/core/include/numpy ${DESTDIR}/usr/include/python2.7
vmkdir usr/include/python3.4 vmkdir usr/include/python3.4m
ln -sf /usr/lib/python3.4/site-packages/numpy/core/include/numpy ${DESTDIR}/usr/include/python3.4/numpy ln -sf /usr/lib/python3.4/site-packages/numpy/core/include/numpy ${DESTDIR}/usr/include/python3.4m
# install f2py*.1 man pages # install f2py*.1 man pages and license
vman ${wrksrc}/doc/f2py/f2py.1 vman ${wrksrc}/doc/f2py/f2py.1
vman ${wrksrc}/doc/f2py/f2py.1 f2py3.1 vman ${wrksrc}/doc/f2py/f2py.1 f2py3.1
vlicense ${wrksrc}/LICENSE.txt LICENSE vlicense ${wrksrc}/LICENSE.txt LICENSE
} }
python-numpy-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include/python2.7
vmove usr/lib/python2.7/site-packages/numpy/core/include/numpy
vmove usr/lib/python2.7/site-packages/numpy/random/randomkit.h
}
}
python3.4-numpy_package() { python3.4-numpy_package() {
pycompile_version="3.4" pycompile_version="3.4"
pycompile_module="numpy" pycompile_module="numpy"
short_desc="${short_desc/Python2/Python3.4}" short_desc="${_short_desc}"
pkg_install() { pkg_install() {
vmove usr/bin/f2py3* vmove usr/bin/f2py3*
vmove usr/lib/python3.4 vmove usr/lib/python3.4
@ -64,22 +71,11 @@ python3.4-numpy_package() {
vlicense ${wrksrc}/LICENSE.txt LICENSE vlicense ${wrksrc}/LICENSE.txt LICENSE
} }
} }
python-numpy-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include/python2.7/numpy
vmove usr/lib/python2.7/site-packages/numpy/core/include/numpy
vmove usr/lib/python2.7/site-packages/numpy/random/randomkit.h
}
}
python3.4-numpy-devel_package() { python3.4-numpy-devel_package() {
depends="python3.4-numpy>=${version}_${revision}" depends="python3.4-numpy>=${version}_${revision}"
short_desc+=" - development files" short_desc="${_short_desc} - development files"
pkg_install() { pkg_install() {
vmove usr/include/python3.4/numpy vmove usr/include/python3.4m
vmove usr/lib/python3.4/site-packages/numpy/core/include/numpy vmove usr/lib/python3.4/site-packages/numpy/core/include/numpy
vmove usr/lib/python3.4/site-packages/numpy/random/randomkit.h vmove usr/lib/python3.4/site-packages/numpy/random/randomkit.h
} }