Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / security / openpam / builtin.mk
blob6e7f3caf968ed2225eb356c9cfbf7ca7949b3f55
1 # $NetBSD: builtin.mk,v 1.7 2008/01/28 01:15:26 bjs Exp $
3 BUILTIN_PKG:= openpam
5 BUILTIN_FIND_FILES_VAR:= H_OPENPAM
6 BUILTIN_FIND_FILES.H_OPENPAM= /usr/include/security/openpam_version.h
8 .include "../../mk/buildlink3/bsd.builtin.mk"
10 ###
11 ### Determine if there is a built-in implementation of the package and
12 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
13 ###
14 .if !defined(IS_BUILTIN.openpam)
15 IS_BUILTIN.openpam= no
16 . if empty(H_OPENPAM:M__nonexistent__) && empty(H_OPENPAM:M${LOCALBASE}/*)
17 IS_BUILTIN.openpam= yes
18 . endif
19 .endif
20 MAKEVARS+= IS_BUILTIN.openpam
22 ###
23 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
24 ### a package name to represent the built-in package.
25 ###
26 .if !defined(BUILTIN_PKG.openpam) && \
27 !empty(IS_BUILTIN.openpam:M[yY][eE][sS]) && \
28 empty(H_OPENPAM:M__nonexistent__)
29 BUILTIN_VERSION.openpam!= \
30 ${AWK} '/\#define[ ]*_?OPENPAM_VERSION[ ]/ {print $$3; }' \
31 ${H_OPENPAM}
32 BUILTIN_PKG.openpam= openpam-${BUILTIN_VERSION.openpam}
33 .endif
34 MAKEVARS+= BUILTIN_PKG.openpam
36 ###
37 ### Determine whether we should use the built-in implementation if it
38 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
39 ###
40 .if !defined(USE_BUILTIN.openpam)
41 . if ${PREFER.openpam} == "pkgsrc"
42 USE_BUILTIN.openpam= no
43 . else
44 USE_BUILTIN.openpam= ${IS_BUILTIN.openpam}
45 . if defined(BUILTIN_PKG.openpam) && \
46 !empty(IS_BUILTIN.openpam:M[yY][eE][sS])
47 USE_BUILTIN.openpam= yes
48 . for _dep_ in ${BUILDLINK_API_DEPENDS.openpam}
49 . if !empty(USE_BUILTIN.openpam:M[yY][eE][sS])
50 USE_BUILTIN.openpam!= \
51 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.openpam:Q}; then \
52 ${ECHO} yes; \
53 else \
54 ${ECHO} no; \
56 . endif
57 . endfor
58 . endif
59 . endif # PREFER.openpam
60 .endif
61 MAKEVARS+= USE_BUILTIN.openpam