Accepting request 203001 from home:posophe:branches:devel:languages:python
update-alternative implementation OBS-URL: https://build.opensuse.org/request/show/203001 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=33
This commit is contained in:
parent
5cc4f775eb
commit
32706eaef3
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 11 17:06:20 UTC 2013 - p.drouand@gmail.com
|
||||||
|
|
||||||
|
- Implement update-alternatives
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon May 13 08:17:40 UTC 2013 - dmueller@suse.com
|
Mon May 13 08:17:40 UTC 2013 - dmueller@suse.com
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ BuildRequires: fdupes
|
|||||||
BuildRequires: python-devel
|
BuildRequires: python-devel
|
||||||
Provides: python-cython = %{version}
|
Provides: python-cython = %{version}
|
||||||
Obsoletes: python-cython < %{version}
|
Obsoletes: python-cython < %{version}
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(postun): update-alternatives
|
||||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||||
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||||
%endif
|
%endif
|
||||||
@ -52,14 +54,37 @@ code.
|
|||||||
%setup -q -n Cython-%{version}
|
%setup -q -n Cython-%{version}
|
||||||
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py # Fix non-executable scripts
|
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py # Fix non-executable scripts
|
||||||
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c # Fix EOL encoding
|
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c # Fix EOL encoding
|
||||||
|
mv bin/cython bin/cython-%{py_ver}
|
||||||
|
mv bin/cygdb bin/cygdb-%{py_ver}
|
||||||
|
sed -i "s|bin/cython|bin/cython-%{py_ver}|" setup.py
|
||||||
|
sed -i "s|bin/cygdb|bin/cygdb-%{py_ver}|" setup.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
CFLAGS="%{optflags}" python setup.py build
|
CFLAGS="%{optflags}" python setup.py build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||||
|
ln -s %{_bindir}/cython-%{py_ver} %{buildroot}%{_bindir}/cython
|
||||||
|
ln -s %{_bindir}/cygdb-%{py_ver} %{buildroot}%{_bindir}/cygdb
|
||||||
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
|
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
|
||||||
|
|
||||||
|
%pre
|
||||||
|
# Since /usr/bin/cython and /usr/bin/cygdb became ghosted to be used with update-alternatives, we have to get rid
|
||||||
|
# of the old binary resulting from the non-update-alternativies-ified package:
|
||||||
|
[[ ! -L %{_bindir}/cygdb ]] && rm -f %{_bindir}/cygdb
|
||||||
|
[[ ! -L %{_bindir}/cython ]] && rm -f %{_bindir}/cython
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%post
|
||||||
|
update-alternatives \
|
||||||
|
--install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \
|
||||||
|
--slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver}
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ $1 -eq 0 ] ; then
|
||||||
|
update-alternatives --remove cython %{_bindir}/cython-%{py_ver}
|
||||||
|
fi
|
||||||
|
|
||||||
# Disabled testsuite as it takes a long time:
|
# Disabled testsuite as it takes a long time:
|
||||||
#%%check
|
#%%check
|
||||||
#python runtests.py
|
#python runtests.py
|
||||||
@ -67,8 +92,10 @@ python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
|||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
|
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
|
||||||
%{_bindir}/cygdb
|
%ghost %{_bindir}/cygdb
|
||||||
%{_bindir}/cython
|
%{_bindir}/cygdb-%{py_ver}
|
||||||
|
%ghost %{_bindir}/cython
|
||||||
|
%{_bindir}/cython-%{py_ver}
|
||||||
%{python_sitearch}/Cython/
|
%{python_sitearch}/Cython/
|
||||||
%{python_sitearch}/Cython-%{version}-py%{py_ver}.egg-info
|
%{python_sitearch}/Cython-%{version}-py%{py_ver}.egg-info
|
||||||
%{python_sitearch}/cython.py*
|
%{python_sitearch}/cython.py*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user