At first, please read Debian documentation about control file.
What you need to specify in debian/control
file are the -dev
packages in section Source
. In the section Package
when you describe resulting binary package in most situation line Depends: ${shlibs:Depends}, ${misc:Depends}
is sufficient. Make sure dh_shlibdeps
is run debian/rules
. As far as I know dh_make
covers that for you - check the dh_make
documentation.
Know the difference between libraries with .so
and .so.some.numbers.here
extenstions. Nice explanation is provided here.
So, in debian/control
you should have one section for source package:
Source: packagename
Build-Depends: packages-dev, other-packages-needed-for-build
[other fields]
and one or more section for binary package(s) built from this source:
Package: packagename
Depends: ${shlibs:Depends}, ${misc:Depends}
[other fields]
How to determine what packages to put in Build-Depends? If you need option -lfoo to successfully link your software, that means you need to have a file libfoo.so available. The -pthread
option implicitly adds -lpthread
option. So, for PCRE you need to have libpcre.so
file, for pthreads - libpthread.so
. When you established names, run dpkg -S
with all those file names as a parameters. You may want to grep
the results to get only .so files, not .so.something.
arturcz@szczaw:~$ dpkg -S libpcre.so libpthread.so | grep '\.so$'
libpcre3-dev:amd64: /usr/lib/x86_64-linux-gnu/libpcre.so
libc6-dev:amd64: /usr/lib/x86_64-linux-gnu/libpthread.so
So, the packages name you want to put as a Build-Dependencies are: libc6-dev and libpcre3-dev. However, another rule is use in Debian. Some packages are considered as build essential and you do not need to put them into Build-Dependencies. libc6-dev is one of those packages. If you properly debianized your software, ${shlibs:Depends}, ${misc:Depends}
would be replaced by proper content.
How will I ensure that this will work, let us say if libcurl4 or libcrypto++99 comes in future.Am I following the correct method or am I missing something.
You won't. If major number changed in the SONAME of the library, it means, the API or behaviour of both of the library changed. You need to compile your software again with the new library, making necessary changes in the code then test it and fix problems.
Further recommended reading: