forked from pool/python-nltk
Accepting request 558587 from home:badshah400:branches:devel:languages:python
- Update to version 3.2.5:
* Arabic stemmers (ARLSTem, Snowball)
* NIST MT evaluation metric and added NIST
international_tokenize
* Moses tokenizer
* Document Russian tagger
* Fix to Stanford segmenter
* Improve treebank detokenizer, VerbNet, Vader
* Misc code and documentation cleanups
* Implement fixes suggested by LGTM
- Convert specfile to python single-spec style.
- Drop unneeded BuildRequires: python-PyYAML, python-xml,
python-devel; not required for building.
- Change existing Requires to Recommends: these are really needed
for additional features, and not required for basic nltk usage.
- Add new Recommends: python-scipy, python-matplotlib,
python-pyparsing, and python-gensim; enables other optional
features.
- Run fdupes to link-up duplicate files.
- Remove exec permissions for a file not intended to be executed
(not in exec path, no hashbang, etc.)
- Remove hashbangs from non-executable files.
- Run tests following the suggestion from
http://www.nltk.org/install.html.
OBS-URL: https://build.opensuse.org/request/show/558587
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-nltk?expand=0&rev=9
This commit is contained in:
@@ -16,29 +16,26 @@
|
||||
#
|
||||
|
||||
|
||||
%define pyname nltk
|
||||
Name: python-nltk
|
||||
Version: 3.2.2
|
||||
Version: 3.2.5
|
||||
Release: 0
|
||||
Url: http://nltk.org/
|
||||
Summary: Natural Language Toolkit
|
||||
License: Apache-2.0
|
||||
Group: Development/Languages/Python
|
||||
Source: https://files.pythonhosted.org/packages/source/n/nltk/nltk-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Url: http://nltk.org/
|
||||
Source: https://files.pythonhosted.org/packages/source/n/nltk/%{pyname}-%{version}.tar.gz
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module six}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-PyYAML
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-setuptools
|
||||
BuildRequires: python-xml
|
||||
Requires: python-PyYAML
|
||||
Requires: python-numpy
|
||||
Requires: python-tk
|
||||
Requires: python-xml
|
||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%else
|
||||
Recommends: python-gensim
|
||||
Recommends: python-matplotlib
|
||||
Recommends: python-numpy
|
||||
Recommends: python-pyparsing
|
||||
Recommends: python-requests
|
||||
Recommends: python-scipy
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
NLTK -- the Natural Language Toolkit -- is a suite of open source
|
||||
@@ -46,18 +43,31 @@ Python modules, data sets and tutorials supporting research and
|
||||
development in Natural Language Processing.
|
||||
|
||||
%prep
|
||||
%setup -q -n nltk-%{version}
|
||||
%setup -q -n %{pyname}-%{version}
|
||||
|
||||
sed -i "1,4{/\/usr\/bin\/env/d}" nltk/corpus/reader/knbc.py
|
||||
sed -i "1,4{/\/usr\/bin\/env/d}" nltk/test/runtests.py
|
||||
sed -i "1,4{/\/usr\/bin\/env/d}" nltk/test/unit/test_tgrep.py
|
||||
sed -i "1,4{/\/usr\/bin\/env/d}" nltk/tgrep.py
|
||||
sed -i "1,4{/\/usr\/bin\/env/d}" nltk/tokenize/stanford_segmenter.py
|
||||
|
||||
%build
|
||||
python setup.py build
|
||||
%python_build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root="%{buildroot}"
|
||||
%fdupes $RPM_BUILD_ROOT/
|
||||
%python_install
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%{python_expand %fdupes -s %{buildroot}%{$python_sitelib}/
|
||||
chmod -x %{buildroot}%{$python_sitelib}/nltk/test/dependency.doctest
|
||||
}
|
||||
|
||||
%check
|
||||
# FOLLOWING http://www.nltk.org/install.html
|
||||
%python_exec -c "import nltk" || exit 1
|
||||
|
||||
%files %{python_files}
|
||||
%doc LICENSE.txt
|
||||
%{python_sitelib}/*
|
||||
%{python_sitelib}/%{pyname}/
|
||||
%{python_sitelib}/%{pyname}-%{version}-py%{py_ver}.egg-info/
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user