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

1.46    ! adam        1: # $NetBSD: pgsql.buildlink3.mk,v 1.45 2017/06/01 13:30:26 jlam 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.46    ! adam       28: PGSQL_VERSIONS_ACCEPTED?=      10 96 95 94 93 92
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.45      jlam       35: .if ${SHLIB_TYPE} == "dylib"
1.9       recht      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.46    ! adam       43: .  if exists(${LOCALBASE}/lib/libecpg.6.10.dylib)
        !            44: _PGSQL_VERSION_10_INSTALLED=   yes
        !            45: .  endif
1.43      adam       46: .  if exists(${LOCALBASE}/lib/libecpg.6.8.dylib)
                     47: _PGSQL_VERSION_96_INSTALLED=   yes
                     48: .  endif
1.41      tnn        49: .  if exists(${LOCALBASE}/lib/libecpg.6.7.dylib)
                     50: _PGSQL_VERSION_95_INSTALLED=   yes
                     51: .  endif
1.38      adam       52: .  if exists(${LOCALBASE}/lib/libecpg.6.6.dylib)
                     53: _PGSQL_VERSION_94_INSTALLED=   yes
                     54: .  endif
1.36      adam       55: .  if exists(${LOCALBASE}/lib/libecpg.6.5.dylib)
                     56: _PGSQL_VERSION_93_INSTALLED=   yes
                     57: .  endif
1.34      adam       58: .  if exists(${LOCALBASE}/lib/libecpg.6.4.dylib)
                     59: _PGSQL_VERSION_92_INSTALLED=   yes
                     60: .  endif
1.9       recht      61: .else
1.46    ! adam       62: .  if exists(${LOCALBASE}/lib/libecpg.so.6.10)
        !            63: _PGSQL_VERSION_10_INSTALLED=   yes
        !            64: .  endif
1.43      adam       65: .  if exists(${LOCALBASE}/lib/libecpg.so.6.8)
                     66: _PGSQL_VERSION_96_INSTALLED=   yes
                     67: .  endif
1.41      tnn        68: .  if exists(${LOCALBASE}/lib/libecpg.so.6.7)
                     69: _PGSQL_VERSION_95_INSTALLED=   yes
                     70: .  endif
1.38      adam       71: .  if exists(${LOCALBASE}/lib/libecpg.so.6.6)
                     72: _PGSQL_VERSION_94_INSTALLED=   yes
                     73: .  endif
1.36      adam       74: .  if exists(${LOCALBASE}/lib/libecpg.so.6.5)
                     75: _PGSQL_VERSION_93_INSTALLED=   yes
                     76: .  endif
1.34      adam       77: .  if exists(${LOCALBASE}/lib/libecpg.so.6.4)
                     78: _PGSQL_VERSION_92_INSTALLED=   yes
                     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.46    ! adam      117: .if ${_PGSQL_VERSION} == "10"
        !           118: PGSQL_TYPE=    postgresql10-client
        !           119: PGPKGSRCDIR=   ../../databases/postgresql10-client
        !           120: .elif ${_PGSQL_VERSION} == "96"
1.43      adam      121: PGSQL_TYPE=    postgresql96-client
                    122: PGPKGSRCDIR=   ../../databases/postgresql96-client
                    123: .elif ${_PGSQL_VERSION} == "95"
1.41      tnn       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
1.1       recht     135: .else
                    136: # force an error
1.7       jlam      137: PGSQL_TYPE=            none
1.22      rillig    138: PKG_FAIL_REASON+=      "${_PGSQL_VERSION} is not a valid package"
1.1       recht     139: .endif
                    140:
1.8       tv        141: .include "${PGPKGSRCDIR}/buildlink3.mk"
1.7       jlam      142: PGSQL_PREFIX=  ${BUILDLINK_PREFIX.${PGSQL_TYPE}}
1.1       recht     143:
1.11      rillig    144: PGSQL_VERSION= ${_PGSQL_VERSION}
                    145:
1.1       recht     146: .endif # PGVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>