This is documented in REP-127 (for pkg format 1) and REP-140 for pkg format 2. From the build-depend (multiple) section:
All dependencies and relationships may restrict their applicability to particular versions. For each comparison operator an attribute can be used. Two of these attributes can be used together to describe a version range.
version_lt="VERSION" (optional)
The dependency to the package is restricted to versions less than the stated version number.
version_lte="VERSION" (optional)
The dependency to the package is restricted to versions less or equal than the stated version number.
version_eq="VERSION" (optional)
The dependency to the package is restricted to a version equal than the stated version number.
version_gte="VERSION" (optional)
The dependency to the package is restricted to versions greater or equal than the stated version number.
version_gt="VERSION" (optional)
The dependency to the package is restricted to versions greater than the stated version number.
This is for pkg format 1, but it is the same for format 2.
However, as far as I can tell, I don't think you can use this for your specific use case:
In the new version the name of rosapi package executable is changed. Is there any way where I can specify external package version my package depends on?
While you can specify that your my-pkg-A.B
depends on some-pkg-X.Y
, there is no way for users installing from the current package repositories to actually retrieve that version as soon as some-pkg
has been updated (say to version X.Z
). Only a single version is ever retained on the package repositories, so some-pkg-X.Z
, the latest. Specifying a version_eq
(or version_lt
) requirement will now result in your my-pkg-A.B
being uninstallable, as its dependencies cannot be satisfied (ie: there is no longer a some-pkg-X.Y
on the servers which is needed for my-pkg-A.B
).