[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.42

1.42    ! wiz         1: # $NetBSD: pgsql.buildlink3.mk,v 1.41 2016/02/25 21:39:07 tnn 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.42    ! wiz        27: PGSQL_VERSION_DEFAULT?=                95
1.41      tnn        28: PGSQL_VERSIONS_ACCEPTED?=      95 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.41      tnn        43: .  if exists(${LOCALBASE}/lib/libecpg.6.7.dylib)
                     44: _PGSQL_VERSION_95_INSTALLED=   yes
                     45: .  endif
1.38      adam       46: .  if exists(${LOCALBASE}/lib/libecpg.6.6.dylib)
                     47: _PGSQL_VERSION_94_INSTALLED=   yes
                     48: .  endif
1.36      adam       49: .  if exists(${LOCALBASE}/lib/libecpg.6.5.dylib)
                     50: _PGSQL_VERSION_93_INSTALLED=   yes
                     51: .  endif
1.34      adam       52: .  if exists(${LOCALBASE}/lib/libecpg.6.4.dylib)
                     53: _PGSQL_VERSION_92_INSTALLED=   yes
                     54: .  endif
1.32      adam       55: .  if exists(${LOCALBASE}/lib/libecpg.6.3.dylib)
                     56: _PGSQL_VERSION_91_INSTALLED=   yes
                     57: .  endif
1.31      adam       58: .  if exists(${LOCALBASE}/lib/libecpg.6.2.dylib)
1.29      adam       59: _PGSQL_VERSION_90_INSTALLED=   yes
1.31      adam       60: .  endif
                     61: .  if exists(${LOCALBASE}/lib/libecpg.6.1.dylib)
1.26      adam       62: _PGSQL_VERSION_84_INSTALLED=   yes
1.31      adam       63: .  endif
1.9       recht      64: .else
1.41      tnn        65: .  if exists(${LOCALBASE}/lib/libecpg.so.6.7)
                     66: _PGSQL_VERSION_95_INSTALLED=   yes
                     67: .  endif
1.38      adam       68: .  if exists(${LOCALBASE}/lib/libecpg.so.6.6)
                     69: _PGSQL_VERSION_94_INSTALLED=   yes
                     70: .  endif
1.36      adam       71: .  if exists(${LOCALBASE}/lib/libecpg.so.6.5)
                     72: _PGSQL_VERSION_93_INSTALLED=   yes
                     73: .  endif
1.34      adam       74: .  if exists(${LOCALBASE}/lib/libecpg.so.6.4)
                     75: _PGSQL_VERSION_92_INSTALLED=   yes
                     76: .  endif
1.32      adam       77: .  if exists(${LOCALBASE}/lib/libecpg.so.6.3)
                     78: _PGSQL_VERSION_91_INSTALLED=   yes
                     79: .  endif
1.31      adam       80: .  if exists(${LOCALBASE}/lib/libecpg.so.6.2)
1.29      adam       81: _PGSQL_VERSION_90_INSTALLED=   yes
1.31      adam       82: .  endif
                     83: .  if exists(${LOCALBASE}/lib/libecpg.so.6.1)
1.26      adam       84: _PGSQL_VERSION_84_INSTALLED=   yes
1.31      adam       85: .  endif
1.9       recht      86: .endif
1.1       recht      87:
                     88: # if a version is explicitely required, take it
                     89: .if defined(PGSQL_VERSION_REQD)
                     90: _PGSQL_VERSION=        ${PGSQL_VERSION_REQD}
                     91: .endif
                     92: # if the default is already installed, it is first choice
                     93: .if !defined(_PGSQL_VERSION)
                     94: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     95: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED)
                     96: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     97: .endif
                     98: .endif
                     99: .endif
                    100: # prefer an already installed version, in order of "accepted"
                    101: .if !defined(_PGSQL_VERSION)
                    102: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                    103: .if defined(_PGSQL_VERSION_${pv}_INSTALLED)
                    104: _PGSQL_VERSION?=       ${pv}
                    105: .else
                    106: # keep information as last resort - see below
                    107: _PGSQL_VERSION_FIRSTACCEPTED?= ${pv}
                    108: .endif
                    109: .endfor
                    110: .endif
                    111: # if the default is OK for the addon pkg, take this
                    112: .if !defined(_PGSQL_VERSION)
                    113: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                    114: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                    115: .endif
                    116: .endif
                    117: # take the first one accepted by the package
                    118: .if !defined(_PGSQL_VERSION)
                    119: _PGSQL_VERSION=        ${_PGSQL_VERSION_FIRSTACCEPTED}
                    120: .endif
                    121:
                    122: # set variables for the version we decided to use:
1.41      tnn       123: .if ${_PGSQL_VERSION} == "95"
                    124: PGSQL_TYPE=    postgresql95-client
                    125: PGPKGSRCDIR=   ../../databases/postgresql95-client
                    126: .elif ${_PGSQL_VERSION} == "94"
1.38      adam      127: PGSQL_TYPE=    postgresql94-client
                    128: PGPKGSRCDIR=   ../../databases/postgresql94-client
                    129: .elif ${_PGSQL_VERSION} == "93"
1.36      adam      130: PGSQL_TYPE=    postgresql93-client
                    131: PGPKGSRCDIR=   ../../databases/postgresql93-client
                    132: .elif ${_PGSQL_VERSION} == "92"
1.34      adam      133: PGSQL_TYPE=    postgresql92-client
                    134: PGPKGSRCDIR=   ../../databases/postgresql92-client
                    135: .elif ${_PGSQL_VERSION} == "91"
1.32      adam      136: PGSQL_TYPE=    postgresql91-client
                    137: PGPKGSRCDIR=   ../../databases/postgresql91-client
1.1       recht     138: .else
                    139: # force an error
1.7       jlam      140: PGSQL_TYPE=            none
1.22      rillig    141: PKG_FAIL_REASON+=      "${_PGSQL_VERSION} is not a valid package"
1.1       recht     142: .endif
                    143:
1.8       tv        144: .include "${PGPKGSRCDIR}/buildlink3.mk"
1.7       jlam      145: PGSQL_PREFIX=  ${BUILDLINK_PREFIX.${PGSQL_TYPE}}
1.1       recht     146:
1.11      rillig    147: PGSQL_VERSION= ${_PGSQL_VERSION}
                    148:
1.1       recht     149: .endif # PGVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>