diff options
author | Yury Usishchev <y.usishchev@samsung.com> | 2015-08-17 19:46:01 +0300 |
---|---|---|
committer | Yury Usishchev <y.usishchev@samsung.com> | 2015-08-20 14:35:53 +0300 |
commit | c5eafdab618efebca009b698c34dc81b702c2f05 (patch) | |
tree | c08f217aa0e855e2e5e6e57f1544e7fd3130853d /packaging/qemu-accel-armv7l.spec | |
parent | 96b1f9f254a70a6012cdecd5b5bba619226c7d93 (diff) | |
download | qemu-accel-c5eafdab618efebca009b698c34dc81b702c2f05.tar.gz qemu-accel-c5eafdab618efebca009b698c34dc81b702c2f05.tar.bz2 qemu-accel-c5eafdab618efebca009b698c34dc81b702c2f05.zip |
Add python-accel package
Change-Id: I8274d2c96804dada87d78cef097b811c3ce35f5e
Diffstat (limited to 'packaging/qemu-accel-armv7l.spec')
-rw-r--r-- | packaging/qemu-accel-armv7l.spec | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index b41cb8b..3d07098 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -49,6 +49,8 @@ BuildRequires: libxslt-tools BuildRequires: cmake BuildRequires: gawk BuildRequires: libstdc++ +BuildRequires: python +BuildRequires: python-xml Summary: Native binaries for speeding up cross compile License: GPL-2.0 Group: Development/Cross Compilation @@ -60,12 +62,24 @@ This package is used in %{cross} architecture builds using qemu to speed up buil with native binaries. This should not be installed on systems, it is just intended for qemu environments. +%package -n python-accel +Version: %{version} +Release: %{release} +Summary: Binaries for python acceleration +License: GPL-2.0 +Group: Development/Cross Compilation + +%description -n python-accel +This package is used in qemu-accel to accelerate python. + %prep %build %install gcc_version=`gcc --version | sed -ne '1s/.* //p'` +# just like it is determided in python.spec +python_version=`python --version |& sed -ne '1s/.* //p' | head -c 3` binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc %ifarch %ix86 @@ -94,6 +108,8 @@ for executable in $LD \ %{_bindir}/head \ %{_bindir}/eu-{addr2line,ar,elfcmp,elflint,findtextrel,ld,nm,objdump,ranlib,readelf,size,stack,strings,strip,unstrip} \ %{_bindir}/xsltproc \ + %{_bindir}/python${python_version} \ + %{_libdir}/python${python_version}/lib-dynload/*.so \ %{_bindir}/{ccmake,cmake,cpack,ctest} \ %{_bindir}/%{target_arch}-{addr2line,ar,as,c++filt,dwp,elfedit,gprof,ld,ld.bfd,ld.gold,nm,objcopy,objdump,ranlib,readelf,size,strings,strip} \ %{_bindir}/%{target_arch}-{c++,g++,cpp,gcc,gcc-${gcc_version},gcc-ar,gcc-nm,gcc-ranlib,gcov,gfortran} \ @@ -154,6 +170,23 @@ for binary in ar as ld{,.bfd,.gold} nm obj{copy,dump} ranlib strip; do ln -sf %{our_path}%{_bindir}/$binary %{buildroot}%{our_path}%{_prefix}/%{target_arch}/bin/$binary done +# create symlinks for python +mv %{buildroot}%{our_path}%{_bindir}/python${python_version} %{buildroot}%{our_path}%{_bindir}/python${python_version}.orig +cat > %{buildroot}%{our_path}%{_bindir}/python${python_version} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/python${python_version}" +else + export PYTHONPATH+=":%{libdir}/python${python_version}" +fi +export PYTHONHOME="%{our_path}%{_prefix}" +%{our_path}%{_bindir}/python${python_version}.orig "\$@" +EOF +chmod +x %{buildroot}%{our_path}%{_bindir}/python${python_version} + +ln -s python${python_version} %{buildroot}%{our_path}%{_bindir}/python +ln -s python${python_version} %{buildroot}%{our_path}%{_libdir}/python + # rename gcc binaries for bin in c++ g++ cpp gcc gcc-ar gcc-nm gcc-ranlib gfortran do @@ -205,5 +238,12 @@ ldconfig %files %defattr(-,root,root) %{our_path} +%exclude %{our_path}%{_bindir}/python* +%exclude %{our_path}%{_prefix}/lib/python*/lib-dynload/*.so + +%files -n python-accel +%defattr(-,root,root) +%{our_path}%{_bindir}/python* +%{our_path}%{_prefix}/lib/python*/lib-dynload/*.so %changelog |