forked from pool/python-Cython
Accepting request 284215 from home:frispete:python
In case somebody cares.. - fix update-alternatives handling in a distribution backwards compatible way OBS-URL: https://build.opensuse.org/request/show/284215 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=55
This commit is contained in:
parent
25ef40c3e4
commit
6e06866e8f
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 5 11:35:45 UTC 2015 - hpj@urpla.net
|
||||
|
||||
- fix update-alternatives handling in a distribution backwards compatible way
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 9 15:20:31 UTC 2015 - dimstar@opensuse.org
|
||||
|
||||
|
@ -56,14 +56,10 @@ code.
|
||||
|
||||
%prep
|
||||
%setup -q -n Cython-%{version}
|
||||
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
|
||||
mv bin/cython bin/cython-%{py_ver}
|
||||
mv bin/cythonize bin/cythonize-%{py_ver}
|
||||
mv bin/cygdb bin/cygdb-%{py_ver}
|
||||
sed -i "s|bin/cython|bin/cython-%{py_ver}|" setup.py
|
||||
sed -i "s|bin/cythonize|bin/cythonize-%{py_ver}|" setup.py
|
||||
sed -i "s|bin/cygdb|bin/cygdb-%{py_ver}|" setup.py
|
||||
# Fix non-executable scripts
|
||||
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py
|
||||
# Fix EOL encoding
|
||||
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c
|
||||
|
||||
%build
|
||||
CFLAGS="%{optflags}" python setup.py build
|
||||
@ -72,9 +68,11 @@ CFLAGS="%{optflags}" python setup.py build
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
# Prepare for update-alternatives usage
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||
ln -s -f %{_sysconfdir}/alternatives/cython %{buildroot}%{_bindir}/cython
|
||||
ln -s -f %{_sysconfdir}/alternatives/cythonize %{buildroot}%{_bindir}/cythonize
|
||||
ln -s -f %{_sysconfdir}/alternatives/cygdb %{buildroot}%{_bindir}/cygdb
|
||||
for p in cython cythonize cygdb ; do
|
||||
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
|
||||
ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_bindir}/$p
|
||||
ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_sysconfdir}/alternatives/$p
|
||||
done
|
||||
|
||||
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
|
||||
rm -rf %{buildroot}%{python_sitearch}/__pycache__/
|
||||
@ -84,26 +82,22 @@ rm -rf %{buildroot}%{python_sitearch}/__pycache__/
|
||||
python runtests.py
|
||||
|
||||
%post
|
||||
update-alternatives \
|
||||
%_sbindir/update-alternatives \
|
||||
--install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \
|
||||
--slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \
|
||||
--slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver}
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
update-alternatives --remove cython %{_bindir}/cython-%{py_ver}
|
||||
%_sbindir/update-alternatives --remove cython %{_bindir}/cython-%{py_ver}
|
||||
fi
|
||||
|
||||
# Disabled testsuite as it takes a long time:
|
||||
#%%check
|
||||
#python runtests.py
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
|
||||
%{_bindir}/cygdb
|
||||
%{_bindir}/cython
|
||||
%{_bindir}/cythonize
|
||||
%ghost %{_bindir}/cygdb
|
||||
%ghost %{_bindir}/cython
|
||||
%ghost %{_bindir}/cythonize
|
||||
%{_bindir}/cygdb-%{py_ver}
|
||||
%{_bindir}/cython-%{py_ver}
|
||||
%{_bindir}/cythonize-%{py_ver}
|
||||
|
Loading…
x
Reference in New Issue
Block a user