%global pypi_name PyNLPl %global pkg_name pynlpl Name: python-%{pkg_name} Version: 1.0.9 Release: 1%{?dist} Summary: A Python library for Natural Language Processing License: GPLv3 URL: https://github.com/proycon/%{pkg_name} Source0: https://github.com/proycon/%{pkg_name}/archive/v%{version}.tar.gz#/%{pkg_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-setuptools BuildRequires: python2-devel BuildRequires: python-lxml >= 2.2 BuildRequires: python-httplib2 >= 0.6 BuildRequires: python3-setuptools BuildRequires: python3-devel BuildRequires: python3-lxml >= 2.2 BuildRequires: python3-httplib2 >= 0.6 # Required to build docs BuildRequires: python3-sphinx BuildRequires: python3-twisted %description PyNLPl, pronounced as ‘pineapple’, is a Python library for Natural Language Processing. It contains various modules useful for common, and less common, NLP tasks. PyNLPl can be used for basic tasks such as the extraction of n-grams and frequency lists, and to build simple language model. There are also more complex data types and algorithms. Moreover, there are parsers for file formats common in NLP (e.g. FoLiA/Giza/Moses/ARPA/Timbl/CQL). There are also clients to interface with various NLP specific servers. PyNLPl most notably features a very extensive library for working with FoLiA XML (Format for Linguistic Annotation). %package -n python2-%{pkg_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pkg_name}} Requires: python-lxml >= 2.2 Requires: python-httplib2 >= 0.6 Requires: python2-setuptools Requires: python2-numpy %description -n python2-%{pkg_name} PyNLPl, pronounced as ‘pineapple’, is a Python library for Natural Language Processing. It contains various modules useful for common, and less common, NLP tasks. PyNLPl can be used for basic tasks such as the extraction of n-grams and frequency lists, and to build simple language model. There are also more complex data types and algorithms. Moreover, there are parsers for file formats common in NLP (e.g. FoLiA/Giza/Moses/ARPA/Timbl/CQL). There are also clients to interface with various NLP specific servers. PyNLPl most notably features a very extensive library for working with FoLiA XML (Format for Linguistic Annotation). %package -n python3-%{pkg_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pkg_name}} Requires: python3-lxml >= 2.2 Requires: python3-httplib2 >= 0.6 Requires: python3-setuptools Requires: python3-numpy %description -n python3-%{pkg_name} PyNLPl, pronounced as ‘pineapple’, is a Python library for Natural Language Processing. It contains various modules useful for common, and less common, NLP tasks. PyNLPl can be used for basic tasks such as the extraction of n-grams and frequency lists, and to build simple language model. There are also more complex data types and algorithms. Moreover, there are parsers for file formats common in NLP (e.g. FoLiA/Giza/Moses/ARPA/Timbl/CQL). There are also clients to interface with various NLP specific servers. PyNLPl most notably features a very extensive library for working with FoLiA XML (Format for Linguistic Annotation). %package doc Summary: PyNLPl documentation %description doc Documentation for PyNLPl library. %prep %autosetup -n %{pkg_name}-%{version} # Create a soft link with a package name without a version, # to be used when generating documentation pushd %{_builddir} ln -s ./%{pkg_name}-%{version} %{pkg_name} popd # Remove shebangs for lib in `find . -type f -name '*.py'` do sed '1{\@^#!\s\?/usr/bin/env python@d}' $lib > $lib.new && touch -r $lib $lib.new && mv $lib.new $lib done %build %py2_build %py3_build # Generate html docs using the script defined by upstream pushd docs sh make.sh # Remove the sphinx-build leftovers rm -rf build/html/.{doctrees,buildinfo} popd %install pushd build %py3_install popd pushd build %py2_install popd %check # Exclude folia.py, folia_benchmark.py, formats.py and fql.py tests # as they download external resources from Github rm tests/{folia*,formats,fql}.py # Run tests %{__python2} setup.py test -s tests %{__python3} setup.py test -s tests %files -n python2-%{pkg_name} %license LICENSE %doc README.rst # The executables are only installed on python 3 (by statement in setup.py) %{python2_sitelib}/%{pkg_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %files -n python3-%{pkg_name} %license LICENSE %doc README.rst %{_bindir}/pynlpl-computepmi %{_bindir}/pynlpl-sampler %{_bindir}/pynlpl-makefreqlist %{python3_sitelib}/%{pkg_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %files doc %license LICENSE %doc docs/build/html %changelog * Wed Nov 2 2016 Iryna Shcherbina - 1.0.9-1 - Initial package.