%global with_python3 0
%global module_name freetype
Name: python-%{module_name}
Version: 0.4.2
Release: 2%{?dist}
Summary: Freetype python bindings
License: BSD
URL: https://github.com/rougier/freetype-py
Source0: https://pypi.python.org/packages/source/f/%{module_name}-py/%{module_name}-py-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{with_python3}
%package -n python3-%{module_name}
Summary: Freetype python bindings
License: MIT
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
%description
Freetype python bindings.
%if 0%{with_python3}
%description -n python3-%{module_name}
Freetype python bindings.
%endif
%prep
%setup -q -n %{module_name}-py-%{version}
#we don't want Vera.ttf to be installed
sed -i '15d' setup.py
rm -rf *.egg-info
sed -i -e '/^#!\//, 1d' freetype/*.py
sed -i -e '/^#!\//, 1d' freetype/ft_enums/*.py
%build
%{__python2} setup.py build
%if 0%{with_python3}
echo ${_python3}
%{__python3} setup.py build
%endif
%install
%{__python2} setup.py install --skip-build --root=%{buildroot}
%if 0%{with_python3}
%{__python3} setup.py install --skip-build --root=%{buildroot}
%endif
%files -n python-%{module_name}
%doc examples LICENSE.txt
%{python2_sitelib}/%{module_name}/
%{python2_sitelib}/%{module_name}_py-%{version}-py2.7.egg-info
%if 0%{?with_python3}
%files -n python3-%{module_name}
%doc examples LICENSE.txt
%{python3_sitelib}/%{module_name}/
%{python3_sitelib}/%{module_name}_py-%{version}-py3.*.egg-info
%endif
%changelog
* Fri Oct 24 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.4.2-2
- License is BSD not MIT
* Mon Sep 22 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.4.2-1
- Initial packaging