From f153df2d3d09e9dee2971f9004856e818949eed4b79304ac3b23f611723fe65b Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Thu, 16 May 2013 10:30:52 +0000 Subject: [PATCH] - Fix update-alternatives and support upgrade from previous versions - Fix update-alternatives and support upgrade from previous versions OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Sphinx?expand=0&rev=27 --- python-Sphinx.changes | 5 +++++ python-Sphinx.spec | 14 ++++++++------ python3-Sphinx.changes | 5 +++++ python3-Sphinx.spec | 12 +++++++----- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/python-Sphinx.changes b/python-Sphinx.changes index 3673218..1a2c05e 100644 --- a/python-Sphinx.changes +++ b/python-Sphinx.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 16 10:33:17 UTC 2013 - speilicke@suse.com + +- Fix update-alternatives and support upgrade from previous versions + ------------------------------------------------------------------- Tue Apr 30 14:38:24 UTC 2013 - speilicke@suse.com diff --git a/python-Sphinx.spec b/python-Sphinx.spec index 1f82ac2..2ccd62b 100644 --- a/python-Sphinx.spec +++ b/python-Sphinx.spec @@ -80,6 +80,9 @@ and translating suite, the Docutils. %prep %setup -q -n Sphinx-%{version} sed -i '/#\!/d' sphinx/pycode/pgen2/token.py # Fix non-excutable-script warning +# Add Interpreter version suffix to entrypoints (and thus /usr/bin binaries) to +# allow for update-alternatives later on: +sed -i 's/\(sphinx-.*\) =/\1-%{py_ver} =/' setup.py %build python setup.py build @@ -89,13 +92,12 @@ python setup.py build_sphinx -b man %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} for B in apidoc autogen build quickstart ; do - mv %{buildroot}%{_bindir}/sphinx-$B %{buildroot}%{_bindir}/sphinx-$B-%{py_ver} - touch %{buildroot}%{_bindir}/sphinx-$B + ln -s %{_bindir}/sphinx-$B-%{py_ver} %{buildroot}%{_bindir}/sphinx-$B done install -d %{buildroot}%{_mandir}/man1/ for M in all apidoc build quickstart ; do install -m 644 build/sphinx/man/sphinx-$M.1 %{buildroot}%{_mandir}/man1/sphinx-$M-%{py_ver}.1 - touch %{buildroot}%{_mandir}/man1/sphinx-$M.1 + ln -s %{_mandir}/man1/sphinx-$M-%{py_ver}.1 %{buildroot}%{_mandir}/man1/sphinx-$M.1 done %find_lang sphinx @@ -104,7 +106,7 @@ nosetests %post update-alternatives \ - --install %{_bindir}/sphinx-apidoc sphinx-apidoc %{_bindir}/sphinx-apidoc-%{py_ver} 10 \ + --install %{_bindir}/sphinx-apidoc sphinx-apidoc %{_bindir}/sphinx-apidoc-%{py_ver} 20 \ --slave %{_bindir}/sphinx-build sphinx-build %{_bindir}/sphinx-build-%{py_ver} \ --slave %{_bindir}/sphinx-autogen sphinx-autogen %{_bindir}/sphinx-autogen-%{py_ver} \ --slave %{_bindir}/sphinx-quickstart sphinx-quickstart %{_bindir}/sphinx-quickstart-%{py_ver} \ @@ -113,9 +115,9 @@ update-alternatives \ --slave %{_mandir}/man1/sphinx-build.1.gz sphinx-build.1 %{_mandir}/sphinx-build-%{py_ver}.1.gz \ --slave %{_mandir}/man1/sphinx-quickstart.1.gz sphinx-quickstart.1 %{_mandir}/sphinx-quickstart-%{py_ver}.1.gz \ -%postun +%preun if [ $1 -eq 0 ] ; then - update-alternatives --remove sphinx-build %{_bindir}/sphinx-apidoc-%{py_ver} + update-alternatives --remove sphinx-build %{_bindir}/sphinx-apidoc-%{py_ver} fi %files -f sphinx.lang diff --git a/python3-Sphinx.changes b/python3-Sphinx.changes index d174cd0..7cb4886 100644 --- a/python3-Sphinx.changes +++ b/python3-Sphinx.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 16 10:33:34 UTC 2013 - speilicke@suse.com + +- Fix update-alternatives and support upgrade from previous versions + ------------------------------------------------------------------- Tue May 7 08:16:04 UTC 2013 - highwaystar.ru@gmail.com diff --git a/python3-Sphinx.spec b/python3-Sphinx.spec index ebd8e0d..f6a6010 100644 --- a/python3-Sphinx.spec +++ b/python3-Sphinx.spec @@ -77,6 +77,8 @@ and translating suite, the Docutils. %setup -q -n Sphinx-%{version} %patch0 sed -i '/#\!/d' sphinx/pycode/pgen2/token.py # Fix non-excutable-script warning +# Add Interpreter version suffix to entrypoints (and thus /usr/bin binaries) to +# allow for update-alternatives later on: sed -i "s|\(sphinx-.*\) =|\1-%{py3_ver} =|" setup.py # Add Python version suffix to binaries sed -i "s|'\(sphinx-[a-z]*\)'|'\1-%{py3_ver}'|" doc/conf.py # Do the same for man-pages @@ -89,22 +91,22 @@ python3 setup.py build_sphinx -b man # Build man-pages %install python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} for B in apidoc autogen build quickstart ; do - touch %{buildroot}%{_bindir}/sphinx-$B + ln -s %{_bindir}/sphinx-$B-%{py3_ver} %{buildroot}%{_bindir}/sphinx-$B done install -d %{buildroot}%{_mandir}/man1/ for M in all apidoc build quickstart ; do install -m 644 build/sphinx/man/sphinx-$M-%{py3_ver}.1 %{buildroot}%{_mandir}/man1/sphinx-$M-%{py3_ver}.1 - touch %{buildroot}%{_mandir}/man1/sphinx-$M.1 + ln -s %{_mandir}/man1/sphinx-$M-%{py3_ver}.1 %{buildroot}%{_mandir}/man1/sphinx-$M.1 done %find_lang sphinx #TODO: Fix #%%check -#nosetests-%{py3_ver} +#nosetests-%%{py3_ver} %post update-alternatives \ - --install %{_bindir}/sphinx-apidoc sphinx-apidoc %{_bindir}/sphinx-apidoc-%{py3_ver} 10 \ + --install %{_bindir}/sphinx-apidoc sphinx-apidoc %{_bindir}/sphinx-apidoc-%{py3_ver} 30 \ --slave %{_bindir}/sphinx-build sphinx-build %{_bindir}/sphinx-build-%{py3_ver} \ --slave %{_bindir}/sphinx-autogen sphinx-autogen %{_bindir}/sphinx-autogen-%{py3_ver} \ --slave %{_bindir}/sphinx-quickstart sphinx-quickstart %{_bindir}/sphinx-quickstart-%{py3_ver} \ @@ -113,7 +115,7 @@ update-alternatives \ --slave %{_mandir}/man1/sphinx-build.1.gz sphinx-build.1 %{_mandir}/sphinx-build-%{py3_ver}.1.gz \ --slave %{_mandir}/man1/sphinx-quickstart.1.gz sphinx-quickstart.1 %{_mandir}/sphinx-quickstart-%{py3_ver}.1.gz \ -%postun +%preun if [ $1 -eq 0 ] ; then update-alternatives --remove sphinx-build %{_bindir}/sphinx-apidoc-%{py3_ver} fi