Debian 如何在“中加载专用共享库”;规则“;在deb包装中制作文件
我正在制作一个供本地使用的大边二进制软件包<代码>dpkg buildpackage-rfakeroot因以下错误而失败Debian 如何在“中加载专用共享库”;规则“;在deb包装中制作文件,debian,ubuntu-12.04,deb,software-packaging,Debian,Ubuntu 12.04,Deb,Software Packaging,我正在制作一个供本地使用的大边二进制软件包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/dwft
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
文件中加载这些库?或者,这是由于另一个原因造成的?类似的事情可能会起作用:
#!/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有一个选项,甚至,所以这应该是选择的选项。免责声明:我没有测试它。(不过,我很好奇它是否能奏效。)看看。类似的东西能起到什么作用:
#!/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有一个选项,甚至,所以这应该是选择的选项。免责声明:我没有测试它。(不过,我很好奇它是否有效。)请参见。在
debian/rules
中导出LD_LIBRARY\u路径如何
#!/usr/bin/make -f
export LD_LIBRARY_PATH=$(shell pwd)/lib/Linux/$(DEB_BUILD_GNU_CPU)
%:
dh $@
笔记
我在这里使用$(DEB\u BUILD\u GNU\u CPU)
来计算x86\u 64的值。
这可能会给出正确的结果(它将在32位系统上返回i386),但很可能不是包的构建系统用来确定路径中特定于体系结构的部分的结果,因此可能会失败
另一种选择(也是一种猜测)是使用$(shell uname-m)
(在大多数现代32位系统上返回i686,在64位系统上返回x86_64)
为了找出您真正应该在这里使用什么,您可能需要检查包的构建系统
旁注
您可能不应该在debian/rules
中设置DH_COMPAT
级别,而应该使用debian/COMPAT
文件:
$ echo 5 > debian/compat
在debian/rules
中导出LD\u库路径如何
#!/usr/bin/make -f
export LD_LIBRARY_PATH=$(shell pwd)/lib/Linux/$(DEB_BUILD_GNU_CPU)
%:
dh $@
笔记
我在这里使用$(DEB\u BUILD\u GNU\u CPU)
来计算x86\u 64的值。
这可能会给出正确的结果(它将在32位系统上返回i386),但很可能不是包的构建系统用来确定路径中特定于体系结构的部分的结果,因此可能会失败
另一种选择(也是一种猜测)是使用$(shell uname-m)
(在大多数现代32位系统上返回i686,在64位系统上返回x86_64)
为了找出您真正应该在这里使用什么,您可能需要检查包的构建系统
旁注
您可能不应该在debian/rules
中设置DH_COMPAT
级别,而应该使用debian/COMPAT
文件:
$ echo 5 > debian/compat
虽然这可能会“起作用”,但这确实是自找麻烦:这里给出的完整路径只有在包由给定的用户(dwft78)构建并且他们不更改文件系统布局并且cscore
锁定到版本1.0时才有效;这些都是解决许多约束的方法。相反,使用$(shell pwd)
应该会给您带来更好的结果。我假设在构建debian软件包的人身上会出现这种明显的情况。但你可以用这个。然而,它忽略了作为路径一部分的体系结构,因此也依赖于构建,就像您的解决方案忽略了这个细节一样。没问题,而且,作为奖励;)-我还添加了arch变量。@umläute您在解决方案的架构中仍然使用了错误的变量。这是DEB_BUILD_GNU_CPU,而不是DEB_BUILD_ARCH。正如我在回答中提到的,架构的正确值取决于包的构建系统;最有可能的是,它与任何DEB_
-变量完全无关(尽管您是对的,DEB_BUILD_ARCH
的计算结果为“amd64”,这是错误的),尽管这可能“只是起到了作用”,但它确实是在自找麻烦:这里给出的完整路径只在包由给定用户构建时才有效(dwft78)而且他们不改变文件系统布局,cscore
被锁定为1.0版;这些都是解决许多约束的方法。相反,使用$(shell pwd)
应该会给您带来更好的结果。我假设在构建debian软件包的人身上会出现这种明显的情况。但你可以用这个。然而,它忽略了作为路径一部分的体系结构,因此也依赖于构建,就像您的解决方案忽略了这个细节一样。没问题,而且,作为奖励;)-我还添加了arch变量。@umläute您在解决方案的架构中仍然使用了错误的变量。这是DEB_BUILD_GNU_CPU,而不是DEB_BUILD_ARCH。正如我在回答中提到的,架构的正确值取决于包的构建系统;最有可能的是,它与任何DEB_
-变量完全无关(尽管您是对的,DEB_BUILD_ARCH
的计算结果为“amd64”,这是错误的)。我从ld_PRELOAD中得到错误:ld.so:object'libfakeroot sysv.so'无法预加载(无法打开共享对象文件):忽略。错误:ld.so:ld_PRELOAD中的对象“libfakeroot sysv.so”无法预加载(无法打开共享对象文件):已忽略。dh_testdir-O--buildsystem=cmake
我从ld_PRELOAD中获取了错误:ld.so:object'libfakeroot sysv.so'无法预加载(无法打开共享对象文件):忽略。错误:ld.so:ld_PRELOAD中的对象“libfakeroot sysv.so”无法预加载(无法打开共享对象文件):已忽略。dh_testdir-O--buildsystem=cmake
请参见