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

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

CVSweb <webmaster@jp.NetBSD.org>