15
0

Accepting request 481097 from home:alois:branches:devel:languages:python

Converted to single-spec.

OBS-URL: https://build.opensuse.org/request/show/481097
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-chardet?expand=0&rev=24
This commit is contained in:
Jan Matejek
2017-03-20 14:35:26 +00:00
committed by Git OBS Bridge
parent dd43fdd1e8
commit af630d78e6
2 changed files with 20 additions and 27 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Mar 19 08:23:54 UTC 2017 - aloisio@gmx.com
- Converted to single spec.
-------------------------------------------------------------------
Mon Jan 30 21:41:47 UTC 2017 - rjschwei@suse.com

View File

@@ -16,6 +16,7 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-chardet
Version: 2.3.0
Release: 0
@@ -25,14 +26,13 @@ Group: Development/Languages/Python
Url: https://github.com/chardet/chardet
Source0: chardet-%{version}.tar.bz2
Source1: python-chardet-rpmlintrc
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1110
BuildArch: noarch
%endif
%python_subpackages
%description
Universal character encoding detector
@@ -67,32 +67,20 @@ or more files::
%setup -q -n chardet-%{version}
%build
python setup.py build
%python_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
%python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
%check
python setup.py test
%python_exec 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
%files %{python_files}
%defattr(-,root,root,-)
%{python_sitelib}/*
%{_bindir}/chardetect
%{_bindir}/chardetect-%{py_ver}
%ghost %{_sysconfdir}/alternatives/chardetect
%doc README.rst
%python3_only %{_bindir}/chardetect
%{python_sitelib}/chardet
%{python_sitelib}/chardet-%{version}-py%{py_ver}.egg-info
%changelog