“dh_install:hamsterdb-dev 缺少文件 (usr/lib/pkgconfig/*),中止”构建包

“dh_install:hamsterdb-dev 缺少文件 (usr/lib/pkgconfig/*),中止”构建包

我是一个小型开源数据库库的作者,想通过我的 ppa 提供 .deb 包。我遇到了几个问题。我按照文档和几个教程创建了一个 debian/ 目录,但当我运行“dpkg-buildpackage -rfakeroot”时,出现了以下错误:

dh_install: hamsterdb-dev missing files (usr/lib/pkgconfig/*), aborting
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

我是否必须提供 /usr/lib/pkgconfig/hamsterdb-dev.pc?

在构建过程中,单元测试启动,许多文件被创建或修改。当我再次运行 dpkg-buildpackage 时,我收到许多错误,以下是摘录:

dpkg-source: error:   old version is plain file
dpkg-source: error: cannot represent change to hamsterdb/install-sh:
dpkg-source: error:   new version is symlink to /usr/share/automake-1.11/install-sh
dpkg-source: error:   old version is plain file

或者这些:

dpkg-source: error: cannot represent change to tools/tests/db1.db: binary file contents changed
dpkg-source: error: add tools/tests/db1.db in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: warning: executable mode 0775 of 'tools/tests/export_import.sh' will not be represented in diff
dpkg-source: warning: executable mode 0775 of 'tools/tests/ham_dump/generate.sh' will not be represented in diff
dpkg-source: warning: executable mode 0775 of 'tools/tests/ham_dump/compare.sh' will not be represented in diff
dpkg-source: warning: executable mode 0775 of 'tools/tests/ham_info/generate.sh' will not be represented in diff
dpkg-source: warning: file hamsterdb/documentation/latex/namespacehamsterdb.tex has no final newline (either original or modified version)
dpkg-source: warning: file hamsterdb/documentation/latex/index.tex has no final newline (either original or modified version)
dpkg-source: error: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -b hamsterdb gave error exit status 2

有没有办法“强制”生成 deb 文件?或者干脆忽略那些“无法表示的源代码更改”错误?

我设法修复了上面列出的错误,但现在又遇到了另一个错误(也可能是由于我对 automake 缺乏了解造成的)。debuild 在库源上运行“libtool”,但不会创建任何输出文件(至少我找不到任何输出文件)。然后构建示例失败并出现错误:

make[3]: Entering directory `/home/chris/prj/hamsterdb/samples'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I../include -I../include   -g -O2 -Wall -DHAM_LITTLE_ENDIAN -fno-tree-vectorize -D_FILE_OFFSET_BITS=64 -c db1.c
make[3]: *** No rule to make target `../src/libhamsterdb.la', needed by `db1'.  

这是我调用构建命令的方式:

db1_SOURCES     = db1.c
db1_LDADD       = $(top_builddir)/src/libhamsterdb.la

libhamsterdb.la 确实丢失了。

答案1

我必须提供 /usr/lib/pkgconfig/hamsterdb-dev.pc 吗?

如果你在 中列出它debian/hamsterdb-dev.install,那么是的。它不会凭空出现。

在构建过程中,启动单元测试并创建或修改许多文件。

创建的文件很容易处理,只需在规则中将其删除clean,方法是将其列出debian/clean

至于修改文件,您有几个选择。如果可以从头开始重新创建它们,请将其删除cleandpkg-source忽略已删除的文件。否则,您必须弄清楚如何不修改它们,或者撤消修改。

相关内容