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

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

CVSweb <webmaster@jp.NetBSD.org>