override_dh_auto_install在debuild期间不运行

时间:2016-06-03 11:07:01

标签: makefile debian package

我试图关注this guide来创建Debian软件包。 我的makefile是这样的:

prefix = /usr/local
includedir = $(prefix)/include

install:
    cp -r ./Include/* $(DESTDIR)$(includedir)

uninstall:
    rm -rf $(DESTDIR)$(includedir)/ftz/Console

我的debian/rules就是这样:

#!/usr/bin/make -f

%:
    dh $@

override_dh_auto_install:
    $(MAKE) DESTDIR=$$(pwd)/debian/libftzconsole prefix=/usr install

我正在运行debuild -us -uc,我的构建日志是这样的:

 dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: info: source package libftzconsole
dpkg-buildpackage: info: source version 2016.06.03-1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by FaTony <fatony@fatony.net>
 dpkg-source --before-build fTzConsole
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean
dh clean
   dh_testdir
   dh_auto_clean
   dh_clean
 dpkg-source -b fTzConsole
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building libftzconsole using existing ./libftzconsole_2016.06.03.orig.tar.gz
dpkg-source: info: building libftzconsole in libftzconsole_2016.06.03-1.debian.tar.xz
dpkg-source: info: building libftzconsole in libftzconsole_2016.06.03-1.dsc
 debian/rules build
dh build
   dh_testdir
   dh_update_autotools_config
   dh_auto_configure
   dh_auto_build
    make -j1
make[1]: Entering directory '/home/fatony/Stuff/C++/fTzConsole'
cp -r -i ./Include/* /usr/local/include
cp: './Include/ftz/Console' and '/usr/local/include/ftz/Console' are the same file
Makefile:5: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/fatony/Stuff/C++/fTzConsole'
dh_auto_build: make -j1 returned exit code 2
debian/rules:4: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

看起来override_dh_auto_install没有运行,它会尝试将软件包直接安装到我的系统中。 cp错误是因为我已经对目录进行了符号链接。

我不确定如何修复它。帮助

2 个答案:

答案 0 :(得分:3)

好的,debuild调用dh build,调用dh_auto_build,调用make -j1,选择第一个目标为install

当我添加

all:

install生成文件之前,问题就解决了。

答案 1 :(得分:0)

我遇到了同样的问题,只是删除了override部分。它奏效了。