Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

# define prerel
Name:           python-nltk
Epoch:          1
Version:        0.9
Release:        2%{?dist}
Summary:        Natural Language Toolkit

Group:          Development/Libraries
License:        GPLv2
URL:            http://nltk.sf.net/
Source0:        http://osdn.dl.sourceforge.net/sourceforge/nltk/nltk-%{version}%{?prerel}.tar.gz
Patch0:         nltk-0.9-use-sys-yaml.patch
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch:      noarch

Obsoletes:      python-nltk_lite <= 0.6.6-2%{?dist}
Provides:       python-nltk_lite = %{version}-%{release}

BuildRequires:  python-devel tkinter
Requires:       numpy python-matplotlib tkinter PyYAML

%description
NLTK is a Python package that simplifies the construction of programs
that process natural language; and defines standard interfaces between
the different components of an NLP system.  It was designed primarily
to help teach graduate and undergraduate students about computational
linguistics; but it is also useful as a framework for implementing
research projects.


%prep
%setup -q -n nltk-%{version}%{?prerel}
%patch0 -p1 -b .use-sys-yaml


%build
%{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
sed -ie 's|\xD1|-|g' README.txt
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT

# Make scripts executable
pushd $RPM_BUILD_ROOT%{python_sitelib}
pushd nltk
chmod +x stem/{porter,rslp}.py misc/nemo.py corpus/reader/toolbox.py
chmod +x test/{coverage,doctest_driver}.py
popd
chmod +x nltk_contrib/{bioreader/bioreader,toolbox/{settings,language,data}}.py
popd


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt
%{python_sitelib}/nltk
%{python_sitelib}/nltk_contrib
%if 0%{?fedora} >= 9
%{python_sitelib}/nltk-0.9-py2.5.egg-info
%endif


%changelog
* Sat Feb 23 2008 Michel Salim <michel.sylvan@gmail.com> - 1:0.9-2
- Use system PyYAML (bug #432329)

* Sun Jan 20 2008 Michel Salim <michel.sylvan@gmail.com> - 1:0.9-1
- Update to final 0.9
- Add Epoch to clear upgrade path from (old) 1.4.4

* Fri Sep 22 2007 Michel Salim <michel.sylvan@gmail.com> - 0.9-0.2.b2
- BR on tkinter, it is now needed at build time

* Fri Sep 21 2007 Michel Salim <michel.sylvan@gmail.com> - 0.9-0.1.b2
- Updated to 0.9b2
- Renamed back to python-nltk

* Mon Dec 18 2006 Michel Salim <michel.salim@gmail.com> - 0.6.6-2
- Rebuild for development branch

* Mon Oct 30 2006 Michel Salim <michel.salim@gmail.com> - 0.6.6-1
- Initial package