I am building a Debian *.deb package for our proprietary software. The software is Java based, so I thought it would be good if the deb package checks for an installed Java package first.
Package: [[name]]
Version: [[version]]
Section: non-free
Priority: low
Architecture: all
Description: [[description]]
Maintainer: company <email @ address>
Homepage: http://product.website
Depends: java7-runtime-headless
Problems:
Summary: How can I configure the Depends:
section of my package so dpkg
checks for ANY Java/JDK package in version 7 or 8?
To check for "ANY" Java/JDK package, you can use the pipe symbol ("|
") in the Depends:
line. For example, here's the line for the tomcat7-common
package in Jessie:
Depends: libtomcat7-java (>= 7.0.56-3), default-jre-headless | java6-runtime-headless | java6-runtime | java-6-runtime
However, note that if you use a Depends:
line, dpkg
will only consider it satisfied by packages that it knows about. If someone installs Oracle Java, or some other vendor's JDK, without using dpkg
, or if the .deb
doesn't list the right keywords in a Provides:
line, it won't work. So, you might be better off with a Suggests:
or Recommends:
line.