Hello community,

here is the log from the commit of package python3-Cython for openSUSE:Factory 
checked in at 2013-10-17 14:31:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-Cython (Old)
 and      /work/SRC/openSUSE:Factory/.python3-Cython.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-Cython"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-Cython/python3-Cython.changes    
2013-06-25 18:00:08.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python3-Cython.new/python3-Cython.changes       
2013-10-17 17:46:39.000000000 +0200
@@ -1,0 +2,5 @@
+Fri Oct 11 17:47:46 UTC 2013 - [email protected]
+
+- Implement update-alternatives
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-Cython.spec ++++++
--- /var/tmp/diff_new_pack.NfLQf4/_old  2013-10-17 17:46:40.000000000 +0200
+++ /var/tmp/diff_new_pack.NfLQf4/_new  2013-10-17 17:46:40.000000000 +0200
@@ -30,6 +30,8 @@
 BuildRequires:  python3-2to3
 BuildRequires:  python3-devel
 Requires:       python3
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
 
 %description
 The Cython language makes writing C extensions for the Python language as
@@ -50,26 +52,49 @@
 %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-%{py3_ver}
+mv bin/cygdb bin/cygdb-%{py3_ver}
+sed -i "s|bin/cython|bin/cython-%{py3_ver}|" setup.py
+sed -i "s|bin/cygdb|bin/cygdb-%{py3_ver}|" setup.py
 
 %build
 CFLAGS="%{optflags}" python3 setup.py build
 
 %install
 python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
+ln -s  %{_bindir}/cython-%{py3_ver} %{buildroot}%{_bindir}/cython
+ln -s  %{_bindir}/cygdb-%{py3_ver} %{buildroot}%{_bindir}/cygdb
 %fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
 rm -rf %{buildroot}%{python3_sitearch}/__pycache__/
 # avoid conflicts with python 2 version
-mv %{buildroot}%{_bindir}/cygdb %{buildroot}%{_bindir}/cygdb-%{py3_ver}
-mv %{buildroot}%{_bindir}/cython %{buildroot}%{_bindir}/cython-%{py3_ver}
 
 # Disabled testsuite as it takes a long time:
 #%%check
 #python runtests.py
 
+%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-%{py3_ver} 30 \
+   --slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py3_ver}
+
+%preun
+if [ $1 -eq 0 ] ; then
+    update-alternatives --remove cython %{_bindir}/cython-%{py3_ver}
+fi
+
 %files
 %defattr(-,root,root,-)
 %doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
+%ghost %{_bindir}/cygdb
 %{_bindir}/cygdb-%{py3_ver}
+%ghost %{_bindir}/cython
 %{_bindir}/cython-%{py3_ver}
 %{python3_sitearch}/Cython/
 %{python3_sitearch}/Cython-%{version}-py%{py3_ver}.egg-info

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to