dpkg-shlibdeps: error: couldn't find library needed by .so while packaging a package dependent on my another package
-
The problem reside the
base
package. It does install the shared object in a wrong path/usr/lib/x86_64/
where it should be in
/usr/lib/x86_64-linux-gnu/
-
Following from your previous question, you have made some changes to
CMakeLists.txt
to install library not in/usr/lib/
using:include(TargetArch.cmake) target_architecture(arch) ... install(TARGETS ${PROJECT_NAME} DESTINATION lib/${arch}) ... install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc" DESTINATION lib/${arch}/pkgconfig RENAME "lib${PROJECT_NAME}.pc")
The new variable
${arch}
is replacedx86_64
. -
I could find a Debian manual explains the move to MultiArch for
cmake
projects.A new GNUInstallDirs module was added to cmake v3.3.
-
Include the new module for MultiArch paths support
include(GNUInstallDirs)
Then use
CMAKE_INSTALL_LIBDIR
(/usr/lib/<triplet>
) variable instead.
-
Just small note about
base
package naming to follow Debian policy the binary file don't contain executable files. Hence, better to name them withlib
prefix,libbase1
&libbase-dev
.
Related videos on Youtube
Necktwi
Updated on September 18, 2022Comments
-
Necktwi over 1 year
I have packaged a library named
base
and uploaded to myppa:satyagowtham-k-gmail/ferryfair.ppa
. launchpad has successfully built thebase
package and I successfully installed it bysudo apt install base-dev
. Now I am packaging another library calledlogger
which depends onbase
.I have added my
ppa
topbuilder chroot
by$ sudo cp ~/pbuilder/xenial-base.tgz /var/cache/pbuilder/base.tgz $ pbuilder login --save-after-login # apt-add-repository ppa:satyagowtham-k-gmail/ferryfair.ppa # apt-get update # exit
pbuilder-dist xenial build logger_1.0-0ubuntu1.dsc is giving below error
... ... install -d debian/logger-dev/DEBIAN dpkg-shlibdeps -Tdebian/logger1.substvars -l/build/logger-1.0/lib/x86_64 --ignore-missing-info debian/logger1/usr/lib/x86_64/liblogger.so.1.0 dpkg-shlibdeps: error: couldn't find library libbase.so.1 needed by debian/logger1/usr/lib/x86_64/liblogger.so.1.0 (ELF format: 'elf64-x86-64'; RPATH: '') dpkg-shlibdeps: error: cannot continue due to the error 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 use -l. dh_shlibdeps: dpkg-shlibdeps -Tdebian/logger1.substvars -l/build/logger-1.0/lib/x86_64 --ignore-missing-info debian/logger1/usr/lib/x86_64/liblogger.so.1.0 returned exit code 2 debian/rules:10: recipe for target 'override_dh_shlibdeps' failed make[1]: *** [override_dh_shlibdeps] Error 2 make[1]: Leaving directory '/build/logger-1.0' debian/rules:13: recipe for target 'binary' failed make: *** [binary] Error 2 dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 ... ...
debian/rules
#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 override_dh_auto_test: override_dh_usrlocal: override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -l$(shell pwd)/lib/$(shell uname -m) %: dh $@ --buildsystem=cmake
debian/control
Source: logger Priority: optional Maintainer: Satya Gowtham Kudupudi <[email protected]> Build-Depends: debhelper (>= 9), cmake, base-dev Standards-Version: 3.9.7 Section: non-free/libs Homepage: https://github.com/necktwi/logger Vcs-Git: https://github.com/necktwi/logger.git Vcs-Browser: https://github.com/necktwi/logger Package: logger-dev Section: non-free/libdevel Architecture: any Depends: logger1 (= ${binary:Version}), ${misc:Depends}, base1 Description: logger from ferryfair.com It logs a beautiful and useful format. Package: logger1 Section: non-free/libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, base1 Description: logger from ferryfair.com It logs a beautiful and useful format.
-
Necktwi over 7 yearsI couldn't
pbuilder-dist
:base1 base-dev Untrusted packages could compromise your system's security
. anyway I have uploaded thedsc
and the package is successfully hosted in theppa
. -
Necktwi over 7 yearsas you suggested I have added
lib
prefix. now there is a lintian warningW: libbase1: empty-binary-package
. Yep I have seen the contents of.deb
: It got only 2 fileschangelog.Debian.gz
andcopyright
-
user.dz over 7 years@neckTwi, Have you renamed the
debian/*.install
files? -
Necktwi over 7 yearsthere are no .install files
-
Necktwi over 7 yearsthis time I am using
gbp buildpackage --git-upstream-tag='v1.0' --git-debian-branch=ubuntu/xenial --git-upstream-branch=master
to generate deb files -
user.dz over 7 yearsI don't see any
ubuntu/xenial
branch in your git repositories at github.com/necktwi/base & github.com/necktwi/logger -
user.dz over 7 years@neckTwi, also no tag with this label
v1.0
. try simple use as you have debian folder in same tree/branch with the sourcegbp buildpackage
-
Necktwi over 7 yearsLet us continue this discussion in chat.