I'm developing two Ubuntu packages which one depends on the other.
Say, foo
which depends on libfoo
.
I increment foo
and libfoo
's version together. It is always the case that foo
version 1.2.1
depends on libfoo
version 1.2.1
.
What's the standard debian process for building libfoo
and foo
?
Do I have to build and install libfoo
before and only then compile foo
?
Can I have pbuilder
somehow understand foo
needs libfoo
, and install libfoo
before compiling foo
?
What's the best practice for this case
EDIT on extra info in the question:
Pbuild natively does what you want - just provide it with proper dsc file. Have a look at some real example with version in the dependences like
nmap
and look at the
Build-Depends
clause:In your case you need smth like
Original post:
So, let us summarise the comments....
What you need are two clauses from the rule file
debian/control
:I strongly urge you to read the whole Ubuntu Packaging Guide .Your question is addressed at 2.2. The control file . Read also the same information written by Debian team at Debian New Maintainers' Guide, more precisely Chapter 5 - Control files and their fields. The spent time with the manuals will pay off in saving you a lot of troubles in future if you're going to maintain deb packages in your company (or why not in Debian or Ubuntu one day :) ).
If those packages have separate source archives. I mean they are distinct projects. Then Rostislav Kandilarov's answer is the correct one.
Otherwise, If they are in the same source files. Then no worries, if your source compiles & installs well using
make
(cmake
or whatever tool your using). Packaging operation comes after compiling all the source.Quick overview of the process after calling
debuild
...etc (The exact process may override within./debian/rules
file)./debian/tmp/
Separate files to
./debian/tmp/foo/
&./debian/tmp/libfoo/
folders.The binary package to be built should be declared in
./debian/control
file:And the files that should be in each package in
foo.install
&libfoo.install
respectively.Files compressed to debian archives with new generated control files.
Let me answer your questions:
:/ I can't recommend those long manual to get start, but just as references To me the best was looking to real examples:
http://packages.ubuntu.com/source/xenial/vlc
Do you see how many binary packages are build same source! Check at the bottom and download the
*.debian.tar.xz
archive which have all files used to package VLC.No. no need.
No. no need in
Build-Depends:
as it is already available in the source tree. But it needs to be included inDepends:
offoo
binary.