1 # $NetBSD: options.mk,v 1.28 2012/01/30 15:44:02 adam Exp $
3 # Recommended package options for various setups:
5 # Standalone Samba server cups
6 # Domain Member server cups ldap winbind
7 # Active Directory Member server ads cups winbind
8 # Domain Controller ldap winbind
10 PKG_OPTIONS_VAR= PKG_OPTIONS.samba
11 PKG_SUPPORTED_OPTIONS= ads cups fam ldap pam winbind
12 PKG_SUGGESTED_OPTIONS= ads ldap pam winbind
14 .include "../../mk/bsd.fast.prefs.mk"
16 SAMBA_ACL_OPSYS= AIX Darwin FreeBSD HPUX IRIX Linux OSF1 SunOS
17 .if !empty(SAMBA_ACL_OPSYS:M${OPSYS})
18 PKG_SUPPORTED_OPTIONS+= acl
21 .include "../../mk/bsd.options.mk"
23 SAMBA_STATIC_MODULES:= # empty
26 ### Allow Samba to join as a member server of an Active Directory domain.
28 .if !empty(PKG_OPTIONS:Mads)
29 . include "../../mk/krb5.buildlink3.mk"
30 . if empty(PKG_OPTIONS:Mldap)
33 CONFIGURE_ARGS+= --with-ads
34 CONFIGURE_ARGS+= --with-krb5=${KRB5BASE}
36 # Avoid build failures with recent version of Heimdal under NetBSD.
37 . if ${OPSYS} == "NetBSD"
38 CONFIGURE_ENV+= samba_cv_HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER=no
41 # ignore gssapi.h on Solaris as it conflicts with <gssapi/gssapi.h>
42 . if ${OPSYS} == "SunOS"
43 CONFIGURE_ENV+= ac_cv_header_gssapi_h=no
46 CONFIGURE_ARGS+= --without-ads
47 CONFIGURE_ARGS+= --without-krb5
51 ### Access Control List support.
53 .if !empty(PKG_OPTIONS:Macl)
54 CONFIGURE_ARGS+= --with-acl-support
58 ### Native CUPS support for providing printing services.
61 .if !empty(PKG_OPTIONS:Mcups)
62 . include "../../print/cups/buildlink3.mk"
63 CONFIGURE_ARGS+= --enable-cups
65 INSTALLATION_DIRS+= libexec/cups/backend
67 .PHONY: samba-cups-install
68 post-install: samba-cups-install
70 cd ${DESTDIR}${PREFIX}/libexec/cups/backend && \
71 ${LN} -fs ../../../bin/smbspool smb
73 CONFIGURE_ARGS+= --disable-cups
77 ### Access Control List support.
80 .if !empty(PKG_OPTIONS:Mfam)
81 . include "../../mk/fam.buildlink3.mk"
82 CONFIGURE_ARGS+= --enable-fam
85 CONFIGURE_ARGS+= --disable-fam
89 ### Support LDAP authentication and storage of Samba account information.
91 .if !empty(PKG_OPTIONS:Mldap)
92 . include "../../databases/openldap-client/buildlink3.mk"
93 CONFIGURE_ARGS+= --with-ldap
95 CONFIGURE_ARGS+= --without-ldap
99 ### Support PAM authentication and build smbpass and winbind PAM modules.
102 .if !empty(PKG_OPTIONS:Mpam)
103 . include "../../security/PAM/module.mk"
104 CONFIGURE_ARGS+= --with-pam
105 CONFIGURE_ARGS+= --with-pam_smbpass
106 CONFIGURE_ARGS+= --with-pammodulesdir=${PAM_INSTMODULEDIR}
108 INSTALLATION_DIRS+= ${EGDIR}/pam_smbpass
110 .PHONY: samba-pam-smbpass-install
111 post-install: samba-pam-smbpass-install
112 samba-pam-smbpass-install:
113 ${INSTALL_DATA} ${WRKSRC}/pam_smbpass/README \
114 ${DESTDIR}${PREFIX}/${DOCDIR}/README.pam_smbpass
115 cd ${WRKSRC}/pam_smbpass/samples; for f in [a-z]*; do \
116 ${INSTALL_DATA} $${f} \
117 ${DESTDIR}${PREFIX}/${EGDIR}/pam_smbpass/$${f}; \
122 ### Support querying a PDC for domain user and group information, e.g.,
123 ### through NSS or PAM.
126 .if !empty(PKG_OPTIONS:Mwinbind)
127 CONFIGURE_ARGS+= --with-winbind
129 SAMBA_STATIC_MODULES:= ${SAMBA_STATIC_MODULES},idmap_rid
130 . if !empty(PKG_OPTIONS:Mads)
131 SAMBA_STATIC_MODULES:= ${SAMBA_STATIC_MODULES},idmap_ad
134 WINBINDD_RCD_SCRIPT= winbindd
137 # Install the NSS winbind module if it exists.
138 PLIST_SUBST+= NSS_WINBIND=${NSS_WINBIND:Q}
139 NSS_WINBIND= ${NSS_WINBIND_cmd:sh}
141 ${TEST} -x ${WRKSRC}/config.status || \
142 { ${ECHO} "@comment no NSS winbind module" ; exit 0; }; \
143 cd ${WRKDIR} && ${ECHO} @WINBIND_NSS@ | \
144 ${WRKSRC}/config.status --file=-:- | \
145 ${AWK} '/^$$/ { print "@comment no NSS winbind module"; exit 0; } \
146 { sub(".*/", "lib/"); print; }' && \
149 .PHONY: samba-nss-winbind-install
150 post-install: samba-nss-winbind-install
151 samba-nss-winbind-install:
152 lib=${WRKSRC}/nsswitch/${NSS_WINBIND:T:Q}; \
153 ${TEST} ! -f $$lib || ${INSTALL_LIB} $$lib ${DESTDIR}${PREFIX}/lib
155 # Install the NSS WINS module if it exists.
156 PLIST_SUBST+= NSS_WINS=${NSS_WINS:Q}
157 NSS_WINS= ${NSS_WINS_cmd:sh}
159 ${TEST} -x ${WRKSRC}/config.status || \
160 { ${ECHO} "@comment no NSS WINS module" ; exit 0; }; \
161 cd ${WRKDIR} && ${ECHO} @WINBIND_WINS_NSS@ | \
162 ${WRKSRC}/config.status --file=-:- | \
163 ${AWK} '/^$$/ { print "@comment no NSS WINS module"; exit 0; } \
164 { sub(".*/", "lib/"); print; }' && \
167 .PHONY: samba-nss-wins-install
168 post-install: samba-nss-wins-install
169 samba-nss-wins-install:
170 lib=${WRKSRC}/nsswitch/${NSS_WINS:T:Q}; \
171 ${TEST} ! -f $$lib || ${INSTALL_LIB} $$lib ${DESTDIR}${PREFIX}/lib
173 CONFIGURE_ARGS+= --without-winbind
174 PLIST_SUBST+= NSS_WINBIND="no NSS winbind module"
175 PLIST_SUBST+= NSS_WINS="no NSS WINS module"
179 ### Add the optional static modules to the configuration.
181 .if !empty(SAMBA_STATIC_MODULES)
182 CONFIGURE_ARGS+= --with-static-modules=${SAMBA_STATIC_MODULES:S/^,//}