2

I am trying to publish my cmake project to ppa at launchpad. The project is a library named "base".

bzr builddeb -- -us -uc -sd fails with following error while trying to fake install dev version of the package.

...
...
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: "None"
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/lib/libbase.so.1.0
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/lib/libbase.so.1
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/lib/libbase.so
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/myxml.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/Socket.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/ClientSocket.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/mycurl.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/mystdlib.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/ServerSocket.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/JPEGImage.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/SocketException.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/FerryTimeStamp.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/myconverters.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/include/ferryfair/base/baseConfig.h
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/lib/pkgconfig/libbase.pc
-- Installing: /home/gowtham/Packages/build-area/base-1.1/debian/tmp/usr/share/pkgconfig/libbase.pc
make[1]: Leaving directory '/home/gowtham/Packages/build-area/base-1.1/obj-x86_64-linux-gnu'
  dh_install -O--buildsystem=cmake
dh_install: base-dev missing files: usr/lib/*/lib*.so
dh_install: base-dev missing files: usr/lib/*/pkgconfig/*
dh_install: base1 missing files: usr/lib/*/lib*.so.*
dh_install: missing files, aborting
debian/rules:11: recipe for target 'binary' failed
make: *** [binary] Error 20
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -sd failed
bzr: ERROR: The build failed.

how to differ builddeb for dev version of the package at installing header files

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:

%:
    dh $@ --buildsystem=cmake
Necktwi
  • 1,057

1 Answers1

2

The paths in base-dev.install and base1.install are wrong.

dh_install: base-dev missing files: usr/lib/*/lib*.so
dh_install: base-dev missing files: usr/lib/*/pkgconfig/*
dh_install: base1 missing files: usr/lib/*/lib*.so.*

They will be correct as below and package can be built:

usr/lib/lib*.so
usr/lib/pkgconfig/*

usr/lib/lib*.so.*

But you will have lintian messages that /usr/lib/ is not safe for multi-arch system installations.

  • Either you fix it at source level (as upstream developer), so cmake install those files to /usr/lib/<HOST-ARCH-FOLDER>/. Which is the correct way.

  • Or you fix it at packaging level (as packager), by overriding installation paths in base-dev.install and base1.install

    #!/usr/bin/dh-exec
    
    usr/lib/lib*.so /usr/lib/${DEB_HOST_MULTIARCH}
    usr/lib/pkgconfig/* /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig
    
    usr/lib/lib*.so.* /usr/lib/${DEB_HOST_MULTIARCH}
    
user.dz
  • 48,105
  • 1
    Though I intend to run my library on multiple architectures, I didn't write any thing specific for each architecture. So is it proper to put my library under architecture folder? – Necktwi Nov 21 '16 at 02:49
  • @neckTwi, in multi-arch systems, user can install base1:amd64 or/and base1:i386, (1) your packages overwrite same files, you should put in debian/control that they break each other. (2) Can a program linked to an architecture run versus the other one, if your library is explicitly verified for portability between arch's then you are safe. – user.dz Nov 21 '16 at 08:38
  • do multi-arch systems exist!! I always thought a system is of single architecture at a time. – Necktwi Nov 22 '16 at 03:19
  • @neckTwi, yeah its support starts with Ubuntu 12.04 . If you have a 64bit base installation you can enable 32bit packages installation. See https://askubuntu.com/questions/454253/how-to-run-32-bit-app-in-ubuntu-64-bit/ . You may notice that wine, skype and few 3rd party tools are released as i386 (32bit) for Ubuntu >=12.04, whatever the system is amd64 or i386 same package could be installed with all its i386 dependencies. – user.dz Nov 22 '16 at 06:24
  • yes, thank you. Please look into my other question http://askubuntu.com/questions/852164/dh-auto-configure-with-buildsystem-cmake-failing – Necktwi Nov 22 '16 at 07:26
  • 2
    pbuild is not including /usr/lib/${DEB_HOST_MULTIARCH} by default I have to do link_directories(/usr/lib/${DEB_HOST_MULTIARCH}) in CMakeLists.txt – Necktwi Nov 26 '16 at 08:13
  • @neckTwi , Which Ubuntu release and cmake version you are using? I was expecting cmake will use same paths used by ld. In Ubuntu 16.04 64bit, the are declared in /etc/ld.so.conf.d/x86_64-linux-gnu.conf & /etc/ld.so.conf.d/i386-linux-gnu.conf . (possible bug report) – user.dz Nov 26 '16 at 12:03
  • 2
    I think I am wrong; I am building another package(logger) dependent on my previous package(base). I have done 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 – Necktwi Nov 26 '16 at 15:27
  • please look into http://askubuntu.com/questions/853890/dpkg-shlibdeps-error-couldnt-find-library-needed-by-so-while-packaging-a-pac thank you – Necktwi Nov 26 '16 at 16:16