Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/2] postgresql: add version output to pg_config
@ 2018-03-12 10:12 Adam Duskett
  2018-03-12 10:12 ` [Buildroot] [PATCH v3 2/2] python-psycopg2: new package Adam Duskett
  2018-04-04 21:00 ` [Buildroot] [PATCH v3 1/2] postgresql: add version output to pg_config Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Adam Duskett @ 2018-03-12 10:12 UTC (permalink / raw)
  To: buildroot

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>
---
Changes v1 -> v3:
 - Added this patch to the series.

 package/postgresql/pg_config     | 5 ++++-
 package/postgresql/postgresql.mk | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/postgresql/pg_config b/package/postgresql/pg_config
index 85c0e63ddb..642252f27f 100644
--- a/package/postgresql/pg_config
+++ b/package/postgresql/pg_config
@@ -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
diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
index c6b689a146..94b3e60e59 100644
--- a/package/postgresql/postgresql.mk
+++ b/package/postgresql/postgresql.mk
@@ -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
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-05  8:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-12 10:12 [Buildroot] [PATCH v3 1/2] postgresql: add version output to pg_config Adam Duskett
2018-03-12 10:12 ` [Buildroot] [PATCH v3 2/2] python-psycopg2: new package Adam Duskett
2018-03-12 10:34   ` Yegor Yefremov
2018-03-12 11:26     ` Adam Duskett
2018-03-12 12:37       ` Yegor Yefremov
2018-03-12 13:11         ` Adam Duskett
2018-04-05  8:08   ` Thomas Petazzoni
2018-04-04 21:00 ` [Buildroot] [PATCH v3 1/2] postgresql: add version output to pg_config Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox