From aa397e4cbbe2369ecc7c3c81a4352b393db0e1a294b2ef09e5c6d321409726a3 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Mon, 18 May 2015 13:33:30 +0000 Subject: [PATCH] Accepting request 306277 from home:apersaud:branches:devel:languages:python added updated alternatives (since there is a python3 package that provides the same binaries) and run tests OBS-URL: https://build.opensuse.org/request/show/306277 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=19 --- python-chardet.changes | 7 +++++++ python-chardet.spec | 22 +++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/python-chardet.changes b/python-chardet.changes index 0f6d67a..a18b559 100644 --- a/python-chardet.changes +++ b/python-chardet.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 11 05:49:58 UTC 2015 - arun@gmx.de + +- specfile: + * added update alternative to prevent conflicts with python3 version + * add tests + ------------------------------------------------------------------- Tue Feb 10 23:45:01 UTC 2015 - aloisio@gmx.com diff --git a/python-chardet.spec b/python-chardet.spec index f69622c..4095ad2 100644 --- a/python-chardet.spec +++ b/python-chardet.spec @@ -1,7 +1,7 @@ # # spec file for package python-chardet # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,6 +27,8 @@ Source0: chardet-%{version}.tar.bz2 Source1: python-chardet-rpmlintrc BuildRequires: python-devel BuildRequires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} > 1110 BuildArch: noarch @@ -69,10 +71,28 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +# update-alternatives +mv %{buildroot}%{_bindir}/chardetect %{buildroot}%{_bindir}/chardetect-%{py_ver} +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/chardetect +ln -sf %{_sysconfdir}/alternatives/chardetect %{buildroot}%{_bindir}/chardetect + +%check +python setup.py test + +%post + update-alternatives --install %{_bindir}/chardetect chardetect %{_bindir}/chardetect-%{py_ver} 30 + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove chardetect %{_bindir}/chardetect-%{py_ver} +fi %files %defattr(-,root,root,-) %{python_sitelib}/* %{_bindir}/chardetect +%{_bindir}/chardetect-%{py_ver} +%ghost %{_sysconfdir}/alternatives/chardetect %changelog