14
0

Accepting request 312143 from home:benoit_monin:branches:devel:languages:python

- update to Unidecode 0.04.18
- add new build dependency: python-setuptools
- add and use update-alternatives for unidecode binary
- set a UTF-8 locale to run the tests: they fail without it

OBS-URL: https://build.opensuse.org/request/show/312143
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Unidecode?expand=0&rev=6
This commit is contained in:
2015-06-23 06:31:58 +00:00
committed by Git OBS Bridge
parent 89c140280a
commit 63c947fd25
4 changed files with 37 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-Unidecode
#
# Copyright (c) 2014 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
@@ -17,7 +17,7 @@
Name: python-Unidecode
Version: 0.04.17
Version: 0.04.18
Release: 0
Summary: ASCII transliterations of Unicode text
License: GPL-2.0+
@@ -26,6 +26,9 @@ Url: https://pypi.python.org/pypi/Unidecode
Source: http://pypi.python.org/packages/source/U/Unidecode/Unidecode-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@@ -81,11 +84,29 @@ python setup.py build
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%fdupes %buildroot/%_prefix
# update-alternatives
mv %{buildroot}%{_bindir}/unidecode %{buildroot}%{_bindir}/unidecode-%{py_ver}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
touch %{buildroot}%{_sysconfdir}/alternatives/unidecode
ln -sf %{_sysconfdir}/alternatives/unidecode %{buildroot}%{_bindir}/unidecode
%check
python setup.py test
LANG=en_US.UTF-8 python setup.py test
%post
update-alternatives \
--install %{_bindir}/unidecode unidecode %{_bindir}/unidecode-%{py_ver} 20
%postun
if [ $1 -eq 0 ] ; then
update-alternatives --remove unidecode %{_bindir}/unidecode-%{py_ver}
fi
%files
%defattr(-,root,root,-)
%{python_sitelib}/*
%ghost %{_sysconfdir}/alternatives/unidecode
%{_bindir}/unidecode
%{_bindir}/unidecode-%{py_ver}
%changelog