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

cru*_*ahl 5 packaging

我是一个小型开源数据库库的作者,想通过我的 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
Run Code Online (Sandbox Code Playgroud)

我必须提供 /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
Run Code Online (Sandbox Code Playgroud)

或这些:

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
Run Code Online (Sandbox Code Playgroud)

有没有办法“强制”生成 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'.  
Run Code Online (Sandbox Code Playgroud)

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

db1_SOURCES     = db1.c
db1_LDADD       = $(top_builddir)/src/libhamsterdb.la
Run Code Online (Sandbox Code Playgroud)

libhamsterdb.la 确实丢失了。

tum*_*eed 6

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

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

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

创建的文件很容易处理,您只需在clean规则中删除它们,将它们列在debian/clean.

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