1

I created an rpm via python setup.py bdist_rpm.

The above command was called inside a virtualenv.

The files in the rpm now contain the absolute path to the virtualenv:

/home/user/...path-to-virtualenv/lib/python2.7/site-packages/

How to alter the paths? I want to install into /usr/lib.

1 Answer 1

3

Edit setup.cfg file (create it if it doesn't exist) and add following section to it

[install]
install-lib=/usr/lib/python2.7/site-packages
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you. Where is the official documentation of setup.cfg and its parameters and sections?
The first problem was solved (I used prefix=/usr to change the path). But there is still something wrong: rpm -qpR dist/foo-1.0.4-1.noarch.rpm requires: /home/user/...path-to-virtualenv/bin/python ... Help, how to solve this?
@guettli docs.python.org/2/distutils/… Create a .spec file or use command-line option --requires (you can put this into setup.cfg too!).
@guettli Also I use Ubuntu and mine rpms do not require python. (test)vagrant@vagrant-ubuntu-utopic-64:/tmp/requests-2.7.0$ rpm -qpR dist/requests-2.7.0-1.noarch.rpm rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.