From af630d78e60fc47c0b5605163ea1ed3302f05ab7fc73d0c94a0b1522b3af31ee Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Mon, 20 Mar 2017 14:35:26 +0000 Subject: [PATCH] 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 --- python-chardet.changes | 5 +++++ python-chardet.spec | 42 +++++++++++++++--------------------------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/python-chardet.changes b/python-chardet.changes index 9754a37..fd4b392 100644 --- a/python-chardet.changes +++ b/python-chardet.changes @@ -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 diff --git a/python-chardet.spec b/python-chardet.spec index b97cb09..204df66 100644 --- a/python-chardet.spec +++ b/python-chardet.spec @@ -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