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