[BACK]Return to builtin.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / net / hesiod

File: [cvs.NetBSD.org] / pkgsrc / net / hesiod / builtin.mk (download)

Revision 1.2, Sun Nov 3 11:45:37 2019 UTC (8 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, HEAD
Changes since 1.1: +7 -7 lines

net: align variable assignments

pkglint -Wall -F --only aligned --only indent -r

No manual corrections.

# $NetBSD: builtin.mk,v 1.2 2019/11/03 11:45:37 rillig Exp $

BUILTIN_PKG:=	hesiod

.include "../../mk/bsd.fast.prefs.mk"

BUILTIN_FIND_FILES_VAR:=	H_HESIOD
BUILTIN_FIND_FILES.H_HESIOD=	/usr/include/hesiod.h

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

###
### Determine if there is a built-in implementation of the package and
### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
###
.if !defined(IS_BUILTIN.hesiod)
IS_BUILTIN.hesiod=	no
.  if empty(H_HESIOD:M__nonexistent__) && empty(H_HESIOD:M${LOCALBASE}/*)
IS_BUILTIN.hesiod=	yes
.  endif
.endif
MAKEVARS+=		IS_BUILTIN.hesiod

###
### 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.hesiod) && \
    !empty(IS_BUILTIN.hesiod:M[yY][eE][sS]) && \
    empty(H_HESIOD:M__nonexistent__)
# 3.0.2: bug fixes. 3.0.1: added HESIOD_INTERFACES symbol
_BLTN_HESIOD_302!=	\
	${GREP} -c HESIOD_INTERFACES ${H_HESIOD} || ${TRUE}
# 3.0.0: added hesiod_* functions
_BLTN_HESIOD_300!=	\
	${GREP} -c hesiod_init ${H_HESIOD} || ${TRUE}

.  if ${_BLTN_HESIOD_302} == "1"
BUILTIN_VERSION.hesiod=	3.0.2
.  elif ${_BLTN_HESIOD_300} == "1"
BUILTIN_VERSION.hesiod=	3.0.0
.  else
BUILTIN_VERSION.hesiod=	2.0.0
.  endif
BUILTIN_PKG.hesiod=	hesiod-${BUILTIN_VERSION.hesiod}
.endif
MAKEVARS+=		BUILTIN_PKG.hesiod

###
### 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.hesiod)
.  if ${PREFER.hesiod} == "pkgsrc"
USE_BUILTIN.hesiod=	no
.  else
USE_BUILTIN.hesiod=	${IS_BUILTIN.hesiod}
.    if defined(BUILTIN_PKG.hesiod) && \
        !empty(IS_BUILTIN.hesiod:M[yY][eE][sS])
USE_BUILTIN.hesiod=	yes
.      for _dep_ in ${BUILDLINK_API_DEPENDS.hesiod}
.        if !empty(USE_BUILTIN.hesiod:M[yY][eE][sS])
USE_BUILTIN.hesiod!=							\
	if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.hesiod:Q}; then \
		${ECHO} yes;						\
	else								\
		${ECHO} no;						\
	fi
.        endif
.      endfor
.    endif
.  endif  # PREFER.hesiod
.endif
MAKEVARS+=		USE_BUILTIN.hesiod