Add files from parent branch HEAD:
[pkgsrc.git] / mk / krb5.buildlink3.mk
1 # $NetBSD: krb5.buildlink3.mk,v 1.10 2006/11/04 22:18:58 rillig Exp $
2 #
3 # This Makefile fragment is meant to be included by packages that
4 # require a Kerberos 5 implementation.  krb5.buildlink3.mk will:
5 #
6 #       * set KRB5BASE to the base directory of the Kerberos 5 files;
7 #       * set KRB5_TYPE to the Kerberos 5 implementation used.
8 #
9 # User-settable variables:
10 #
11 # KRB5_DEFAULT
12 #       The default Kerberos 5 implementation to use.
13 #
14 #       Possible values: heimdal mit-krb5
15 #
16 # Package-settable variables:
17 #
18 # KRB5_ACCEPTED
19 #       The list of Kerberos 5 implementations that can be used by the
20 #       package.
21 #
22 #       Possible values: (see KRB5_DEFAULT)
23 #
24 # Keywords: kerberos heimdal krb krb5 mit-krb5
25
26 KRB5_BUILDLINK3_MK:=    ${KRB5_BUILDLINK3_MK}+
27
28 .include "../../mk/bsd.prefs.mk"
29
30 .if !empty(KRB5_BUILDLINK3_MK:M+)
31 .if ${OPSYS} != Darwin
32 KRB5_DEFAULT?=  heimdal
33 .else
34 KRB5_DEFAULT?=  mit-krb5
35 .endif
36 KRB5_ACCEPTED?= ${_KRB5_PKGS}
37
38 # This is an exhaustive list of all of the Kerberos 5 implementations
39 # that may be used with krb5.buildlink3.mk, in order of precedence.
40 #
41 _KRB5_PKGS?=    heimdal mit-krb5
42
43 _KRB5_DEFAULT=  ${KRB5_DEFAULT}
44 _KRB5_ACCEPTED= ${KRB5_ACCEPTED}
45
46 _KRB5_TYPE?=    ${_KRB5_DEFAULT}
47
48 .  if !empty(_KRB5_ACCEPTED:M${_KRB5_TYPE})
49 KRB5_TYPE=      ${_KRB5_TYPE}
50 .  else
51 KRB5_TYPE=      none
52 .  endif
53 KRB5BASE=       ${BUILDLINK_PREFIX.${KRB5_TYPE}}
54
55 BUILD_DEFS+=            KRB5_DEFAULT
56 BUILD_DEFS_EFFECTS+=    KRB5BASE KRB5_TYPE
57
58 # Packages that use Kerberos are automatically categorized as restricted
59 # packages.
60 #
61 CRYPTO+=        uses Kerberos encryption code
62
63 .endif  # KRB5_BUILDLINK3_MK
64
65 .if ${KRB5_TYPE} == "none"
66 PKG_FAIL_REASON=        \
67         "${_KRB5_TYPE} is not an acceptable Kerberos 5 type for ${PKGNAME}."
68 .elif ${KRB5_TYPE} == "heimdal"
69 .  include "../../security/heimdal/buildlink3.mk"
70 .elif ${KRB5_TYPE} == "mit-krb5"
71 .  include "../../security/mit-krb5/buildlink3.mk"
72 .endif