forked from pool/python-virtualenvwrapper
Accepting request 203050 from home:posophe:branches:devel:languages:python
Implement update-alternatives OBS-URL: https://build.opensuse.org/request/show/203050 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-virtualenvwrapper?expand=0&rev=42
This commit is contained in:
committed by
Git OBS Bridge
parent
c5ff6bbb57
commit
224225c29f
@@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 12 16:42:19 UTC 2013 - p.drouand@gmail.com
|
||||
|
||||
- Implement update-alternative
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 12 15:29:13 UTC 2013 - p.drouand@gmail.com
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ BuildRequires: python-setuptools
|
||||
Requires: python-stevedore
|
||||
Requires: python-virtualenv
|
||||
Requires: python-virtualenv-clone
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%else
|
||||
@@ -61,12 +63,36 @@ python setup.py build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
mv %{buildroot}%{_bindir}/virtualenvwrapper_lazy.sh %{buildroot}%{_bindir}/virtualenvwrapper_lazy-%{py_ver}.sh
|
||||
mv %{buildroot}%{_bindir}/virtualenvwrapper.sh %{buildroot}%{_bindir}/virtualenvwrapper-%{py_ver}.sh
|
||||
ln -s %{_bindir}/virtualenvwrapper-%{py_ver}.sh %{buildroot}%{_bindir}/virtualenvwrapper.sh
|
||||
ln -s %{_bindir}/virtualenvwrapper_lazy-%{py_ver}.sh %{buildroot}%{_bindir}/virtualenvwrapper_lazy.sh
|
||||
|
||||
%pre
|
||||
# Since python scripts 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}/virtualenvwrapper.sh ]] && rm -f %{_bindir}/virtualenvwrapper.sh
|
||||
[[ ! -L %{_bindir}/virtualenvwrapper_lazy.sh ]] && rm -f %{_bindir}/virtualenvwrapper_lazy.sh
|
||||
exit 0
|
||||
|
||||
%post
|
||||
update-alternatives \
|
||||
--install %{_bindir}/virtualenvwrapper.sh virtualenvwrapper.sh %{_bindir}/virtualenvwrapper-%{py_ver}.sh 30 \
|
||||
--slave %{_bindir}/virtualenvwrapper_lazy.sh virtualenvwrapper_lazy.sh %{_bindir}/virtualenvwrapper_lazy-%{py_ver}.sh
|
||||
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
update-alternatives --remove virtualenvwrapper.sh %{_bindir}/virtualenvwrapper.sh-%{py_ver}
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc README.txt README.ja.rst README.es.rst LICENSE announce.rst
|
||||
%{python_sitelib}/*
|
||||
%{_bindir}/virtualenvwrapper.sh
|
||||
%{_bindir}/virtualenvwrapper_lazy.sh
|
||||
%ghost %{_bindir}/virtualenvwrapper.sh
|
||||
%{_bindir}/virtualenvwrapper-%{py_ver}.sh
|
||||
%ghost %{_bindir}/virtualenvwrapper_lazy.sh
|
||||
%{_bindir}/virtualenvwrapper_lazy-%{py_ver}.sh
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user