A new user interface for you!

File python-idna.spec of Package python-idna

%define realname idna
%define srcext   tar.bz2

%if ! 0%{?py_ver:1}
%define py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)

# Common info
Name:          python-%{realname}
Version:       2.5
Release:       wiz%{?extraver:0.}1%{?dist}
License:       BSD-4-Clause and Python-2.0
Group:         Development/Languages/Python
URL:           https://github.com/kjd/idna
Summary:       Internationalized Domain Names for Python (IDNA 2008 and UTS #46)

# Install-time parameters
Requires:      python(abi) = %{py_ver}

# Build-time parameters
%if ! 0%{?sles_version}
BuildArch:     noarch
BuildRequires: python-setuptools
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

A library to support the Internationalised Domain Names in Applications
(IDNA) protocol as specified in RFC 5890 et.al. This new methodology,
known as IDNA 2008, can generate materially different results to the
previous standard. The library can act as a drop-in replacement for
the "encodings.idna" module.

# Preparation step (unpackung and patching if necessary)
%setup -q -n %{realname}-%{version}%{?extraver}

python setup.py build

python setup.py install --prefix=%{_prefix} --root=%{buildroot} -O2
[ "%{buildroot}" != "/" ] && find %{buildroot}%{python_sitelib}/%{realname}/ -name "*.pyo" -delete

[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}