tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

builtlin.mk for openldap-client: request for review



hi,

attached is a builtlin.mk file for openldap-client, which recongizes
the openldap client libraries in -current NetBSD.

  Since it's my first builtlin.mk file (and openldap-client can break
a lot), I'd like some review before I commit it.  Also, tests on
non-NetBSD systems would be helpful.  (Just drop the attached file
into pkgsrc/databases/openldap-server, see if the presence/absence of
openldap client libraries is detected correctly and if packages built
against them work.)

                                        thanks,
                                        dillo
# $NetBSD$

BUILTIN_PKG:=   openldap-client

BUILTIN_FIND_LIBS:=                     ldap
BUILTIN_FIND_FILES_VAR:=                H_LDAP_FEATURES
BUILTIN_FIND_FILES.H_LDAP_FEATURES=     /usr/include/ldap_features.h

.include "../../mk/buildlink3/bsd.builtin.mk"

.if !defined(IS_BUILTIN.openldap-client)
IS_BUILTIN.openldap-client=     no
.  if empty(H_LDAP_FEATURES:M__nonexistent__) && \
      empty(H_LDAP_FEATURES:M${LOCALBASE}/*)
IS_BUILTIN.openldap-client=     yes
.  endif
.endif
MAKEVARS+=      IS_BUILTIN.openldap-client
#
###
### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
### a package name to represent the built-in package.
###
.if !defined(BUILTIN_PKG.openldap-client) && \
    !empty(IS_BUILTIN.openldap-client:M[yY][eE][sS]) && \
    empty(H_LDAP_FEATURES:M__nonexistent__)
BUILTIN_VERSION.openldap-client!=                               \
        ${AWK} '/\#define[      ]*LDAP_VENDOR_VERSION_MAJOR/ {  \
                        major=$$3;                              \
                }                                               \
                /\#define[      ]*LDAP_VENDOR_VERSION_MINOR/ {  \
                        minor=$$3;                              \
                }                                               \
                /\#define[      ]*LDAP_VENDOR_VERSION_PATCH/ {  \
                        patch=$$3;                              \
                        printf "%s.%s.%s\n",                    \
                                major, minor, patch;            \
                        exit 0;                                 \
                }                                               \
                ' ${H_LDAP_FEATURES}
BUILTIN_PKG.openldap-client=openldap-client-${BUILTIN_VERSION.openldap-client}
.endif
MAKEVARS+=      BUILTIN_PKG.openldap-client
#
###
### Determine whether we should use the built-in implementation if it
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
###
.if !defined(USE_BUILTIN.openldap-client)
.  if ${PREFER.openldap-client} == "pkgsrc"
USE_BUILTIN.openldap-client=    no
.  else
USE_BUILTIN.openldap-client=    ${IS_BUILTIN.openldap-client}
.    if defined(BUILTIN_PKG.openldap-client) && \
        !empty(IS_BUILTIN.openldap-client:M[yY][eE][sS])
USE_BUILTIN.openldap-client=    yes
.      for _dep_ in ${BUILDLINK_API_DEPENDS.openldap-client}
.        if !empty(USE_BUILTIN.openldap-client:M[yY][eE][sS])
USE_BUILTIN.openldap-client!=                                                   
\
        if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.openldap-client:Q}; 
then        \
                ${ECHO} "yes";                                          \
        else                                                            \
                ${ECHO} "no";                                           \
        fi
.        endif
.      endfor
.    endif
.  endif
.endif
MAKEVARS+=      USE_BUILTIN.openldap-client
#
###
### The section below only applies if we are not including this file
### solely to determine whether a built-in implementation exists.
###
CHECK_BUILTIN.openldap-client?= no
.if !empty(CHECK_BUILTIN.openldap-client:M[nN][oO])
#
# Here we place code that depends on whether USE_BUILTIN.openldap-client is
# set to "yes" or "no".
#
.endif  # CHECK_BUILTIN.openldap-client


Home | Main Index | Thread Index | Old Index