1

我正在制作一个供本地使用的 dabian 二进制包。dpkg-buildpackage -rfakeroot由于以下错误而失败。

find /home/dwft78/project/CoreScanner/cscore-1.0/lib -name "libcs*" -type f -exec cp -f {} /home/dwft78/project/CoreScanner/cscore-1.0/debian/cscore/opt/motorola-scanner//bin \;
find /home/dwft78/project/CoreScanner/cscore-1.0/lib -name "libcs*" -type l -exec cp -Rf {} /home/dwft78/project/CoreScanner/cscore-1.0/debian/cscore/opt/motorola-scanner//bin \;
make[1]: Leaving directory `/home/dwft78/project/CoreScanner/cscore-1.0'
   dh_install
   dh_installdocs
   dh_installchangelogs
   dh_installexamples
   dh_installman
   dh_installcatalogs
   dh_installcron
   dh_installdebconf
   dh_installemacsen
   dh_installifupdown
   dh_installinfo
   dh_pysupport
dh_pysupport: This program is deprecated, you should use dh_python2 instead. Migration guide: http://deb.li/dhs2p
   dh_installinit
   dh_installmenu
   dh_installmime
   dh_installmodules
   dh_installlogcheck
   dh_installlogrotate
   dh_installpam
   dh_installppp
   dh_installudev
   dh_installwm
   dh_installxfonts
   dh_installgsettings
   dh_bugfiles
   dh_ucf
   dh_lintian
   dh_gconf
   dh_icons
   dh_perl
   dh_usrlocal
   dh_link
   dh_compress
   dh_fixperms
   dh_strip
   dh_makeshlibs
   dh_shlibdeps
dpkg-shlibdeps: warning: debian/cscore/opt/motorola-scanner/bin/libcs-common.so.1.0.0 contains an unresolvable reference to symbol g_CoreScannerLoggingContext: it's probably a plugin.
dpkg-shlibdeps: warning: 1 similar warning has been skipped (use -v to see it).
dpkg-shlibdeps: error: couldn't find library libcs-comm.so.1.0.0 needed by debian/cscore/opt/motorola-scanner/bin/libcscl-snapi.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: error: couldn't find library libcs-client.so.1.0.0 needed by debian/cscore/opt/motorola-scanner/bin/libcs-jni.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: warning: debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-common.so.1.0.0 contains an unresolvable reference to symbol g_CoreScannerLoggingContext: it's probably a plugin.
dpkg-shlibdeps: warning: 1 similar warning has been skipped (use -v to see it).
dpkg-shlibdeps: error: couldn't find library libcs-comm.so.1.0.0 needed by debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcscl-snapi.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: error: couldn't find library libcs-common.so.1.0.0 needed by debian/cscore/opt/motorola-scanner/bin/libcs-comm.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: error: couldn't find library libcs-common.so.1.0.0 needed by debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-comm.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: error: couldn't find library libcs-common.so.1.0.0 needed by debian/cscore/opt/motorola-scanner/bin/libcs-client.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: error: couldn't find library libcs-common.so.1.0.0 needed by debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-client.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: error: couldn't find library libcs-client.so.1.0.0 needed by debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-jni.so.1.0.0 (ELF format: 'elf64-x86-64'; RPATH: '').
dpkg-shlibdeps: error: Cannot continue due to the errors listed above.
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/cscore.substvars debian/cscore/debian/cscore/opt/motorola-scanner/bin/cscore debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcscl-snapi.so.1.0.0 debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-client.so.1.0.0 debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-common.so.1.0.0 debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-jni.so.1.0.0 debian/cscore/debian/cscore/opt/motorola-scanner/bin/libcs-comm.so.1.0.0 debian/cscore/opt/motorola-scanner/bin/cscore debian/cscore/opt/motorola-scanner/bin/libcscl-snapi.so.1.0.0 debian/cscore/opt/motorola-scanner/bin/libcs-client.so.1.0.0 debian/cscore/opt/motorola-scanner/bin/libcs-common.so.1.0.0 debian/cscore/opt/motorola-scanner/bin/libcs-jni.so.1.0.0 debian/cscore/opt/motorola-scanner/bin/libcs-comm.so.1.0.0 returned exit code 2
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

所有这些库都生成到“ /home/dwft78/project/CoreScanner/cscore-1.0/lib/Linux/x86_64

debian/rules 的内容是

#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DH_COMPAT=5

%:
        dh $@

由于错误消息表明“为了帮助 dpkg-shlibdeps 找到私有库,您可能需要设置 LD_LIBRARY_PATH ”我如何加载这些内部debian/rules文件?或者这是由于其他原因而发生的?

4

2 回答 2

6

像这样的东西可以解决问题:

#!/usr/bin/make -f

export DH_COMPAT=5 # though I don't know what for...

%:
    dh $@

override_dh_shlibdeps:
    dh_shlibdeps -l$(shell pwd)/lib/Linux/$(DEB_BUILD_GNU_CPU)

编辑

我只记得 dh_shlibdeps 有一个选项,它甚至引起了关于在 cross-builds 中设置 LD_LIBRARY_PATH 的问题的注意,所以这应该是选择的选项。免责声明:我没有测试它。(不过,我很好奇它是否可行。)请参阅dh_shlibdeps 手册页

于 2014-05-30T13:15:07.383 回答
1

只是出口怎么LD_LIBRARY_PATHdebian/rules

 #!/usr/bin/make -f

 export LD_LIBRARY_PATH=$(shell pwd)/lib/Linux/$(DEB_BUILD_GNU_CPU)

 %:
      dh $@

笔记

我在$(DEB_BUILD_GNU_CPU)这里使用来计算x86_64的值。这可能会给出正确的结果(它将在 32 位系统上返回i386),但很可能不是包的构建系统用于确定路径的体系结构特定部分的内容,因此可能会失败。

另一种选择(也是一个疯狂的猜测)是使用$(shell uname -m)(它将在大多数现代 32 位系统上返回i686 ,在 64 位系统上返回x86_64 )。

为了找出你真正应该在这里使用的东西,你可能需要检查你的包的构建系统。

边注

您可能不应该设置级别DH_COMPATdebian/rules而是使用debian/compat文件:

$ echo 5 > debian/compat
于 2014-06-03T07:52:36.483 回答