When declaring dependencies in debian/control to create a package, I can specify a lower or upper bound on the version. For example, if I depend on libvtk6-dev being at least version 6.0.0 I can write in the Depends line:
libvtk6-dev (>= 6.0.0)But is it possible to specify a range? For example, if I depend on the version 6.0 or 6.1 of a package, but not 6.2 or 5.9, how would I specify that?
A more complex example would be if dependencies of a package changes depending on the version. For example, libvtk6-dev has missing dependencies, but this changes depending on the version of the package installed. How can I say something like: if libvtk6-dev is version 6.0 or 6.1 then also depends on libpython2.7-dev, and if the version is greater or equal to 6.2 then depend on libproj-dev?
2 Answers
You can do that with << example:
libvtk6-dev (>= 6.0.0), libvtk6-dev (<< 6.2.0)This way you have locked the range between 6.0.0 and 6.1.0. The same way you have to specify for each package individually, there is no if this dependency is this then ask for that.
1So let's break it down:
libvtk6-dev (>= 6.0.0), libvtk6-dev (<< 6.2.0), libpython2.7-devOR (logic op)
libvtk6-dev (>= 6.2.0), libproj-dev,inDepends:is like AND (logic op).|is OR (logic op) but they don't have same priority neither brackets to be combined directly in that order/form.Here what I could come with:
libvtk6-dev (>= 6.0.0), libvtk6-dev (>= 6.2.0) | libpython2.7-dev, libvtk6-dev (<< 6.2.0) | libproj-devHow to read it:
- Must
libvtk6-dev (>= 6.0.0) - If NOT
libvtk6-dev (>= 6.2.0)thenlibpython2.7-dev - If NOT
libvtk6-dev (<< 6.2.0)thenlibproj-dev
- Must
Funny thing, this way is similar to NOR (or NAND) logic in electronics. If you have one of these then you can create all logic operations from it.