%global with_python3 1 %global module_name cltk Name: python-%{module_name} Version: 0.0.1.2 Release: 2%{?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 sed -i 's|: object||g' cltk/tag/pos.py cltk/corpus/utils/file_operations.py cltk/tokenize/sentence.py sed -i 's|: str||g' cltk/tag/pos.py cltk/corpus/utils/file_operations.py cltk/tokenize/sentence.py sed -i 's|lang: str|lang|g' cltk/tag/pos.py %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 * Thu Jun 18 2015 Fedora Release Engineering - 0.0.1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri Jan 09 2015 Parag Nemade - 0.0.1.2-1 - update to 0.0.1.2 release * Mon Jan 05 2015 Parag Nemade - 0.0.1.0-1 - update to 0.0.1.0 release * Tue Nov 25 2014 Parag Nemade - 0.0.0.48a-1 - update to 0.0.0.48a release * Wed Nov 05 2014 Parag Nemade - 0.0.0.47-1 - update to 0.0.0.47 release * Sat Nov 01 2014 Parag Nemade - 0.0.0.44-1 - update to 0.0.0.44 release * Tue Oct 14 2014 Parag Nemade - 0.0.0.34-1 - update to 0.0.0.35 release * Mon Sep 29 2014 Parag Nemade - 0.0.0.26-1 - update to 0.0.0.26 release * Mon Sep 22 2014 Parag Nemade - 0.0.0.24-1 - Initial packaging