[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getting package build dependencies

Ross Boylan <ross@biostat.ucsf.edu> writes:

> I am interested in getting build-dependencies for a source package on
> a system using aptitude.  In the past I've used apt-get build-dep, but
> that was on systems managed with apt-get.  I think aptitude won't know
> about apt-get's selections, and may toss the packages at the first
> chance (or perhaps get confused in some other way).
> Is this analysis correct?  If so, is there a good solution?
> The two other routes I see are to use dpkg-checkbuilddeps (but then I
> still need to get the output into aptitude) or to use one of the
> autobuilders that work in a chroot (which seems kind of heavy weight).
> Thanks.
> Ross Boylan
> cc's appreciated.
> P.S. apt-get build-dep has always made me a bit uncomfortable, since I
> presume it goes by the installed binary package.  If you want to build
> some other version (e.g., system is testing but you want to build
> unstable) the dependencies aren't necessarily quite right.  So I'd be
> happy to discover an alternative.

apt-get build-dep goes by the Sources file. Binary packages don't even
have that information.

As to your real problem. I was playing around with building dummy
packages (src-<pkg>) on the fly from the Sources file that depends on
all Build-Depends. The idea was that you would 'aptitude install
src-foo' to install the build-depends for foo and src-foo would be
flagged manual then. Removing src-foo would drop all the build-depends

I did this as apt-get and dpkg-deb wrapper when I played around with
it. You would have to extend it to wrap aptitude update as well.

If you want to revive the idea here is what you need:

1. pick a dummy deb on the server that has the Sources file.
2. Add a wrapper for aptitude update that does a normal update and
generates a fake Packages files from the Sources file it updated and
then runs apt-get -d update (or the python equivalent to update the
3. Add a wrapper for dpkg-deb that detects when it is asked to install
the dummy deb from 1 and then instead hands dpkg an empty data.tar.gz
and a fake control.tar.gz reflecting the Build-Depends (as
depends). You basically build the fake deb that is listed in Packages
at this point and pass it to dpkg.

When you update you just generate the fake Packages file.
When you install aptitude downloads the dummy deb, renames that to the
src-foo name (at least apt does) and then calls dpkg. dpkg calls
dpkg-deb (your wrapper) which ignores the dummy deb, builds a fake one
and passes that back to dpkg. Aptitude pulls in the build-depends as
depends from the fake Packages file.


PS: alternatively to an apt wrapper an apt download method could work too.

Reply to: