forked from pool/python-chardet
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
This commit is contained in:
committed by
Git OBS Bridge
parent
83b6a3eddf
commit
aa397e4cbb
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user