LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File nltk-data-punkt.spec of Package nltk-data-punkt (Project home:pamtdoh:nltk_data)

#
# spec file for package python3-nltk-punkt
#
# Copyright (c) 2017 John Vandenberg.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define packgroup tokenizers
%define pack punkt
Name:           nltk-data-%{pack}
Version:        0.2
Release:        20130826gita2d463f
Url:            http://nltk.org/
Summary:        Natural Language Toolkit Data %{packgroup} %{pack}
License:        Apache-2.0
Group:          Development/Languages/Python
Source0:        https://github.com/nltk/nltk_data/raw/gh-pages/packages/%{packgroup}/%{pack}.zip
Source1:        https://github.com/nltk/nltk_data/raw/gh-pages/packages/%{packgroup}/%{pack}.xml
BuildRequires:  python3-nltk
BuildRequires:  unzip
Recommends:     python-nltk
Recommends:     python3-nltk
BuildArch:      noarch

%description
NLTK -- the Natural Language Toolkit Data %{packgroup} %{pack}.

%prep
#

%build
#

%install
mkdir -p %{buildroot}/%{_datarootdir}/nltk_data/%{packgroup}/
cp %{_sourcedir}/%{pack}.* %{buildroot}/%{_datarootdir}/nltk_data/%{packgroup}/
cd %{buildroot}/%{_datarootdir}/nltk_data/%{packgroup}/
unzip %{_sourcedir}/%{pack}.zip
rm %{pack}/PY3/README
chmod o-w %{pack}/PY3/*.pickle
ls -al punkt

%check
export NLTK_DATA=%{buildroot}/%{_datarootdir}/nltk_data/
python3 -c 'import nltk; nltk.data.load("nltk:%{packgroup}/%{pack}/english.pickle")'

%files
%defattr(-, root, root)
%doc %{_datarootdir}/nltk_data/%{packgroup}/%{pack}/README
%{_datarootdir}/nltk_data

%changelog