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

1.29    ! adam        1: # $NetBSD: pgsql.buildlink3.mk,v 1.28 2010/02/10 19:33:54 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
                     16: #
1.1       recht      17:
                     18: .if !defined(PGVERSION_MK)
                     19: PGVERSION_MK=  defined
                     20:
1.23      rillig     21: _VARGROUPS+=           pgsql
                     22: _USER_VARS.pgsql=      PGSQL_VERSION_DEFAULT
                     23: _PKG_VARS.pgsql=       PGSQL_VERSIONS_ACCEPTED
                     24: _SYS_VARS.pgsql=       PG_LIB_EXT PGSQL_TYPE PGPKGSRCDIR
                     25:
1.1       recht      26: .include "../../mk/bsd.prefs.mk"
                     27:
1.28      joerg      28: PGSQL_VERSION_DEFAULT?=                84
1.29    ! adam       29: PGSQL_VERSIONS_ACCEPTED?=      90 84 83 82
1.1       recht      30:
                     31: # transform the list into individual variables
                     32: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     33: _PGSQL_VERSION_${pv}_OK=       yes
                     34: .endfor
                     35:
1.9       recht      36: .if ${_OPSYS_SHLIB_TYPE} == "dylib"
                     37: PG_LIB_EXT=dylib
                     38: .else
                     39: PG_LIB_EXT=so
                     40: .endif
                     41:
1.1       recht      42: # check what is installed
1.9       recht      43: .if ${OPSYS} == "Darwin"
1.29    ! adam       44: .if exists(${LOCALBASE}/lib/libecpg.6.0.2.dylib)
        !            45: _PGSQL_VERSION_90_INSTALLED=   yes
        !            46: .endif
1.26      adam       47: .if exists(${LOCALBASE}/lib/libecpg.6.0.1.dylib)
                     48: _PGSQL_VERSION_84_INSTALLED=   yes
                     49: .endif
1.24      adam       50: .if exists(${LOCALBASE}/lib/libecpg.6.0.0.dylib)
                     51: _PGSQL_VERSION_83_INSTALLED=   yes
                     52: .endif
1.19      adam       53: .if exists(${LOCALBASE}/lib/libecpg.5.0.2.dylib)
                     54: _PGSQL_VERSION_82_INSTALLED=   yes
                     55: .endif
1.9       recht      56: .else
1.29    ! adam       57: .if exists(${LOCALBASE}/lib/libecpg.so.6.0.2)
        !            58: _PGSQL_VERSION_90_INSTALLED=   yes
        !            59: .endif
1.26      adam       60: .if exists(${LOCALBASE}/lib/libecpg.so.6.0.1)
                     61: _PGSQL_VERSION_84_INSTALLED=   yes
                     62: .endif
1.24      adam       63: .if exists(${LOCALBASE}/lib/libecpg.so.6.0.0)
                     64: _PGSQL_VERSION_83_INSTALLED=   yes
                     65: .endif
1.18      adam       66: .if exists(${LOCALBASE}/lib/libecpg.so.5.0.2)
                     67: _PGSQL_VERSION_82_INSTALLED=   yes
                     68: .endif
1.9       recht      69: .endif
1.1       recht      70:
                     71: # if a version is explicitely required, take it
                     72: .if defined(PGSQL_VERSION_REQD)
                     73: _PGSQL_VERSION=        ${PGSQL_VERSION_REQD}
                     74: .endif
                     75: # if the default is already installed, it is first choice
                     76: .if !defined(_PGSQL_VERSION)
                     77: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     78: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED)
                     79: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     80: .endif
                     81: .endif
                     82: .endif
                     83: # prefer an already installed version, in order of "accepted"
                     84: .if !defined(_PGSQL_VERSION)
                     85: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     86: .if defined(_PGSQL_VERSION_${pv}_INSTALLED)
                     87: _PGSQL_VERSION?=       ${pv}
                     88: .else
                     89: # keep information as last resort - see below
                     90: _PGSQL_VERSION_FIRSTACCEPTED?= ${pv}
                     91: .endif
                     92: .endfor
                     93: .endif
                     94: # if the default is OK for the addon pkg, take this
                     95: .if !defined(_PGSQL_VERSION)
                     96: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     97: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     98: .endif
                     99: .endif
                    100: # take the first one accepted by the package
                    101: .if !defined(_PGSQL_VERSION)
                    102: _PGSQL_VERSION=        ${_PGSQL_VERSION_FIRSTACCEPTED}
                    103: .endif
                    104:
                    105: #
                    106: # set variables for the version we decided to use:
                    107: #
1.29    ! adam      108: .if ${_PGSQL_VERSION} == "90"
        !           109: PGSQL_TYPE=    postgresql90-client
        !           110: PGPKGSRCDIR=   ../../databases/postgresql90-client
        !           111: .elif ${_PGSQL_VERSION} == "84"
1.26      adam      112: PGSQL_TYPE=    postgresql84-client
                    113: PGPKGSRCDIR=   ../../databases/postgresql84-client
                    114: .elif ${_PGSQL_VERSION} == "83"
1.24      adam      115: PGSQL_TYPE=    postgresql83-client
                    116: PGPKGSRCDIR=   ../../databases/postgresql83-client
                    117: .elif ${_PGSQL_VERSION} == "82"
1.18      adam      118: PGSQL_TYPE=    postgresql82-client
                    119: PGPKGSRCDIR=   ../../databases/postgresql82-client
1.1       recht     120: .else
                    121: # force an error
1.7       jlam      122: PGSQL_TYPE=            none
1.22      rillig    123: PKG_FAIL_REASON+=      "${_PGSQL_VERSION} is not a valid package"
1.1       recht     124: .endif
                    125:
1.8       tv        126: .include "${PGPKGSRCDIR}/buildlink3.mk"
1.7       jlam      127: PGSQL_PREFIX=  ${BUILDLINK_PREFIX.${PGSQL_TYPE}}
1.1       recht     128:
1.11      rillig    129: PGSQL_VERSION= ${_PGSQL_VERSION}
                    130:
1.1       recht     131: .endif # PGVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>