%global pypi_name tinycss %global pypi_oname tinycss %define python3 1 Name: python-%{pypi_name} Version: 0.3 Release: %mkrel 2 Group: Development/Python Summary: tinycss is a complete yet simple CSS parser for Python License: MIT URL: http://pypi.python.org/pypi/%{pypi_name} Source0: http://pypi.python.org/packages/source/c/%{pypi_oname}/%{pypi_oname}-%{version}.tar.gz BuildRequires: pkgconfig(python) BuildRequires: python-setuptools %description tinycss is a complete yet simple CSS parser for Python %if %python3 %package -n python3-%{pypi_name} Summary: tinycss is a complete yet simple CSS parser for Python Group: Development/Python BuildRequires: pkgconfig(python3) BuildRequires: python3-setuptools %description -n python3-%{pypi_name} tinycss is a complete yet simple CSS parser for Python %endif %prep %setup -q -n %{pypi_oname}-%{version} %apply_patches %if %python3 cp -a . %{py3dir} %endif %build %{__python} setup.py build %if %python3 pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if %python3 pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif %{__python} setup.py install -O1 --skip-build --root %{buildroot} %files %py_platsitedir/%{pypi_name}* %if %python3 %files -n python3-%{pypi_name} %py3_platsitedir/%{pypi_name}* %endif