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

1.5     ! dan         1: # $NetBSD: pgsql.buildlink3.mk,v 1.4 2005/02/01 11:07:31 abs Exp $
1.1       recht       2:
                      3: .if !defined(PGVERSION_MK)
                      4: PGVERSION_MK=  defined
                      5:
                      6: .include "../../mk/bsd.prefs.mk"
                      7:
                      8: PGSQL_VERSION_DEFAULT?=                74
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:
                     16: # check what is installed
1.4       abs        17: .if exists(${LOCALBASE}/lib/libecpg.so.4.2)
                     18: _PGSQL_VERSION_80_INSTALLED=   yes
                     19: .endif
1.5     ! dan        20: .if exists(${LOCALBASE}/lib/libecpg.so.4.1)
1.1       recht      21: _PGSQL_VERSION_74_INSTALLED=   yes
                     22: .endif
                     23: .if exists(${LOCALBASE}/lib/libecpg.so.3)
                     24: _PGSQL_VERSION_73_INSTALLED=yes
                     25: .endif
                     26:
                     27: # if a version is explicitely required, take it
                     28: .if defined(PGSQL_VERSION_REQD)
                     29: _PGSQL_VERSION=        ${PGSQL_VERSION_REQD}
                     30: .endif
                     31: # if the default is already installed, it is first choice
                     32: .if !defined(_PGSQL_VERSION)
                     33: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     34: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_INSTALLED)
                     35: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     36: .endif
                     37: .endif
                     38: .endif
                     39: # prefer an already installed version, in order of "accepted"
                     40: .if !defined(_PGSQL_VERSION)
                     41: .for pv in ${PGSQL_VERSIONS_ACCEPTED}
                     42: .if defined(_PGSQL_VERSION_${pv}_INSTALLED)
                     43: _PGSQL_VERSION?=       ${pv}
                     44: .else
                     45: # keep information as last resort - see below
                     46: _PGSQL_VERSION_FIRSTACCEPTED?= ${pv}
                     47: .endif
                     48: .endfor
                     49: .endif
                     50: # if the default is OK for the addon pkg, take this
                     51: .if !defined(_PGSQL_VERSION)
                     52: .if defined(_PGSQL_VERSION_${PGSQL_VERSION_DEFAULT}_OK)
                     53: _PGSQL_VERSION=        ${PGSQL_VERSION_DEFAULT}
                     54: .endif
                     55: .endif
                     56: # take the first one accepted by the package
                     57: .if !defined(_PGSQL_VERSION)
                     58: _PGSQL_VERSION=        ${_PGSQL_VERSION_FIRSTACCEPTED}
                     59: .endif
                     60:
                     61: #
                     62: # set variables for the version we decided to use:
                     63: #
1.4       abs        64: .if ${_PGSQL_VERSION} == "80"
                     65: PGPKGSRCDIR=   ../../wip/postgresql80-lib
                     66: .elif ${_PGSQL_VERSION} == "74"
1.1       recht      67: PGPKGSRCDIR=   ../../databases/postgresql74-lib
                     68: .elif ${_PGSQL_VERSION} == "73"
                     69: PGPKGSRCDIR=   ../../databases/postgresql73-lib
                     70: .else
                     71: # force an error
1.3       xtraeme    72: PKG_SKIP_REASON+=      "${_PGSQL_VERSION} is not a valid package"
1.1       recht      73: .endif
                     74:
                     75: .if (defined(USE_BUILDLINK3) && empty(USE_BUILDLINK3:M[nN][oO]))
                     76: .    include "${PGPKGSRCDIR}/buildlink3.mk"
1.2       recht      77: PGSQL_PREFIX=  ${BUILDLINK_PREFIX.postgresql${_PGSQL_VERSION}-lib}
1.1       recht      78: .endif
                     79:
                     80: .endif # PGVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>