databasepostgresqldebian-packagingapache-age

How to specify multiple versions of same driver/library in the dependency field of control file in debian packaging


I'm trying to make a debian package of Apache-Age and it can successfully build either with

"postgresql-server-dev-11"

or

"postgresql-12"

I've made my control file in the following way :

Source: age
Section: database
Priority: optional
Maintainer: unknown <sarthak@SARTHAK>
Build-Depends: debhelper-compat (= 13),
               postgresql-12,
               build-essential,
               libreadline-dev,
               zlib1g-dev,
               flex,
               bison
Standards-Version: 4.5.1
Homepage: <insert the upstream URL, if relevant>
#Vcs-Browser: https://salsa.debian.org/debian/age
#Vcs-Git: https://salsa.debian.org/debian/age.git
Rules-Requires-Root: no

Package: age
Architecture: all
Depends: postgresql-12
         ${misc:Depends},
         ${shlibs:Depends}
Description: Apache AGE is an extension for PostgreSQL that enables users to leverage a graph database 
  on top of the existing relational databases. 

Here it's only for postgresql-12, but how can we specify postgresql-server-dev-11 also in the dependency field so that if any of the two version is present the build can proceed without errors.


Solution

  • So I figured it out, it's quiet simple, if we want to specify multiple versions of a driver in 'OR' fashion, like if either of the versions is present in the system, the dependency check should pass, by simple using bitwise 'OR' operator, like this :

    Build-Depends:
     debhelper-compat (= 13),
     postgresql-11 | postgresql-12,
     build-essential,
    

    So here if any of the postgresql version 11 or 12 is installed, the deb file will continue with the installation.