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:
committed by
Git OBS Bridge
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
|
Fri Jan 9 15:20:31 UTC 2015 - dimstar@opensuse.org
|
||||||
|
|
||||||
|
@@ -56,14 +56,10 @@ code.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n Cython-%{version}
|
%setup -q -n Cython-%{version}
|
||||||
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py # Fix non-executable scripts
|
# 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|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py
|
||||||
mv bin/cython bin/cython-%{py_ver}
|
# Fix EOL encoding
|
||||||
mv bin/cythonize bin/cythonize-%{py_ver}
|
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c
|
||||||
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
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
CFLAGS="%{optflags}" python setup.py 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}
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||||
# Prepare for update-alternatives usage
|
# Prepare for update-alternatives usage
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||||
ln -s -f %{_sysconfdir}/alternatives/cython %{buildroot}%{_bindir}/cython
|
for p in cython cythonize cygdb ; do
|
||||||
ln -s -f %{_sysconfdir}/alternatives/cythonize %{buildroot}%{_bindir}/cythonize
|
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
|
||||||
ln -s -f %{_sysconfdir}/alternatives/cygdb %{buildroot}%{_bindir}/cygdb
|
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}
|
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
|
||||||
rm -rf %{buildroot}%{python_sitearch}/__pycache__/
|
rm -rf %{buildroot}%{python_sitearch}/__pycache__/
|
||||||
@@ -84,26 +82,22 @@ rm -rf %{buildroot}%{python_sitearch}/__pycache__/
|
|||||||
python runtests.py
|
python runtests.py
|
||||||
|
|
||||||
%post
|
%post
|
||||||
update-alternatives \
|
%_sbindir/update-alternatives \
|
||||||
--install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \
|
--install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \
|
||||||
--slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \
|
--slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \
|
||||||
--slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver}
|
--slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver}
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ $1 -eq 0 ] ; then
|
if [ $1 -eq 0 ] ; then
|
||||||
update-alternatives --remove cython %{_bindir}/cython-%{py_ver}
|
%_sbindir/update-alternatives --remove cython %{_bindir}/cython-%{py_ver}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disabled testsuite as it takes a long time:
|
|
||||||
#%%check
|
|
||||||
#python runtests.py
|
|
||||||
|
|
||||||
%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
|
%ghost %{_bindir}/cython
|
||||||
%{_bindir}/cythonize
|
%ghost %{_bindir}/cythonize
|
||||||
%{_bindir}/cygdb-%{py_ver}
|
%{_bindir}/cygdb-%{py_ver}
|
||||||
%{_bindir}/cython-%{py_ver}
|
%{_bindir}/cython-%{py_ver}
|
||||||
%{_bindir}/cythonize-%{py_ver}
|
%{_bindir}/cythonize-%{py_ver}
|
||||||
|
Reference in New Issue
Block a user