Search code examples
packagingdeb

debian: control file add dependency on the current building version


I'm building a number of packages from one source package, I'd like one of my packages to depend on another package explicitly on the version that is being built and no-other - ie the current version being built.

Depends: original-package-min (= "what do I put here"),

I suspect there's an obvious answer, but I'm not finding it anywhere.

Background:

I'm trying to split a package into two, a minimal and a full version - something like this. The -min package exists because when building for a new distribution there can be circular (runtime) dependencies.

Package: original-package-min
Architecture: all
Depends: ${misc:Depends}
Description: Minimal version of original package
 Useful when bootstrapping new or incomplete distributions

Package: original-package
Architecture: all
Depends: original-package-min (= "what do I put here"),
 # lots of dependencies missing
 ${misc:Depends}
Description: Original package
 Does what the original package does

Solution

  • Apparently the issue is knowing how to ask the right question. The right question here is "what can I put inside ${} in a debian control file"?

    I expected to find the answer in the manual on Declaring relationships between packages, but I eventually found the reference to the reference to the reference here:

    The fields here may contain variable references - their values will be substituted by dpkg-gencontrol, dpkg-genchanges or dpkg-source when they generate output control files. See Variable substitutions: debian/substvars for details.

    To find the available substitutions simply run:

    man deb-substvars
    

    In this case the answer is

    Depends: original-package-min (= ${binary:Version}),
    

    It's possible ${source:Version} could also be appropriate according to the document they are the same, except in specific instances where they are different.