Depends on the dependencies.
Some packages have metapackages that automatically include right version for the active Debian release. The PHP packages, in particular, do that. For example, the php-curl
package depends on php7.0-curl
in stretch, and php7.3-curl
in buster. If your package depends on php-curl
, you'll automatically get the right version. The postgresql
package does the same, pulling in postgresql-11
or postgresql-9.6
, depending on the Debian release.
If that doesn't work, you can try creating two binary packages in your source package called myapp-jessie
and myapp-stretch
, each of which depend on the right sets of packages for their release. Then in the main package:
Depends: myapp-jessie | myapp-stretch
If none of those ideas work, you may need to maintain multiple control files, stand up an apt repo per release, build multiple packages, and deploy each to the appropriate apt repo.
What specific dependencies do you have?