nltk/nltk — Issue #96: files installed from RPM are in wrong location on Linux
Author: alexrudnick
Created: 2012-01-17 06:25:59+00:00
State: open

What steps will reproduce the problem? (e.g. include Python source code)
Installing the NLTK RPM from the download page places files in the
incorrect location for linux (specifically RHEL).

What is the expected output?
$ rpm -qpl nltk-2.0b7-1.noarch.rpm
/usr/lib/python2.6/site-packages/nltk-2.0b7-py2.6.egg-info
/usr/lib/python2.6/site-packages/nltk/__init__.py
...

What do you see instead?
$ rpm -qpl nltk-2.0b7-1.noarch.rpm
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/pytho
n2.6/site-packages/nltk-2.0b7-py2.6.egg-info
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/pytho
n2.6/site-packages/nltk/__init__.py
...

In addition, the NLTK RPM should contain the NLTK data, as well.

I've attached a .spec file that should place NLTK's files in the correct
locations. You can also download an RPM and source RPM that I built from
that spec file here: http://www.cs.brandeis.edu/~baumgold/nltk/ (My
RPMs were built using Python 2.4, but the spec file shouldn't care what
version of Python you're running. If you run Python 2.5, it will produce
RPMs compatible with Python 2.5, and so on.)

Migrated from http://code.google.com/p/nltk/issues/detail?id=503

earlier comments

StevenBird1 said, at 2010-05-18T02:51:58.000Z:

Thanks for this. Can you suggest a way to get nltk.spec into the desired location at
build time? Setuptools apparently has an option --spec-file=nltk.spec, but this
doesn't seem to exist in my config.

singingwolfboy said, at 2010-05-19T14:24:00.000Z:

It's probably possible, but I'm not sure how to do it -- I don't know setuptools very well. (You might look into
Distribute, which is supposed to be the next version of setuptools: http://packages.python.org/distribute/) I do
know that, under the covers, "python setup.py bdist_rpm" just calls the "rpmbuild" tool, so presumably you could
just call rpmbuild yourself. (That's what I do for building RPMs, whether they are RPMs of Python modules or of
other projects.)

robinlee.sysu said, at 2010-05-20T04:32:35.000Z:

A package of nltk-0.9.9 has been just pushed to epel-5 testing repo.
https://admin.fedoraproject.org/updates/python-nltk-0.9.9-2.el5

robinlee.sysu said, at 2010-05-20T04:36:11.000Z:

And an nltk-2.0bx rpm has also been updated in Fedora Rawhide.
http://koji.fedoraproject.org/koji/buildinfo?buildID=173792

And I am the new maintainer.