postgresql: add version output to pg_config
authorAdam Duskett <aduskett@gmail.com>
Mon, 12 Mar 2018 10:12:30 +0000 (06:12 -0400)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 4 Apr 2018 20:59:54 +0000 (22:59 +0200)
Some external packages call pg_config to determine the installed PostgreSQL
version. Add this output to Buildroots own pg_config, so these packages
correctly compile.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/postgresql/pg_config
package/postgresql/postgresql.mk

index 85c0e63ddb2357afd3969b4a86812155524610af..642252f27f4182e42993841383f6e95b923d8213 100644 (file)
@@ -14,6 +14,9 @@ case "$1" in
   --libdir)
        echo "$prefix/lib"
        ;;
+  --version)
+       echo "PostgreSQL @POSTGRESQL_VERSION@"
+       ;;
   *)
-       echo "Usage: $0 {--includedir|--libdir}"
+       echo "Usage: $0 {--includedir|--libdir|--version}"
 esac
index c6b689a146cc57de1fdd8a09063d96a9eea81ca9..94b3e60e593d94f8b052c753b0867091c7f5bd2f 100644 (file)
@@ -84,6 +84,7 @@ POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
 define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
        $(INSTALL) -m 0755 -D package/postgresql/pg_config \
                $(STAGING_DIR)/usr/bin/pg_config
+       $(SED) "s|@POSTGRESQL_VERSION@|$(POSTGRESQL_VERSION)|g" $(STAGING_DIR)/usr/bin/pg_config
 endef
 
 POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG