During pbuilder build: run setup.py --install-layout=deb fails (no rights to write to /usr/lib/python2.7/dist-packages)

StackOverflow https://stackoverflow.com/questions/17754968

문제

I am trying to create PPA for PJSIP and would like to include the python-bindings.

I modified the Makefile, so that setup.py is called:

install:
     cd somefolder && python setup.py install --install-layout=deb

However, in the pbuilder environment it fails due to insufficient rights on /usr/lib/python2.7/dist-packages/

and I cannot use sudo (obviously)...

Suggestions?

도움이 되었습니까?

해결책

Your debian/rules install target must never install any files outside of the build tree. Instead, it should be installing to the package build directory (which, depending on how you're building the rest of the package, is probably debian/$packagename/. With a setup.py, the right switch to accomplish this is --root=debian/$packagename.

If you use dh_python2, dh_auto_install, and other debhelper tools appropriately, they will take care of that for you, plus a lot of other important housekeeping such as bytecompiling for various python installations on package install.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top