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 have a package that needs to be build with both a regular makefile and a setup.py. The thing is that the Debian packaging magic that is invoked via debuild would recognize a makefile and do the right

make
make install DESTDIR=???

thing and get it working right. When I only have a setup.py sitting there and have dh $@ --with python3 --buildsystem pybuild in debian/rules, it will correctly install the Python module with

python3 setup.py build
python3 setup.py install --install-layout deb --root=??? ???

I do not know all those flags. And I think that I do not need to. I just want the makefile magic to happen, and then the setup.py magic.

How can I tell debuild to do both?

When I do the following in debian/rules

%:
        dh $@
        dh $@ --with python3 --buildsystem pybuild

it will only put the first one into the resulting package. I tried to delete the debhelper.log between those, but that did not change much.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can use both but in that case your debian/rules will exclusively use overrides:

#!/usr/bin/make -f

%:
    dh $@ --with=python3

override_dh_auto_build:
    make universe-explode-in-delight
    cd python_src && python3 setup.py build

override_dh_auto_test:
    cd python_src && python3 setup.py test

override_dh_auto_install:
    cd python_src && python3 setup.py install \
        --force --root=$(CURDIR)/debian/tmp \
        --no-compile -O0 --install-layout=deb
    make install_non_python_stuff

override_dh_auto_clean:
    cd python_src && python3 setup.py clean

See: http://manpages.ubuntu.com/manpages/trusty/man1/dh.1.html

share|improve this answer
    
I changed the destination directory to $(CURDIR)/debian/PACKAGENAME, but it works otherwise. –  queueoverflow May 28 at 6:51

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.