简体   繁体   English

创建.deb-package时更改python包的安装路径

[英]Change install path for python package when creating .deb-package

I'm trying to create a deb-package from distribution in a tarball. 我正在尝试从tarball中分发创建deb包。 It has setup.py file. 它有setup.py文件。 My actions are: 我的行动是:

python setup.py --command-packages=stdeb.command sdist_dsc
cd deb_dist/<pkgname>
debuild -uc -us -i -b

Everything works fine. 一切正常。 But when i do 但是,当我这样做

dpkg -i <pkgname>.deb

all package module's files are installs into /usr/share/pyshared/<pkgname> directory and i want to change it. 所有包模块的文件都安装在/usr/share/pyshared/<pkgname>目录中,我想更改它。

Is it possible? 可能吗? How? 怎么样?

Thanks. 谢谢。

That's the right directory for installation of Python system libraries, according to Debian Python Policy . 根据Debian Python Policy ,这是安装Python系统库的正确目录。 The generated deb source ought to be arranging for those files to be symlinked into the appropriate /usr/lib/python2.*/dist-packages directories, based on what Python versions are installed. 根据安装的Python版本,生成的deb源应该安排将这些文件符号链接到相应的/usr/lib/python2.*/dist-packages目录中。 That would be normally be taken care of by the dh_python2 tool during package build; 在包构建期间, dh_python2工具通常会处理这种dh_python2 ; it should put calls to update-python-modules in the generated postinst. 它应该在生成的postinst中调用update-python-modules

That behavior can be changed, but the right way to change it depends on the reason you want to change it. 这种行为可以改变,但改变它的正确方法取决于你想要改变它的原因。 What part of this process isn't working for you? 这个过程的哪一部分不适合你?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM