%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define prerel b2
Name: python-nltk
Version: 0.9
Release: 0.2.%{prerel}%{?dist}
Summary: Natural Language Toolkit
Group: Development/Libraries
License: GPLv2
URL: http://nltk.sf.net/
Source0: http://dl.sourceforge.net/sourceforge/nltk/nltk-%{version}%{?prerel}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
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
%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}
%build
%{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__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/doctest_driver.py
popd
chmod +x nltk_contrib/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
%{python_sitelib}/yaml
%changelog
* Fri Sep 22 2007 Michel Salim <michel.sylvan@gmail.com> - 0.9.0.2.b
- 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