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

1.13    ! joerg       1: # $NetBSD: pgsql.buildlink3.mk,v 1.12 2005/08/06 23:01:19 abs Exp $
1.1       recht       2:
                      3: .if !defined(PGVERSION_MK)
                      4: PGVERSION_MK=  defined
                      5:
                      6: .include "../../mk/bsd.prefs.mk"
                      7:
1.13    ! joerg       8: PGSQL_VERSION_DEFAULT?=                80
1.4       abs         9: PGSQL_VERSIONS_ACCEPTED?=      80 74 73
1.1       recht      10:
                     11: # transform the list into individual variables
                     12: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     13: _PGSQL_VERSION_${pv}_OK=       yes
                     14: .endfor
                     15:
1.9       recht      16: .if ${_OPSYS_SHLIB_TYPE} == "dylib"
                     17: PG_LIB_EXT=dylib
                     18: .else
                     19: PG_LIB_EXT=so
                     20: .endif
                     21:
1.1       recht      22: # check what is installed
1.9       recht      23: .if ${OPSYS} == "Darwin"
                     24: .if exists(${LOCALBASE}/lib/libecpg.5.0.dylib)
                     25: _PGSQL_VERSION_80_INSTALLED=   yes
                     26: .endif
                     27: .if exists(${LOCALBASE}/lib/libecpg.4.1.dylib)
                     28: _PGSQL_VERSION_74_INSTALLED=   yes
                     29: .endif
                     30: .if exists(${LOCALBASE}/lib/libecpg.3.dylib)
                     31: _PGSQL_VERSION_73_INSTALLED=yes
                     32: .endif
                     33: .else
1.12      abs        34: .if exists(${LOCALBASE}/lib/libecpg.so.5.0.0)
1.4       abs        35: _PGSQL_VERSION_80_INSTALLED=   yes
                     36: .endif
1.5       dan        37: .if exists(${LOCALBASE}/lib/libecpg.so.4.1)
1.1       recht      38: _PGSQL_VERSION_74_INSTALLED=   yes
                     39: .endif
                     40: .if exists(${LOCALBASE}/lib/libecpg.so.3)
                     41: _PGSQL_VERSION_73_INSTALLED=yes
                     42: .endif
1.9       recht      43: .endif
1.1       recht      44:
                     45: # if a version is explicitely required, take it
                     46: .if defined(PGSQL_VERSION_REQD)
                     47: _PGSQL_VERSION=        ${PGSQL_VERSION_REQD}
                     48: .endif
                     49: # if the default is already installed, it is first choice
                     50: .if !defined(_PGSQL_VERSION)
                     51: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     52: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED)
                     53: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     54: .endif
                     55: .endif
                     56: .endif
                     57: # prefer an already installed version, in order of "accepted"
                     58: .if !defined(_PGSQL_VERSION)
                     59: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     60: .if defined(_PGSQL_VERSION_${pv}_INSTALLED)
                     61: _PGSQL_VERSION?=       ${pv}
                     62: .else
                     63: # keep information as last resort - see below
                     64: _PGSQL_VERSION_FIRSTACCEPTED?= ${pv}
                     65: .endif
                     66: .endfor
                     67: .endif
                     68: # if the default is OK for the addon pkg, take this
                     69: .if !defined(_PGSQL_VERSION)
                     70: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     71: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     72: .endif
                     73: .endif
                     74: # take the first one accepted by the package
                     75: .if !defined(_PGSQL_VERSION)
                     76: _PGSQL_VERSION=        ${_PGSQL_VERSION_FIRSTACCEPTED}
                     77: .endif
                     78:
                     79: #
                     80: # set variables for the version we decided to use:
                     81: #
1.4       abs        82: .if ${_PGSQL_VERSION} == "80"
1.10      jlam       83: PGSQL_TYPE=    postgresql80-client
1.9       recht      84: PGPKGSRCDIR=   ../../databases/postgresql80-client
1.4       abs        85: .elif ${_PGSQL_VERSION} == "74"
1.7       jlam       86: PGSQL_TYPE=    postgresql74-lib
1.1       recht      87: PGPKGSRCDIR=   ../../databases/postgresql74-lib
                     88: .elif ${_PGSQL_VERSION} == "73"
1.7       jlam       89: PGSQL_TYPE=    postgresql73-lib
1.1       recht      90: PGPKGSRCDIR=   ../../databases/postgresql73-lib
                     91: .else
                     92: # force an error
1.7       jlam       93: PGSQL_TYPE=            none
1.3       xtraeme    94: PKG_SKIP_REASON+=      "${_PGSQL_VERSION} is not a valid package"
1.1       recht      95: .endif
                     96:
1.8       tv         97: .include "${PGPKGSRCDIR}/buildlink3.mk"
1.7       jlam       98: PGSQL_PREFIX=  ${BUILDLINK_PREFIX.${PGSQL_TYPE}}
1.1       recht      99:
1.11      rillig    100: PGSQL_VERSION= ${_PGSQL_VERSION}
                    101:
1.1       recht     102: .endif # PGVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>