%global with_python3 1
%global module_name cltk
Name: python-%{module_name}
Version: 0.0.0.47
Release: 1%{?dist}
Summary: NLP support for Ancient Greek and Latin
License: MIT
URL: https://github.com/kylepjohnson/cltk
Source0: https://pypi.python.org/packages/source/c/%{module_name}/%{module_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%description
The Classical Language Toolkit (CLTK) offers natural language processing support
for Classical languages.
%if 0%{?with_python3}
%package -n python3-%{module_name}
Summary: NLP support for Ancient Greek and Latin
License: MIT
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
%if 0%{?with_python3}
%description -n python3-%{module_name}
The Classical Language Toolkit (CLTK) offers natural language processing support
for Classical languages.
%endif
%prep
%setup -q -n %{module_name}-%{version}
rm -rf *.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root=%{buildroot}
popd
%endif
%{__python2} setup.py install --skip-build --root=%{buildroot}
%files -n python-%{module_name}
%doc PKG-INFO
%{python2_sitelib}/%{module_name}/
%{python2_sitelib}/%{module_name}-%{version}-py2.*.egg-info
%if 0%{?with_python3}
%files -n python3-%{module_name}
%doc PKG-INFO
%{python3_sitelib}/%{module_name}/
%{python3_sitelib}/%{module_name}-%{version}-py3.*.egg-info
%endif
%changelog
* Wed Nov 05 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.0.0.47-1
- update to 0.0.0.47 release
* Sat Nov 01 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.0.0.44-1
- update to 0.0.0.44 release
* Tue Oct 14 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.0.0.34-1
- update to 0.0.0.35 release
* Mon Sep 29 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.0.0.26-1
- update to 0.0.0.26 release
* Mon Sep 22 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.0.0.24-1
- Initial packaging