LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python-idna.spec of Package python-idna (Project home:aevseev)

%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)
%endif

# 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
%endif
BuildRequires: python-setuptools
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

%description
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)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}

%build
python setup.py build

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

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

%files
%defattr(-,root,root)
%doc HISTORY.rst LICENSE.rst README.rst
%{python_sitelib}/%{realname}/
%{python_sitelib}/%{realname}-%{version}-py%{py_ver}.egg-info/

%changelog