/net/samba/options.mk

https://github.com/joevandyk/pkgsrc · Makefile · 169 lines · 115 code · 20 blank · 34 comment · 11 complexity · 9083c34b0179235b1b8420e731c6a056 MD5 · raw file

  1. # $NetBSD: options.mk,v 1.22 2007/10/28 07:28:46 taca Exp $
  2. # Recommended package options for various setups:
  3. #
  4. # Standalone Samba server cups
  5. # Domain Member server cups ldap winbind
  6. # Active Directory Member server ads cups winbind
  7. # Domain Controller ldap winbind
  8. #
  9. PKG_OPTIONS_VAR= PKG_OPTIONS.samba
  10. PKG_SUPPORTED_OPTIONS= acl ads cups ldap pam winbind
  11. .include "../../mk/bsd.options.mk"
  12. SAMBA_STATIC_MODULES:= # empty
  13. ###
  14. ### Allow Samba to join as a member server of an Active Directory domain.
  15. ###
  16. .if !empty(PKG_OPTIONS:Mads)
  17. . include "../../mk/krb5.buildlink3.mk"
  18. . if empty(PKG_OPTIONS:Mldap)
  19. PKG_OPTIONS+= ldap
  20. . endif
  21. CONFIGURE_ARGS+= --with-ads
  22. CONFIGURE_ARGS+= --with-krb5=${KRB5BASE:Q}
  23. # ignore gssapi.h on Solaris as it conflicts with <gssapi/gssapi.h>
  24. . if ${OPSYS} == "SunOS"
  25. CONFIGURE_ENV+= ac_cv_header_gssapi_h=no
  26. . endif
  27. .else
  28. CONFIGURE_ARGS+= --without-ads
  29. CONFIGURE_ARGS+= --without-krb5
  30. .endif
  31. ###
  32. ### Access Control List support.
  33. ###
  34. .if !empty(PKG_OPTIONS:Macl)
  35. CONFIGURE_ARGS+= --with-acl-support
  36. .endif
  37. ###
  38. ### Native CUPS support for providing printing services.
  39. ###
  40. .if !empty(PKG_OPTIONS:Mcups)
  41. . include "../../print/cups/buildlink3.mk"
  42. CONFIGURE_ARGS+= --enable-cups
  43. PLIST_SUBST+= CUPS=
  44. INSTALLATION_DIRS+= libexec/cups/backend
  45. .PHONY: samba-cups-install
  46. post-install: samba-cups-install
  47. samba-cups-install:
  48. cd ${DESTDIR}${PREFIX}/libexec/cups/backend && \
  49. ${LN} -fs ../../../bin/smbspool smb
  50. .else
  51. CONFIGURE_ARGS+= --disable-cups
  52. PLIST_SUBST+= CUPS="@comment "
  53. .endif
  54. ###
  55. ### Support LDAP authentication and storage of Samba account information.
  56. ###
  57. .if !empty(PKG_OPTIONS:Mldap)
  58. . include "../../databases/openldap-client/buildlink3.mk"
  59. CONFIGURE_ARGS+= --with-ldap
  60. .else
  61. CONFIGURE_ARGS+= --without-ldap
  62. .endif
  63. ###
  64. ### Support PAM authentication and build smbpass and winbind PAM modules.
  65. ###
  66. .if !empty(PKG_OPTIONS:Mpam)
  67. . include "../../security/PAM/module.mk"
  68. CONFIGURE_ARGS+= --with-pam
  69. CONFIGURE_ARGS+= --with-pam_smbpass
  70. CONFIGURE_ARGS+= --with-pammodulesdir=${PAM_INSTMODULEDIR}
  71. PLIST_SUBST+= PAM_SMBPASS=lib/security/pam_smbpass.so
  72. PLIST_SUBST+= PAM=
  73. INSTALLATION_DIRS+= ${EGDIR}/pam_smbpass
  74. .PHONY: samba-pam-smbpass-install
  75. post-install: samba-pam-smbpass-install
  76. samba-pam-smbpass-install:
  77. ${INSTALL_DATA} ${WRKSRC}/pam_smbpass/README \
  78. ${DESTDIR}${PREFIX}/${DOCDIR}/README.pam_smbpass
  79. cd ${WRKSRC}/pam_smbpass/samples; for f in [a-z]*; do \
  80. ${INSTALL_DATA} $${f} \
  81. ${DESTDIR}${PREFIX}/${EGDIR}/pam_smbpass/$${f}; \
  82. done
  83. .else
  84. PLIST_SUBST+= PAM_SMBPASS="@comment no PAM smbpass module"
  85. PLIST_SUBST+= PAM="@comment "
  86. .endif
  87. ###
  88. ### Support querying a PDC for domain user and group information, e.g.,
  89. ### through NSS or PAM.
  90. ###
  91. .if !empty(PKG_OPTIONS:Mwinbind)
  92. CONFIGURE_ARGS+= --with-winbind
  93. SAMBA_STATIC_MODULES:= ${SAMBA_STATIC_MODULES},idmap_rid
  94. . if !empty(PKG_OPTIONS:Mads)
  95. SAMBA_STATIC_MODULES:= ${SAMBA_STATIC_MODULES},idmap_ad
  96. . endif
  97. WINBINDD_RCD_SCRIPT= winbindd
  98. PLIST_SUBST+= WINBIND=
  99. # Install the PAM winbind module if we're also building with PAM support.
  100. . if empty(PKG_OPTIONS:Mpam)
  101. PLIST_SUBST+= PAM_WINBIND="@comment no PAM winbind module"
  102. . else
  103. PLIST_SUBST+= PAM_WINBIND=lib/security/pam_winbind.so
  104. . endif
  105. # Install the NSS winbind module if it exists.
  106. PLIST_SUBST+= NSS_WINBIND=${NSS_WINBIND:Q}
  107. NSS_WINBIND= ${NSS_WINBIND_cmd:sh}
  108. NSS_WINBIND_cmd= \
  109. ${TEST} -x ${WRKSRC}/config.status || \
  110. { ${ECHO} "@comment no NSS winbind module" ; exit 0; }; \
  111. cd ${WRKDIR} && ${ECHO} @WINBIND_NSS@ | \
  112. ${WRKSRC}/config.status --file=-:- | \
  113. ${AWK} '/^$$/ { print "@comment no NSS winbind module"; exit 0; } \
  114. { sub(".*/", "lib/"); print; }' && \
  115. ${RM} -f config.log
  116. .PHONY: samba-nss-winbind-install
  117. post-install: samba-nss-winbind-install
  118. samba-nss-winbind-install:
  119. lib=${WRKSRC:Q}/nsswitch/${NSS_WINBIND:T:Q}; \
  120. ${TEST} ! -f $$lib || ${INSTALL_LIB} $$lib ${DESTDIR}${PREFIX:Q}/lib
  121. # Install the NSS WINS module if it exists.
  122. PLIST_SUBST+= NSS_WINS=${NSS_WINS:Q}
  123. NSS_WINS= ${NSS_WINS_cmd:sh}
  124. NSS_WINS_cmd= \
  125. ${TEST} -x ${WRKSRC}/config.status || \
  126. { ${ECHO} "@comment no NSS WINS module" ; exit 0; }; \
  127. cd ${WRKDIR} && ${ECHO} @WINBIND_WINS_NSS@ | \
  128. ${WRKSRC}/config.status --file=-:- | \
  129. ${AWK} '/^$$/ { print "@comment no NSS WINS module"; exit 0; } \
  130. { sub(".*/", "lib/"); print; }' && \
  131. ${RM} -f config.log
  132. .PHONY: samba-nss-wins-install
  133. post-install: samba-nss-wins-install
  134. samba-nss-wins-install:
  135. lib=${WRKSRC:Q}/nsswitch/${NSS_WINS:T:Q}; \
  136. ${TEST} ! -f $$lib || ${INSTALL_LIB} $$lib ${DESTDIR}${PREFIX:Q}/lib
  137. .else
  138. CONFIGURE_ARGS+= --without-winbind
  139. PLIST_SUBST+= WINBIND="@comment "
  140. PLIST_SUBST+= PAM_WINBIND="@comment no PAM winbind module"
  141. PLIST_SUBST+= NSS_WINBIND="@comment no NSS winbind module"
  142. PLIST_SUBST+= NSS_WINS="@comment no NSS WINS module"
  143. .endif
  144. ###
  145. ### Add the optional static modules to the configuration.
  146. ###
  147. .if !empty(SAMBA_STATIC_MODULES)
  148. CONFIGURE_ARGS+= --with-static-modules=${SAMBA_STATIC_MODULES:S/^,//}
  149. .endif