pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk pgsql.buildlink3.mk is used to select a PostgreSQL ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/7cd1ae017e8f
branches: trunk
changeset: 478445:7cd1ae017e8f
user: recht <recht%pkgsrc.org@localhost>
date: Fri Jul 23 21:40:00 2004 +0000
description:
pgsql.buildlink3.mk is used to select a PostgreSQL version for use by
pkgsrc. It is modeled after lang/python/pyversion.mk and like it
could be influenced by user- and package-settable variables.
More precisely, tt's behaviour is controlled by the following
two variables:
- PGSQL_VERSION_DEFAULT
A user-settable variable to choose the default PostgreSQL version.
Default: 74
- PGSQL_VERSIONS_ACCEPTED
A package-settable list of PostgreSQL versions accepted by the package.
Default: 74 73
After postgresql-* has been reimported as postgresql73* all depending
packages should be changed to use mk/pgsql.buildlink3.mk.
diffstat:
mk/pgsql.buildlink3.mk | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
diffs (78 lines):
diff -r 5002f0595095 -r 7cd1ae017e8f mk/pgsql.buildlink3.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/pgsql.buildlink3.mk Fri Jul 23 21:40:00 2004 +0000
@@ -0,0 +1,74 @@
+# $NetBSD: pgsql.buildlink3.mk,v 1.1 2004/07/23 21:40:00 recht Exp $
+
+.if !defined(PGVERSION_MK)
+PGVERSION_MK= defined
+
+.include "../../mk/bsd.prefs.mk"
+
+PGSQL_VERSION_DEFAULT?= 74
+PGSQL_VERSIONS_ACCEPTED?= 74 73
+
+# transform the list into individual variables
+.for pv in ${PGSQL_VERSIONS_ACCEPTED}
+_PGSQL_VERSION_${pv}_OK= yes
+.endfor
+
+# check what is installed
+.if exists(${LOCALBASE}/lib/libecpg.so.4)
+_PGSQL_VERSION_74_INSTALLED= yes
+.endif
+.if exists(${LOCALBASE}/lib/libecpg.so.3)
+_PGSQL_VERSION_73_INSTALLED=yes
+.endif
+
+# if a version is explicitely required, take it
+.if defined(PGSQL_VERSION_REQD)
+_PGSQL_VERSION= ${PGSQL_VERSION_REQD}
+.endif
+# if the default is already installed, it is first choice
+.if !defined(_PGSQL_VERSION)
+.if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
+.if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED)
+_PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT}
+.endif
+.endif
+.endif
+# prefer an already installed version, in order of "accepted"
+.if !defined(_PGSQL_VERSION)
+.for pv in ${PGSQL_VERSIONS_ACCEPTED}
+.if defined(_PGSQL_VERSION_${pv}_INSTALLED)
+_PGSQL_VERSION?= ${pv}
+.else
+# keep information as last resort - see below
+_PGSQL_VERSION_FIRSTACCEPTED?= ${pv}
+.endif
+.endfor
+.endif
+# if the default is OK for the addon pkg, take this
+.if !defined(_PGSQL_VERSION)
+.if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
+_PGSQL_VERSION= ${PGSQL_VERSION_DEFAULT}
+.endif
+.endif
+# take the first one accepted by the package
+.if !defined(_PGSQL_VERSION)
+_PGSQL_VERSION= ${_PGSQL_VERSION_FIRSTACCEPTED}
+.endif
+
+#
+# set variables for the version we decided to use:
+#
+.if ${_PGSQL_VERSION} == "74"
+PGPKGSRCDIR= ../../databases/postgresql74-lib
+.elif ${_PGSQL_VERSION} == "73"
+PGPKGSRCDIR= ../../databases/postgresql73-lib
+.else
+# force an error
+ error: no valid PostgreSQL version
+.endif
+
+.if (defined(USE_BUILDLINK3) && empty(USE_BUILDLINK3:M[nN][oO]))
+. include "${PGPKGSRCDIR}/buildlink3.mk"
+.endif
+
+.endif # PGVERSION_MK
Home |
Main Index |
Thread Index |
Old Index