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

1.25    ! joerg       1: # $NetBSD: pgsql.buildlink3.mk,v 1.24 2008/03/04 12:50:25 adam 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.25    ! joerg      28: PGSQL_VERSION_DEFAULT?=                82
        !            29: PGSQL_VERSIONS_ACCEPTED?=      83 82 81
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.24      adam       44: .if exists(${LOCALBASE}/lib/libecpg.6.0.0.dylib)
                     45: _PGSQL_VERSION_83_INSTALLED=   yes
                     46: .endif
1.19      adam       47: .if exists(${LOCALBASE}/lib/libecpg.5.0.2.dylib)
                     48: _PGSQL_VERSION_82_INSTALLED=   yes
                     49: .endif
                     50: .if exists(${LOCALBASE}/lib/libecpg.5.0.1.dylib)
                     51: _PGSQL_VERSION_81_INSTALLED=   yes
                     52: .endif
1.9       recht      53: .if exists(${LOCALBASE}/lib/libecpg.5.0.dylib)
                     54: _PGSQL_VERSION_80_INSTALLED=   yes
                     55: .endif
                     56: .if exists(${LOCALBASE}/lib/libecpg.4.1.dylib)
                     57: _PGSQL_VERSION_74_INSTALLED=   yes
                     58: .endif
                     59: .if exists(${LOCALBASE}/lib/libecpg.3.dylib)
                     60: _PGSQL_VERSION_73_INSTALLED=yes
                     61: .endif
                     62: .else
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.14      abs        69: .if exists(${LOCALBASE}/lib/libecpg.so.5.0.1)
                     70: _PGSQL_VERSION_81_INSTALLED=   yes
                     71: .endif
1.12      abs        72: .if exists(${LOCALBASE}/lib/libecpg.so.5.0.0)
1.4       abs        73: _PGSQL_VERSION_80_INSTALLED=   yes
                     74: .endif
1.5       dan        75: .if exists(${LOCALBASE}/lib/libecpg.so.4.1)
1.1       recht      76: _PGSQL_VERSION_74_INSTALLED=   yes
                     77: .endif
                     78: .if exists(${LOCALBASE}/lib/libecpg.so.3)
                     79: _PGSQL_VERSION_73_INSTALLED=yes
                     80: .endif
1.9       recht      81: .endif
1.1       recht      82:
                     83: # if a version is explicitely required, take it
                     84: .if defined(PGSQL_VERSION_REQD)
                     85: _PGSQL_VERSION=        ${PGSQL_VERSION_REQD}
                     86: .endif
                     87: # if the default is already installed, it is first choice
                     88: .if !defined(_PGSQL_VERSION)
                     89: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     90: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED)
                     91: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     92: .endif
                     93: .endif
                     94: .endif
                     95: # prefer an already installed version, in order of "accepted"
                     96: .if !defined(_PGSQL_VERSION)
                     97: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     98: .if defined(_PGSQL_VERSION_${pv}_INSTALLED)
                     99: _PGSQL_VERSION?=       ${pv}
                    100: .else
                    101: # keep information as last resort - see below
                    102: _PGSQL_VERSION_FIRSTACCEPTED?= ${pv}
                    103: .endif
                    104: .endfor
                    105: .endif
                    106: # if the default is OK for the addon pkg, take this
                    107: .if !defined(_PGSQL_VERSION)
                    108: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                    109: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                    110: .endif
                    111: .endif
                    112: # take the first one accepted by the package
                    113: .if !defined(_PGSQL_VERSION)
                    114: _PGSQL_VERSION=        ${_PGSQL_VERSION_FIRSTACCEPTED}
                    115: .endif
                    116:
                    117: #
                    118: # set variables for the version we decided to use:
                    119: #
1.24      adam      120: .if ${_PGSQL_VERSION} == "83"
                    121: PGSQL_TYPE=    postgresql83-client
                    122: PGPKGSRCDIR=   ../../databases/postgresql83-client
                    123: .elif ${_PGSQL_VERSION} == "82"
1.18      adam      124: PGSQL_TYPE=    postgresql82-client
                    125: PGPKGSRCDIR=   ../../databases/postgresql82-client
                    126: .elif ${_PGSQL_VERSION} == "81"
1.14      abs       127: PGSQL_TYPE=    postgresql81-client
1.15      uebayasi  128: PGPKGSRCDIR=   ../../databases/postgresql81-client
1.14      abs       129: .elif ${_PGSQL_VERSION} == "80"
1.10      jlam      130: PGSQL_TYPE=    postgresql80-client
1.9       recht     131: PGPKGSRCDIR=   ../../databases/postgresql80-client
1.1       recht     132: .else
                    133: # force an error
1.7       jlam      134: PGSQL_TYPE=            none
1.22      rillig    135: PKG_FAIL_REASON+=      "${_PGSQL_VERSION} is not a valid package"
1.1       recht     136: .endif
                    137:
1.8       tv        138: .include "${PGPKGSRCDIR}/buildlink3.mk"
1.7       jlam      139: PGSQL_PREFIX=  ${BUILDLINK_PREFIX.${PGSQL_TYPE}}
1.1       recht     140:
1.11      rillig    141: PGSQL_VERSION= ${_PGSQL_VERSION}
                    142:
1.1       recht     143: .endif # PGVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>