[BACK]Return to pgsql.buildlink3.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

Annotation of pkgsrc/mk/pgsql.buildlink3.mk, Revision 1.40

1.40    ! joerg       1: # $NetBSD: pgsql.buildlink3.mk,v 1.39 2015/10/24 21:18:12 joerg Exp $
1.17      rillig      2: #
                      3: # User-settable variables:
                      4: #
                      5: # PGSQL_VERSION_DEFAULT
                      6: #
                      7: # Package-settable variables:
                      8: #
                      9: # PGSQL_VERSIONS_ACCEPTED
                     10: #
                     11: # Variables set by this file:
                     12: #
                     13: # PG_LIB_EXT
                     14: # PGSQL_TYPE
                     15: # PGPKGSRCDIR
1.1       recht      16:
                     17: .if !defined(PGVERSION_MK)
                     18: PGVERSION_MK=  defined
                     19:
1.23      rillig     20: _VARGROUPS+=           pgsql
                     21: _USER_VARS.pgsql=      PGSQL_VERSION_DEFAULT
                     22: _PKG_VARS.pgsql=       PGSQL_VERSIONS_ACCEPTED
                     23: _SYS_VARS.pgsql=       PG_LIB_EXT PGSQL_TYPE PGPKGSRCDIR
                     24:
1.1       recht      25: .include "../../mk/bsd.prefs.mk"
                     26:
1.37      joerg      27: PGSQL_VERSION_DEFAULT?=                93
1.39      joerg      28: PGSQL_VERSIONS_ACCEPTED?=      94 93 92 91
1.1       recht      29:
                     30: # transform the list into individual variables
                     31: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     32: _PGSQL_VERSION_${pv}_OK=       yes
                     33: .endfor
                     34:
1.9       recht      35: .if ${_OPSYS_SHLIB_TYPE} == "dylib"
                     36: PG_LIB_EXT=dylib
                     37: .else
                     38: PG_LIB_EXT=so
                     39: .endif
                     40:
1.1       recht      41: # check what is installed
1.9       recht      42: .if ${OPSYS} == "Darwin"
1.38      adam       43: .  if exists(${LOCALBASE}/lib/libecpg.6.6.dylib)
                     44: _PGSQL_VERSION_94_INSTALLED=   yes
                     45: .  endif
1.36      adam       46: .  if exists(${LOCALBASE}/lib/libecpg.6.5.dylib)
                     47: _PGSQL_VERSION_93_INSTALLED=   yes
                     48: .  endif
1.34      adam       49: .  if exists(${LOCALBASE}/lib/libecpg.6.4.dylib)
                     50: _PGSQL_VERSION_92_INSTALLED=   yes
                     51: .  endif
1.32      adam       52: .  if exists(${LOCALBASE}/lib/libecpg.6.3.dylib)
                     53: _PGSQL_VERSION_91_INSTALLED=   yes
                     54: .  endif
1.31      adam       55: .  if exists(${LOCALBASE}/lib/libecpg.6.2.dylib)
1.29      adam       56: _PGSQL_VERSION_90_INSTALLED=   yes
1.31      adam       57: .  endif
                     58: .  if exists(${LOCALBASE}/lib/libecpg.6.1.dylib)
1.26      adam       59: _PGSQL_VERSION_84_INSTALLED=   yes
1.31      adam       60: .  endif
1.9       recht      61: .else
1.38      adam       62: .  if exists(${LOCALBASE}/lib/libecpg.so.6.6)
                     63: _PGSQL_VERSION_94_INSTALLED=   yes
                     64: .  endif
1.36      adam       65: .  if exists(${LOCALBASE}/lib/libecpg.so.6.5)
                     66: _PGSQL_VERSION_93_INSTALLED=   yes
                     67: .  endif
1.34      adam       68: .  if exists(${LOCALBASE}/lib/libecpg.so.6.4)
                     69: _PGSQL_VERSION_92_INSTALLED=   yes
                     70: .  endif
1.32      adam       71: .  if exists(${LOCALBASE}/lib/libecpg.so.6.3)
                     72: _PGSQL_VERSION_91_INSTALLED=   yes
                     73: .  endif
1.31      adam       74: .  if exists(${LOCALBASE}/lib/libecpg.so.6.2)
1.29      adam       75: _PGSQL_VERSION_90_INSTALLED=   yes
1.31      adam       76: .  endif
                     77: .  if exists(${LOCALBASE}/lib/libecpg.so.6.1)
1.26      adam       78: _PGSQL_VERSION_84_INSTALLED=   yes
1.31      adam       79: .  endif
1.9       recht      80: .endif
1.1       recht      81:
                     82: # if a version is explicitely required, take it
                     83: .if defined(PGSQL_VERSION_REQD)
                     84: _PGSQL_VERSION=        ${PGSQL_VERSION_REQD}
                     85: .endif
                     86: # if the default is already installed, it is first choice
                     87: .if !defined(_PGSQL_VERSION)
                     88: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     89: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED)
                     90: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     91: .endif
                     92: .endif
                     93: .endif
                     94: # prefer an already installed version, in order of "accepted"
                     95: .if !defined(_PGSQL_VERSION)
                     96: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     97: .if defined(_PGSQL_VERSION_${pv}_INSTALLED)
                     98: _PGSQL_VERSION?=       ${pv}
                     99: .else
                    100: # keep information as last resort - see below
                    101: _PGSQL_VERSION_FIRSTACCEPTED?= ${pv}
                    102: .endif
                    103: .endfor
                    104: .endif
                    105: # if the default is OK for the addon pkg, take this
                    106: .if !defined(_PGSQL_VERSION)
                    107: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                    108: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                    109: .endif
                    110: .endif
                    111: # take the first one accepted by the package
                    112: .if !defined(_PGSQL_VERSION)
                    113: _PGSQL_VERSION=        ${_PGSQL_VERSION_FIRSTACCEPTED}
                    114: .endif
                    115:
                    116: # set variables for the version we decided to use:
1.38      adam      117: .if ${_PGSQL_VERSION} == "94"
                    118: PGSQL_TYPE=    postgresql94-client
                    119: PGPKGSRCDIR=   ../../databases/postgresql94-client
                    120: .elif ${_PGSQL_VERSION} == "93"
1.36      adam      121: PGSQL_TYPE=    postgresql93-client
                    122: PGPKGSRCDIR=   ../../databases/postgresql93-client
                    123: .elif ${_PGSQL_VERSION} == "92"
1.34      adam      124: PGSQL_TYPE=    postgresql92-client
                    125: PGPKGSRCDIR=   ../../databases/postgresql92-client
                    126: .elif ${_PGSQL_VERSION} == "91"
1.32      adam      127: PGSQL_TYPE=    postgresql91-client
                    128: PGPKGSRCDIR=   ../../databases/postgresql91-client
1.1       recht     129: .else
                    130: # force an error
1.7       jlam      131: PGSQL_TYPE=            none
1.22      rillig    132: PKG_FAIL_REASON+=      "${_PGSQL_VERSION} is not a valid package"
1.1       recht     133: .endif
                    134:
1.8       tv        135: .include "${PGPKGSRCDIR}/buildlink3.mk"
1.7       jlam      136: PGSQL_PREFIX=  ${BUILDLINK_PREFIX.${PGSQL_TYPE}}
1.1       recht     137:
1.11      rillig    138: PGSQL_VERSION= ${_PGSQL_VERSION}
                    139:
1.1       recht     140: .endif # PGVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>