使用两个构建系统构建Debian软件包

我有一个需要使用常规的makefile和setup.py构建的软件包。问题是,通过debuild调用的Debian打包工具会识别到makefile并执行正确的操作。
make
make install DESTDIR=???

在我只有一个`setup.py`文件并且在`debian/rules`中有`dh $@ --with python3 --buildsystem pybuild`时,它将正确安装Python模块。
python3 setup.py build
python3 setup.py install --install-layout deb --root=??? ???

我不认识所有那些旗帜。而且我觉得我不需要知道。我只是希望发生“makefile”的魔法,然后再发生“setup.py”的魔法。 我该如何告诉“debuild”两者都要做? 当我在“debian/rules”中执行以下操作时。
%:
        dh $@
        dh $@ --with python3 --buildsystem pybuild

它只会将第一个放入结果包中。我尝试在它们之间删除debhelper.log,但这并没有改变太多。
1个回答

你可以两者都使用,但在这种情况下,你的debian/rules将只使用覆盖。
#!/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

请参阅:http://manpages.ubuntu.com/manpages/trusty/man1/dh.1.html

我将目标目录更改为$(CURDIR)/debian/PACKAGENAME,但其他方面都正常工作。 - Martin Ueding