Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to package a software that contains both C++ and Python code. The C++ headers and libraries compile fine on launchpad and are properly installed (thanks to some .install files).

On the Python side of things, the names of the (raw) install files would be

/build/buildd/trilinos-11.1~20130107/debian/tmp/usr/lib/python2.7/dist-packages/PyTrilinos/AztecOO.py
/build/buildd/trilinos-11.1~20130107/debian/tmp/usr/lib/python2.7/dist-packages/PyTrilinos/AztecOO.pyc
/build/buildd/trilinos-11.1~20130107/debian/tmp/usr/lib/python2.7/dist-packages/PyTrilinos/_AztecOO.so

What's the proper way to have them installed? Should I also create an .install file listing those files, or is there way to use dh_python2?

share|improve this question
add comment

2 Answers

Both. First you install them, then you call dh_python2.

dh_python will move things around, remove .pyc files, and handle byte-compilation at installation time.

share|improve this answer
    
What do you mean by "then"? Is a dedicated install target in debian/rules necessary that controls the installation and also calls dh_python2? –  Nico Jan 12 '13 at 18:35
    
dh_install is to put them in the right package. You need to make sure that dh_python2 gets called, but that usually wouldn't happen in an install target... –  tumbleweed Jan 12 '13 at 19:19
add comment

The usual thing to do is to create a setup.py file and then call this from your rules file. With dh, your rules file, at least the python part, can then be as simple as

%:
        dh $@ --with python2 --buildsystem=python_distutils --install-layout=deb
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.