2008-03-13 18:38:48 +01:00
|
|
|
# $NetBSD: pgsql.buildlink3.mk,v 1.25 2008/03/13 17:38:48 joerg Exp $
|
2006-10-18 22:48:58 +02:00
|
|
|
#
|
|
|
|
# User-settable variables:
|
|
|
|
#
|
|
|
|
# PGSQL_VERSION_DEFAULT
|
|
|
|
#
|
|
|
|
# Package-settable variables:
|
|
|
|
#
|
|
|
|
# PGSQL_VERSIONS_ACCEPTED
|
|
|
|
#
|
|
|
|
# Variables set by this file:
|
|
|
|
#
|
|
|
|
# PG_LIB_EXT
|
|
|
|
# PGSQL_TYPE
|
|
|
|
# PGPKGSRCDIR
|
|
|
|
#
|
2004-07-23 23:40:00 +02:00
|
|
|
|
|
|
|
.if !defined(PGVERSION_MK)
|
|
|
|
PGVERSION_MK= defined
|
|
|
|
|
2007-06-06 14:40:05 +02:00
|
|
|
_VARGROUPS+= pgsql
|
|
|
|
_USER_VARS.pgsql= PGSQL_VERSION_DEFAULT
|
|
|
|
_PKG_VARS.pgsql= PGSQL_VERSIONS_ACCEPTED
|
|
|
|
_SYS_VARS.pgsql= PG_LIB_EXT PGSQL_TYPE PGPKGSRCDIR
|
|
|
|
|
2004-07-23 23:40:00 +02:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2008-03-13 18:38:48 +01:00
|
|
|
PGSQL_VERSION_DEFAULT?= 82
|
|
|
|
PGSQL_VERSIONS_ACCEPTED?= 83 82 81
|
2004-07-23 23:40:00 +02:00
|
|
|
|
|
|
|
# transform the list into individual variables
|
|
|
|
.for pv in ${PGSQL_VERSIONS_ACCEPTED}
|
|
|
|
_PGSQL_VERSION_${pv}_OK= yes
|
|
|
|
.endfor
|
|
|
|
|
2005-04-11 22:35:24 +02:00
|
|
|
.if ${_OPSYS_SHLIB_TYPE} == "dylib"
|
|
|
|
PG_LIB_EXT=dylib
|
|
|
|
.else
|
|
|
|
PG_LIB_EXT=so
|
|
|
|
.endif
|
|
|
|
|
2004-07-23 23:40:00 +02:00
|
|
|
# check what is installed
|
2005-04-11 22:35:24 +02:00
|
|
|
.if ${OPSYS} == "Darwin"
|
2008-03-04 13:50:25 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.6.0.0.dylib)
|
|
|
|
_PGSQL_VERSION_83_INSTALLED= yes
|
|
|
|
.endif
|
2006-12-26 19:42:44 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.5.0.2.dylib)
|
|
|
|
_PGSQL_VERSION_82_INSTALLED= yes
|
|
|
|
.endif
|
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.5.0.1.dylib)
|
|
|
|
_PGSQL_VERSION_81_INSTALLED= yes
|
|
|
|
.endif
|
2005-04-11 22:35:24 +02:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.5.0.dylib)
|
|
|
|
_PGSQL_VERSION_80_INSTALLED= yes
|
|
|
|
.endif
|
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.4.1.dylib)
|
|
|
|
_PGSQL_VERSION_74_INSTALLED= yes
|
|
|
|
.endif
|
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.3.dylib)
|
|
|
|
_PGSQL_VERSION_73_INSTALLED=yes
|
|
|
|
.endif
|
|
|
|
.else
|
2008-03-04 13:50:25 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.so.6.0.0)
|
|
|
|
_PGSQL_VERSION_83_INSTALLED= yes
|
|
|
|
.endif
|
2006-12-09 17:18:40 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.so.5.0.2)
|
|
|
|
_PGSQL_VERSION_82_INSTALLED= yes
|
|
|
|
.endif
|
2006-01-08 13:53:53 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.so.5.0.1)
|
|
|
|
_PGSQL_VERSION_81_INSTALLED= yes
|
|
|
|
.endif
|
2005-08-07 01:01:19 +02:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.so.5.0.0)
|
2005-02-01 12:07:31 +01:00
|
|
|
_PGSQL_VERSION_80_INSTALLED= yes
|
|
|
|
.endif
|
2005-02-07 05:07:13 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.so.4.1)
|
2004-07-23 23:40:00 +02:00
|
|
|
_PGSQL_VERSION_74_INSTALLED= yes
|
|
|
|
.endif
|
|
|
|
.if exists(${LOCALBASE}/lib/libecpg.so.3)
|
|
|
|
_PGSQL_VERSION_73_INSTALLED=yes
|
|
|
|
.endif
|
2005-04-11 22:35:24 +02:00
|
|
|
.endif
|
2004-07-23 23:40:00 +02:00
|
|
|
|
|
|
|
# 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:
|
|
|
|
#
|
2008-03-04 13:50:25 +01:00
|
|
|
.if ${_PGSQL_VERSION} == "83"
|
|
|
|
PGSQL_TYPE= postgresql83-client
|
|
|
|
PGPKGSRCDIR= ../../databases/postgresql83-client
|
|
|
|
.elif ${_PGSQL_VERSION} == "82"
|
2006-12-09 17:18:40 +01:00
|
|
|
PGSQL_TYPE= postgresql82-client
|
|
|
|
PGPKGSRCDIR= ../../databases/postgresql82-client
|
|
|
|
.elif ${_PGSQL_VERSION} == "81"
|
2006-01-08 13:53:53 +01:00
|
|
|
PGSQL_TYPE= postgresql81-client
|
2006-03-20 15:48:45 +01:00
|
|
|
PGPKGSRCDIR= ../../databases/postgresql81-client
|
2006-01-08 13:53:53 +01:00
|
|
|
.elif ${_PGSQL_VERSION} == "80"
|
2005-05-13 00:19:16 +02:00
|
|
|
PGSQL_TYPE= postgresql80-client
|
2005-04-11 22:35:24 +02:00
|
|
|
PGPKGSRCDIR= ../../databases/postgresql80-client
|
2004-07-23 23:40:00 +02:00
|
|
|
.else
|
|
|
|
# force an error
|
2005-03-17 22:44:58 +01:00
|
|
|
PGSQL_TYPE= none
|
2007-02-10 09:59:07 +01:00
|
|
|
PKG_FAIL_REASON+= "${_PGSQL_VERSION} is not a valid package"
|
2004-07-23 23:40:00 +02:00
|
|
|
.endif
|
|
|
|
|
2005-03-24 18:46:00 +01:00
|
|
|
.include "${PGPKGSRCDIR}/buildlink3.mk"
|
2005-03-17 22:44:58 +01:00
|
|
|
PGSQL_PREFIX= ${BUILDLINK_PREFIX.${PGSQL_TYPE}}
|
2004-07-23 23:40:00 +02:00
|
|
|
|
2005-05-24 12:01:25 +02:00
|
|
|
PGSQL_VERSION= ${_PGSQL_VERSION}
|
|
|
|
|
2004-07-23 23:40:00 +02:00
|
|
|
.endif # PGVERSION_MK
|