2

I need to deploy a python project with rpm package. I make it with setuptools library:

python setup.py bdist_rpm    

After command rpm -i myapp.rpm performed application installs to the directory /usr/lib/python2.6/site-packages/. However, I need to install my application to another folder /foo/. How can I gain it?

Loom
  • 9,768
  • 22
  • 60
  • 112
  • python plugins are always installed in /usr/lib/pythonX.Y/site-packages. You can have a subdirectory using `package_dir = {'subdir', ''}` in your setup.py – Chris Maes Apr 20 '16 at 13:02
  • @ChrisMaes - Thank you. Did you mean that it's impossible to install `myapp` to folder `/foo/`? By the way, my application isn't a plugin. – Loom Apr 20 '16 at 13:18
  • I don't know whether it is possible; I just know that usually it installs in /usr/lib/... I'm not that used to it; I just know how to use it as plugins, not as executables for example.. – Chris Maes Apr 20 '16 at 15:02
  • @ChrisMaes - Thank you, anyway. What python plugin is? – Loom Apr 20 '16 at 15:25

1 Answers1

4

There is a way to install rpm to folder /foo/lib/python/:

Make setup.cfg available in setup.py

from setuptools import setup, find_packages
...

setup(
   ...
   setup_cfg=True,
   ...
)

Create setup.cfg in the same directory as setup.py with the following text:

[install]
home=/foo/
Loom
  • 9,768
  • 22
  • 60
  • 112