0

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.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
Sarthak
  • 380
  • 7

2 Answers2

1

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.

Sarthak
  • 380
  • 7
0

Normally extension are server dependent, you need to build two different package for two different PG version (from two separate branches)

Umar Hayat
  • 116
  • 4
  • Ok maybe I'm getting this wrong, but when we install age from source, it get installed in the current working postgreSQL , although it works only on version 11 and 12. And here when we specify any version in the dependency field, it only check if that package is installed or not before installing the deb file. So here I just wanted to check if the user has any of the version (11 or 12) installed in the system, then deb install process ahead, else give error for other versions. – Sarthak Jan 31 '23 at 17:39
  • You need to put Place holder in control.in or any other "in" file, Variable like PG_VERSION, So if you compile it for PG12, its build system job to replace PG_VERSION with 12 and If you want to compile it for PG11, build system should replace with with 11 – Umar Hayat Feb 01 '23 at 02:11