Index: head/net/samba36/Makefile =================================================================== --- head/net/samba36/Makefile (revision 379837) +++ head/net/samba36/Makefile (revision 379838) @@ -1,549 +1,549 @@ # $FreeBSD$ PORTNAME= ${SAMBA_BASENAME}36 PORTVERSION= 3.6.25 PORTREVISION?= 0 CATEGORIES?= net MASTER_SITES= ${MASTER_SITE_SAMBA} MASTER_SITE_SUBDIR= samba samba/stable samba/pre DISTNAME= ${SAMBA_BASENAME}-${PORTVERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|} MAINTAINER?= timur@FreeBSD.org COMMENT?= Free SMB and CIFS client and server for Unix LICENSE= GPLv3 LICENSE_FILE= ${WRKDIR}/${DISTNAME}/COPYING CONFLICTS?= *samba3[2-5]-3.* # Additional patches from Sernet.de PATCH_STRIP= -p1 EXTRA_PATCHES= ${PATCHDIR}/sernet.patch SAMBA_BASENAME= samba CPE_VENDOR= samba CPE_PRODUCT= samba LATEST_LINK= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX} EXAMPLESDIR= ${PREFIX}/share/examples/${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX} PATCH_WRKSRC= ${WRKDIR}/${DISTNAME} WRKSRC= ${WRKDIR}/${DISTNAME}/source3 IPATHS= -I${WRKDIR}/${DISTNAME}/source3/m4 -I${WRKDIR}/${DISTNAME}/m4 -I${WRKDIR}/${DISTNAME}/lib/replace -I${WRKDIR}/${DISTNAME}/source4 AUTOHEADER_ARGS= ${IPATHS} AUTOCONF_ARGS= ${IPATHS} GNU_CONFIGURE= yes USES= cpe execinfo gmake iconv pkgconfig USE_AUTOTOOLS= autoconf autoheader USE_LDCONFIG= ${SAMBA_LIBDIR} # pkg-config is used to find talloc PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig PKGCONFIGDIR_REL?= ${PKGCONFIGDIR:S|^${PREFIX}/||} # directories VARDIR?= /var SAMBA_SPOOL?= ${VARDIR}/spool/${SAMBA_BASENAME} SAMBA_LOGDIR= ${VARDIR}/log/${SAMBA_BASENAME} SAMBA_RUNDIR= ${VARDIR}/run/${SAMBA_BASENAME} SAMBA_LOCKDIR?= ${VARDIR}/db/${SAMBA_BASENAME} SAMBA_CONFIG?= smb.conf SAMBA_CONFDIR?= ${PREFIX}/etc RC_DIR= ${PREFIX}/etc/rc.d SAMBA_SWATDIR= ${PREFIX}/share/swat SAMBA_LIBDIR= ${PREFIX}/lib SAMBA_MODULEDIR= ${SAMBA_LIBDIR}/${SAMBA_BASENAME} SAMBA_INCLUDEDIR= ${PREFIX}/include/${SAMBA_BASENAME} SAMBA_PRIVATEDIR?= ${SAMBA_CONFDIR}/${SAMBA_BASENAME} CONFIGURE_ARGS+= --exec-prefix="${PREFIX}" \ --sysconfdir="${SAMBA_CONFDIR}" \ --with-configdir="${SAMBA_CONFDIR}" \ --includedir="${SAMBA_INCLUDEDIR}" \ --datadir="${DATADIR}" \ --with-swatdir="${SAMBA_SWATDIR}" \ --libdir="${SAMBA_LIBDIR}" \ --with-pammodulesdir="${SAMBA_LIBDIR}" \ --with-modulesdir="${SAMBA_MODULEDIR}" \ --localstatedir="${VARDIR}" \ --with-piddir="${SAMBA_RUNDIR}" \ --with-ncalrpcdir="${SAMBA_RUNDIR}/ncalrpc" \ --with-nmbdsocketdir="${SAMBA_RUNDIR}/nmbd" \ --with-lockdir="${SAMBA_LOCKDIR}" \ --with-statedir="${SAMBA_LOCKDIR}" \ --with-cachedir="${SAMBA_LOCKDIR}" \ --with-privatedir="${SAMBA_PRIVATEDIR}" \ --with-logfilebase="${SAMBA_LOGDIR}" CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ PTHREAD_LDFLAGS="${PTHREAD_LIBS}" # XXX: Temporary hack for RELENG6 CONFIGURE_ENV+= ac_cv_header_sys_mount_h=yes # XXX: readdir test fails on ZFS, bringing unusable replacement code CONFIGURE_ENV+= libreplace_cv_READDIR_NEEDED=no # tdb BUILD_DEPENDS+= tdb>=1.2.6:${PORTSDIR}/databases/tdb RUN_DEPENDS+= tdb>=1.2.6:${PORTSDIR}/databases/tdb CONFIGURE_ARGS+= --without-libtdb --enable-external-libtdb # talloc BUILD_DEPENDS+= talloc>=2.0.1:${PORTSDIR}/devel/talloc RUN_DEPENDS+= talloc>=2.0.1:${PORTSDIR}/devel/talloc CONFIGURE_ARGS+= --without-libtalloc --enable-external-libtalloc # tevent BUILD_DEPENDS+= tevent>=0.9.11:${PORTSDIR}/devel/tevent RUN_DEPENDS+= tevent>=0.9.11:${PORTSDIR}/devel/tevent CONFIGURE_ARGS+= --without-libtevent --enable-external-libtevent # These options are common for all (sub)ports CONFIGURE_ARGS+= ${ICONV_CONFIGURE_BASE} \ --disable-as-needed .if !defined(SAMBA_SUBPORT) OPTIONS_DEFINE= ACL_SUPPORT ADS AIO_SUPPORT AVAHI CUPS DNSUPDATE \ DOCS EXAMPLES EXP_MODULES FAM IPV6 LDAP \ MAX_DEBUG PAM_SMBPASS POPT PTHREADPOOL QUOTAS \ SMBTORTURE SWAT SYSLOG UTMP WINBIND +OPTIONS_RADIO= GSSAPI +OPTIONS_RADIO_GSSAPI= GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_NONE OPTIONS_DEFAULT= ACL_SUPPORT AIO_SUPPORT CUPS LDAP POPT PTHREADPOOL \ - WINBIND + WINBIND GSSAPI_NONE ACL_SUPPORT_DESC= ACL support + ADS_DESC= Active Directory support -AIO_SUPPORT_DESC= Asynchronous IO support -DNSUPDATE_DESC= Dynamic DNS update (requires ADS) +ADS_CONFIGURE_ON= --with-ads --with-krb5="${GSSAPIBASEDIR}" +ADS_CONFIGURE_OFF= --without-ads --without-krb5 + +AIO_SUPPORT_DESC= Asyncronous IO support +DNSUPDATE_DESC= Dynamic DNS update(require ADS) EXP_MODULES_DESC= Experimental modules + +GSSAPI_BASE_DESC= Use Heimdal in base +GSSAPI_BASE_USES= gssapi +GSSAPI_HEIMDAL_DESC= Use Heimdal from ports +GSSAPI_HEIMDAL_USES= gssapi:heimdal,flags +GSSAPI_MIT_DESC= Use MIT Kerberos V5 +GSSAPI_MIT_USES= gssapi:mit,flags +GSSAPI_NONE_DESC= No Kerberos support + MAX_DEBUG_DESC= Maximum debugging PAM_SMBPASS_DESC= PAM authentication via passdb backends POPT_DESC= System-wide POPT library PTHREADPOOL_DESC= Pthread pool QUOTAS_DESC= Disk quota support SMBTORTURE_DESC= smbtorture SWAT_DESC= SWAT WebGUI UTMP_DESC= UTMP accounting support WINBIND_DESC= WinBIND support # !SAMBA_SUBPORT .endif .include # There are reports that on ARM PIE makes binaries to core dump(#149186) .if ${ARCH} == "arm" CONFIGURE_ARGS+= --disable-pie .endif .if defined(SAMBA_SUBPORT) # Switch off all extra functionality CONFIGURE_ARGS+= --disable-cups --disable-fam --without-winbind \ --without-syslog --without-quotas --without-utmp \ --without-pam --without-pam_smbpass \ --without-aio-support --with-included-popt .else # Samba server itself USE_RC_SUBR= ${SAMBA_BASENAME} SUB_FILES= pkg-message smb.conf.sample PLIST= ${WRKDIR}/.PLIST # We don't (yet) have clustered FS for cluster support CONFIGURE_ARGS+= --with-pam --with-readline=/usr \ --with-included-iniparser \ --with-sendfile-support \ --enable-largefile \ --without-cluster-support \ --without-libsmbclient \ --without-libaddns \ --without-libnetapi \ --without-libsmbsharemodes .if ! ${PORT_OPTIONS:MIPV6} CONFIGURE_ENV+= libreplace_cv_HAVE_IPV6=no .endif .if ${PORT_OPTIONS:MLDAP} SAMBA_WANT_LDAP= yes .endif .if ${PORT_OPTIONS:MCUPS} LIB_DEPENDS+= libcups.so:${PORTSDIR}/print/cups-client CONFIGURE_ARGS+= --enable-cups --enable-iprint SUB_LIST+= CUPS="" .else CONFIGURE_ARGS+= --disable-cups --disable-iprint SUB_LIST+= CUPS="@comment " .endif .if ${PORT_OPTIONS:MMAX_DEBUG} CPPFLAGS+= -g LDFLAGS+= -g LIB_DEPENDS+= libdmalloc.so:${PORTSDIR}/devel/dmalloc CONFIGURE_ARGS+= --enable-debug # --enable-socket-wrapper --enable-nss-wrapper \ # --enable-developer --enable-krb5developer \ # --enable-dmalloc --with-profiling-data CONFIGURE_ARGS+= --with-smbtorture4-path=${WRKDIR}/${DISTNAME}/source4/torture .else CONFIGURE_ARGS+= --disable-debug \ --disable-socket-wrapper --disable-nss-wrapper \ --disable-developer --disable-krb5developer \ --disable-dmalloc --without-profiling-data .endif .if ${PORT_OPTIONS:MSYSLOG} CONFIGURE_ARGS+= --with-syslog .else CONFIGURE_ARGS+= --without-syslog .endif .if ${PORT_OPTIONS:MQUOTAS} CONFIGURE_ARGS+= --with-quotas .else CONFIGURE_ARGS+= --without-quotas .endif .if ${PORT_OPTIONS:MUTMP} CONFIGURE_ARGS+= --with-utmp .else CONFIGURE_ARGS+= --without-utmp .endif .if ${PORT_OPTIONS:MWINBIND} CONFIGURE_ARGS+= --with-winbind PLIST_SUB+= WINBIND="" SUB_LIST+= WINBIND="" .else CONFIGURE_ARGS+= --without-winbind PLIST_SUB+= WINBIND="@comment " SUB_LIST+= WINBIND="@comment " .endif .if ${PORT_OPTIONS:MSWAT} CONFIGURE_ARGS+= --enable-swat PLIST_SUB+= SWAT="" .else CONFIGURE_ARGS+= --disable-swat PLIST_SUB+= SWAT="@comment " .endif # Add some shared modules .if ${PORT_OPTIONS:MEXP_MODULES} . if !defined(WANT_EXP_MODULES) || empty(WANT_EXP_MODULES) WANT_EXP_MODULES= idmap_tdb2 idmap_ad idmap_adex idmap_hash idmap_rid \ charset_weird . if ! ${PORT_OPTIONS:MMAX_DEBUG} WANT_EXP_MODULES+= rpc_echo . endif WANT_EXP_MODULES+= vfs_cacheprime vfs_catia vfs_commit vfs_dirsort \ vfs_readahead vfs_streams_depot vfs_syncops . endif .endif .if ${PORT_OPTIONS:MFAM} USES+= fam WANT_EXP_MODULES+= vfs_notify_fam CONFIGURE_ARGS+= --enable-fam .else CONFIGURE_ARGS+= --disable-fam .endif .if ${PORT_OPTIONS:MACL_SUPPORT} CONFIGURE_ARGS+= --with-acl-support . if ${OSVERSION} > 800000 WANT_EXP_MODULES+= vfs_zfsacl LIB_DEPENDS+= libsunacl.so:${PORTSDIR}/sysutils/libsunacl . endif .else CONFIGURE_ARGS+= --without-acl-support .endif .if ${PORT_OPTIONS:MAIO_SUPPORT} .if ${OSVERSION} < 700055 IGNORE= an AIO support requires 7.0-RELEASE or later. Disable AIO support .endif CONFIGURE_ARGS+= --with-aio-support .else CONFIGURE_ARGS+= --without-aio-support .endif .if ${PORT_OPTIONS:MPAM_SMBPASS} CONFIGURE_ARGS+= --with-pam_smbpass PLIST_SUB+= SMBPASS="" .else CONFIGURE_ARGS+= --without-pam_smbpass PLIST_SUB+= SMBPASS="@comment " .endif .if ${PORT_OPTIONS:MDNSUPDATE} . if ! ${PORT_OPTIONS:MADS} IGNORE= dynamic DNS updates require ADS support. Disable DNSUPDATE support . endif LIB_DEPENDS+= libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid CONFIGURE_ARGS+= --with-dnsupdate .else CONFIGURE_ARGS+= --without-dnsupdate .endif .if ${PORT_OPTIONS:MAVAHI} CPPFLAGS+= `pkg-config --cflags avahi-client` CONFIGURE_ENV+= DNSSD_LIBS="`pkg-config --libs avahi-client`" LIB_DEPENDS+= libavahi-client.so:${PORTSDIR}/net/avahi-app CONFIGURE_ARGS+= --enable-avahi .else CONFIGURE_ARGS+= --disable-avahi .endif .if ${PORT_OPTIONS:MPTHREADPOOL} CONFIGURE_ARGS+= --enable-pthreadpool .else CONFIGURE_ARGS+= --disable-pthreadpool .endif .if ${PORT_OPTIONS:MPOPT} LIB_DEPENDS+= libpopt.so:${PORTSDIR}/devel/popt CONFIGURE_ARGS+= --without-included-popt .else CONFIGURE_ARGS+= --with-included-popt .endif .if ${PORT_OPTIONS:MSMBTORTURE} PLIST_SUB+= SMBTORTURE="" .else PLIST_SUB+= SMBTORTURE="@comment " .endif # !SAMBA_SUBPORT .endif ### ### Common part for port and it's subports ### .if ${PORT_OPTIONS:MADS} -SAMBA_WANT_LDAP= yes -SAMBA_WANT_KRB5= yes -CONFIGURE_ARGS+= --with-ads -.else -CONFIGURE_ARGS+= --without-ads -.endif +. if ${PORT_OPTIONS:MGSSAPI_NONE} # Kerberos5 is necessary for ADS -.if defined(SAMBA_WANT_KRB5) -.if defined(KRB5_HOME) && exists(${KRB5_HOME}/lib/libgssapi_krb5.so) -CONFIGURE_ARGS+= --with-krb5="${KRB5_HOME}" -.elif defined(HEIMDAL_HOME) && exists(${HEIMDAL_HOME}/lib/libgssapi.so) -CONFIGURE_ARGS+= --with-krb5="${HEIMDAL_HOME}" -.elif exists(/usr/lib/libkrb5.so) && exists(/usr/bin/krb5-config) -CONFIGURE_ARGS+= --with-krb5="/usr" -.else -LIB_DEPENDS+= libkrb5.so:${PORTSDIR}/security/heimdal -CONFIGURE_ARGS+= --with-krb5="${LOCALBASE}" -.endif -.else -CONFIGURE_ARGS+= --without-krb5 +IGNORE= ADS support requires GSSAPI_BASE, GSSAPI_HEIMDAL, or GSSAPI_MIT +. endif +SAMBA_WANT_LDAP= yes .endif .if defined(SAMBA_WANT_LDAP) USE_OPENLDAP= yes CONFIGURE_ARGS+= --with-ldap .else CONFIGURE_ARGS+= --without-ldap .endif .if defined(WANT_EXP_MODULES) && !empty(WANT_EXP_MODULES) CONFIGURE_ARGS+= --with-shared-modules="${WANT_EXP_MODULES:Q:C/(\\\\ )+/,/g}" .endif .include post-patch: @${REINPLACE_CMD} -e 's|%%SAMBA_CONFIG%%|${SAMBA_CONFIG}|g' \ ${WRKSRC}/Makefile.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/configure.in ${WRKSRC}/m4/aclocal.m4 ${REINPLACE_CMD} -e '\|^Libs:|d; s|^#Libs:|Libs:|g' \ ${WRKSRC}/pkgconfig/*.pc.in ### ### end of common part ### .if !defined(SAMBA_SUBPORT) # Samba server only SAMBA_MAN1= dbwrap_tool.1 findsmb.1 \ log2pcap.1 nmblookup.1 ntlm_auth.1 profiles.1 rpcclient.1 \ sharesec.1 smbcacls.1 smbclient.1 smbcontrol.1 smbcquotas.1 \ smbget.1 smbstatus.1 smbtar.1 smbtree.1 testparm.1 vfstest.1 SAMBA_MAN5= lmhosts.5 smb.conf.5 smbgetrc.5 smbpasswd.5 SAMBA_MAN7= samba.7 SAMBA_MAN8= eventlogadm.8 net.8 nmbd.8 pdbedit.8 smbd.8 smbpasswd.8 \ smbspool.8 idmap_nss.8 idmap_tdb.8 idmap_tdb2.8 \ vfs_acl_tdb.8 vfs_acl_xattr.8 \ vfs_audit.8 vfs_cap.8 vfs_default_quota.8 vfs_extd_audit.8 \ vfs_fake_perms.8 vfs_full_audit.8 vfs_netatalk.8 \ vfs_preopen.8 \ vfs_readahead.8 vfs_readonly.8 vfs_recycle.8 vfs_shadow_copy.8 \ vfs_shadow_copy2.8 vfs_smb_traffic_analyzer.8 \ vfs_streams_xattr.8 vfs_xattr_tdb.8 .if ${PORT_OPTIONS:MWINBIND} SAMBA_MAN1+= wbinfo.1 SAMBA_MAN5+= pam_winbind.conf.5 SAMBA_MAN7+= winbind_krb5_locator.7 SAMBA_MAN8+= pam_winbind.8 winbindd.8 .endif .if ${PORT_OPTIONS:MSWAT} SAMBA_MAN8+= swat.8 .endif .if ${PORT_OPTIONS:MFAM} SAMBA_MAN8+= vfs_notify_fam.8 .endif .if ${PORT_OPTIONS:MPTHREADPOOL} SAMBA_MAN8+= vfs_aio_pthread.8 .endif .if defined(SAMBA_WANT_LDAP) SAMBA_MAN8+= idmap_ldap.8 .endif .if !empty(WANT_EXP_MODULES:Midmap_ad) SAMBA_MAN8+= idmap_ad.8 .endif .if !empty(WANT_EXP_MODULES:Midmap_adex) SAMBA_MAN8+= idmap_adex.8 .endif .if !empty(WANT_EXP_MODULES:Midmap_hash) SAMBA_MAN8+= idmap_hash.8 .endif .if !empty(WANT_EXP_MODULES:Midmap_rid) SAMBA_MAN8+= idmap_rid.8 .endif .if !empty(WANT_EXP_MODULES:Mvfs_cacheprime) SAMBA_MAN8+= vfs_cacheprime.8 .endif .if !empty(WANT_EXP_MODULES:Mvfs_catia) SAMBA_MAN8+= vfs_catia.8 .endif .if !empty(WANT_EXP_MODULES:Mvfs_commit) SAMBA_MAN8+= vfs_commit.8 .endif .if !empty(WANT_EXP_MODULES:Mvfs_dirsort) SAMBA_MAN8+= vfs_dirsort.8 .endif .if !empty(WANT_EXP_MODULES:Mvfs_streams_depot) SAMBA_MAN8+= vfs_streams_depot.8 .endif SAMBA_SUB= SAMBA_LOGDIR="${SAMBA_LOGDIR}" \ SAMBA_LOCKDIR="${SAMBA_LOCKDIR}" \ SAMBA_CONFDIR="${SAMBA_CONFDIR}" \ SAMBA_CONFIG="${SAMBA_CONFIG}" \ SAMBA_RUNDIR="${SAMBA_RUNDIR}" \ SAMBA_SWATDIR="${SAMBA_SWATDIR}" \ SAMBA_SPOOL="${SAMBA_SPOOL}" \ SAMBA_PRIVATEDIR="${SAMBA_PRIVATEDIR}" \ PKGCONFIGDIR="${PKGCONFIGDIR_REL}" PLIST_SUB+= ${SAMBA_SUB} SUB_LIST+= ${SAMBA_SUB} ALL_TARGET= all .if ${PORT_OPTIONS:MSMBTORTURE} ALL_TARGET+= smbtorture .endif # What will be installed INSTALL_TARGET= installservers installbin installscripts installdat \ installmodules installlibs .if ${PORT_OPTIONS:MSWAT} INSTALL_TARGET+=installswat .endif pre-configure: @${FIND} ${WRKDIR}/${DISTNAME} -type d | ${XARGS} ${CHMOD} u+w,a+rx @${FIND} ${WRKDIR}/${DISTNAME} -type f | ${XARGS} ${CHMOD} u+w,a+r post-configure: # It's in another port @${RM} -f ${WRKDIR}/${DISTNAME}/docs/htmldocs/manpages/libsmbclient.7.html @${RM} -rf ${WRKDIR}/${DISTNAME}/examples/libsmbclient pre-install: -@${FIND} "${STAGEDIR}${SAMBA_MODULEDIR}" -type f -o -type l 2>/dev/null | ${SORT} | ${SED} -E 's|^${STAGEDIR}${PREFIX}/?||;' > ${WRKDIR}/.PLIST.exclude @${CAT} ${PKGDIR}/pkg-plist > ${PLIST} .if ${PORT_OPTIONS:MSWAT} @${CAT} ${PKGDIR}/pkg-plist.swat >> ${PLIST} .endif post-install: @${RM} -f ${STAGEDIR}/${PREFIX}/bin/findsmb .for sect in 1 3 5 7 8 @${MKDIR} ${STAGEDIR}${MAN${sect}PREFIX}/man/man${sect} . for man in ${SAMBA_MAN${sect}} @${INSTALL_MAN} "${WRKDIR}/${DISTNAME}/docs/manpages/${man}" "${STAGEDIR}${MAN${sect}PREFIX}/man/man${sect}" ${ECHO_CMD} "man/man${sect}/${man}.gz" >> ${TMPPLIST} . endfor .endfor # Put examples in place @${MKDIR} "${STAGEDIR}${EXAMPLESDIR}" @${CP} -Rp ${WRKDIR}/${DISTNAME}/examples/* "${STAGEDIR}${EXAMPLESDIR}" .if ${PORT_OPTIONS:MPAM_SMBPASS} @${MKDIR} "${STAGEDIR}${EXAMPLESDIR}/pam_smbpass" @${CP} -Rp ${WRKSRC}/pam_smbpass/samples/* "${STAGEDIR}${EXAMPLESDIR}/pam_smbpass" .endif ${INSTALL_DATA} "${WRKDIR}/smb.conf.sample" "${STAGEDIR}${EXAMPLESDIR}/${SAMBA_CONFIG}.sample" ${INSTALL_DATA} "${WRKDIR}/smb.conf.sample" "${STAGEDIR}${SAMBA_CONFDIR}/${SAMBA_CONFIG}.sample" ${INSTALL_SCRIPT} "${WRKSRC}/script/mksmbpasswd.sh" "${STAGEDIR}${PREFIX}/bin/make_smbpasswd" # Winbind .if ${PORT_OPTIONS:MWINBIND} ${INSTALL_PROGRAM} "${WRKDIR}/${DISTNAME}/nsswitch/nss_winbind.so" "${STAGEDIR}${SAMBA_LIBDIR}/nss_winbind.so.1" ${INSTALL_PROGRAM} "${WRKDIR}/${DISTNAME}/nsswitch/nss_wins.so" "${STAGEDIR}${SAMBA_LIBDIR}/nss_wins.so.1" ${INSTALL_PROGRAM} "${WRKSRC}/bin/pam_winbind.so" "${STAGEDIR}${SAMBA_LIBDIR}" .endif .if ${PORT_OPTIONS:MPAM_SMBPASS} ${INSTALL_PROGRAM} "${WRKSRC}/bin/pam_smbpass.so" "${STAGEDIR}${SAMBA_LIBDIR}" .endif # smbtorture .if ${PORT_OPTIONS:MSMBTORTURE} ${INSTALL_PROGRAM} "${WRKSRC}/bin/smbtorture" "${STAGEDIR}${PREFIX}/bin" .endif # Lib @${FIND} "${STAGEDIR}${SAMBA_MODULEDIR}" -type f -o -type l | ${SED} -E 's|^${STAGEDIR}${PREFIX}/?||;' | ${EGREP} -F -v -f ${WRKDIR}/.PLIST.exclude | ${SORT} >> ${TMPPLIST} @for d in `${FIND} "${STAGEDIR}${SAMBA_MODULEDIR}" -type d | ${SORT} -r | ${SED} -E 's|^${STAGEDIR}${PREFIX}/?||;'`; do \ ${ECHO_CMD} "@unexec rmdir >/dev/null 2>&1 \"%D/$$d\" || true" >> ${TMPPLIST}; \ done # Documentation .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR} @${CP} -Rp "${WRKDIR}/${DISTNAME}/docs/registry" "${STAGEDIR}${DOCSDIR}" . for f in Samba3-ByExample.pdf Samba3-HOWTO.pdf Samba3-Developers-Guide.pdf @${INSTALL_DATA} "${WRKDIR}/${DISTNAME}/docs/${f}" "${STAGEDIR}${DOCSDIR}" . endfor . for f in README COPYING MAINTAINERS.txt PFIF.txt Manifest Roadmap \ WHATSNEW.txt docs/THANKS docs/history @${INSTALL_DATA} "${WRKDIR}/${DISTNAME}/${f}" "${STAGEDIR}${DOCSDIR}" . endfor @${INSTALL_DATA} "${FILESDIR}/README.FreeBSD" "${STAGEDIR}${DOCSDIR}" .endif # Run post-install script .for dir in ${SAMBA_SPOOL} ${SAMBA_LOGDIR} ${SAMBA_RUNDIR} ${SAMBA_LOCKDIR} ${SAMBA_PRIVATEDIR} @${MKDIR} "${STAGEDIR}${dir}" .endfor @${CHMOD} 1777 ${STAGEDIR}${SAMBA_SPOOL} @${CHMOD} 0700 ${STAGEDIR}${SAMBA_PRIVATEDIR} @${CAT} ${PKGMESSAGE} .if ${PORT_OPTIONS:MMAX_DEBUG} test: (cd ${WRKSRC} && ${MAKE_CMD} test_nss_modules test_pam_modules && ${MAKE_CMD} test) .endif # !SAMBA_SUBPORT .endif .include Index: head/net/samba4/Makefile =================================================================== --- head/net/samba4/Makefile (revision 379837) +++ head/net/samba4/Makefile (revision 379838) @@ -1,564 +1,564 @@ # Created by: timur@FreeBSD.org # $FreeBSD$ PORTNAME?= ${SAMBA4_BASENAME}4 PORTVERSION?= ${SAMBA4_VERSION} PORTREVISION?= 0 CATEGORIES?= net MASTER_SITES= ${MASTER_SITE_SAMBA} MASTER_SITE_SUBDIR= samba/stable samba/rc DISTNAME= ${SAMBA4_DISTNAME} MAINTAINER?= timur@FreeBSD.org COMMENT?= Free SMB/CIFS and AD/DC server and client for Unix LICENSE= GPLv3 CONFLICTS?= *samba3[2-6]-3.* samba41-4.1.* SAMBA4_BASENAME= samba SAMBA4_PORTNAME= ${SAMBA4_BASENAME}4 -SAMBA4_VERSION= 4.0.24 +SAMBA4_VERSION= 4.0.25 SAMBA4_DISTNAME= ${SAMBA4_BASENAME}-${SAMBA4_VERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|} WRKSRC?= ${WRKDIR}/${DISTNAME} .if !defined(SAMBA4_SUBPORT) CPE_VENDOR= samba CPE_PRODUCT= samba # Directories VARDIR= ${DESTDIR}/var SAMBA4_RUNDIR= ${VARDIR}/run/${SAMBA4_PORTNAME} SAMBA4_LOGDIR= ${VARDIR}/log/${SAMBA4_PORTNAME} SAMBA4_LOCKDIR= ${VARDIR}/db/${SAMBA4_PORTNAME} SAMBA4_PRIVATEDIR= ${SAMBA4_LOCKDIR}/private SAMBA4_LIBDIR= ${PREFIX}/lib SAMBA4_MODULEDIR= ${SAMBA4_LIBDIR}/shared-modules SAMBA4_INCLUDEDIR= ${PREFIX}/include/${SAMBA4_PORTNAME} SAMBA4_CONFDIR= ${PREFIX}/etc SAMBA4_CONFIG= smb4.conf CONFIGURE_ARGS+= --prefix="${PREFIX}" \ --exec-prefix="${PREFIX}" \ --mandir="${MANPREFIX}/man" \ --sysconfdir="${SAMBA4_CONFDIR}" \ --includedir="${SAMBA4_INCLUDEDIR}" \ --datadir="${DATADIR}" \ --libdir="${SAMBA4_LIBDIR}" \ --with-pammodulesdir="${SAMBA4_LIBDIR}" \ --with-privatelibdir="${SAMBA4_LIBDIR}/samba" \ --with-modulesdir="${SAMBA4_MODULEDIR}" \ --with-pkgconfigdir="${PKGCONFIGDIR}" \ --localstatedir="${VARDIR}" \ --with-piddir="${SAMBA4_RUNDIR}" \ --with-sockets-dir="${SAMBA4_RUNDIR}" \ --with-privileged-socket-dir="${SAMBA4_RUNDIR}" \ --with-lockdir="${SAMBA4_LOCKDIR}" \ --with-statedir="${SAMBA4_LOCKDIR}" \ --with-cachedir="${SAMBA4_LOCKDIR}" \ --with-privatedir="${SAMBA4_PRIVATEDIR}" \ --with-logfilebase="${SAMBA4_LOGDIR}" # Support staging DESTDIRNAME= --destdir # Flags CONFIGURE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ PTHREAD_LDFLAGS="${PTHREAD_LIBS}" USES= compiler cpe execinfo iconv perl5 pkgconfig \ python:2 readline shebangfix USE_PERL5= build USE_LDCONFIG= ${SAMBA4_LIBDIR} WAF_TOOL= buildtools/bin/waf CONFIGURE_LOG= bin/config.log PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig PLIST_SUB+= PKGCONFIGDIR=${PKGCONFIGDIR:S;${PREFIX}/;;} # XXX: Unconditional dependencies which can't be switched off (if present # in the system) # popt LIB_DEPENDS+= libpopt.so:${PORTSDIR}/devel/popt # inotify LIB_DEPENDS+= libinotify.so:${PORTSDIR}/devel/libinotify # SASL LIB_DEPENDS+= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2 # GNUTLS LIB_DEPENDS+= libgcrypt.so:${PORTSDIR}/security/libgcrypt LIB_DEPENDS+= libgnutls.so:${PORTSDIR}/security/gnutls # NFS4 ACL glue LIB_DEPENDS+= libsunacl.so:${PORTSDIR}/sysutils/libsunacl # External Samba dependencies # IDL compiler BUILD_DEPENDS+= p5-Parse-Pidl>=4.0.0:${PORTSDIR}/devel/p5-Parse-Pidl # talloc BUILD_DEPENDS+= talloc>=2.1.0:${PORTSDIR}/devel/talloc RUN_DEPENDS+= talloc>=2.1.0:${PORTSDIR}/devel/talloc SAMBA4_BUNDLED_LIBS+= !talloc # tevent BUILD_DEPENDS+= tevent>=0.9.18:${PORTSDIR}/devel/tevent RUN_DEPENDS+= tevent>=0.9.18:${PORTSDIR}/devel/tevent SAMBA4_BUNDLED_LIBS+= !tevent # tdb BUILD_DEPENDS+= tdb>=1.2.11:${PORTSDIR}/databases/tdb RUN_DEPENDS+= tdb>=1.2.11:${PORTSDIR}/databases/tdb SAMBA4_BUNDLED_LIBS+= !tdb # ldb BUILD_DEPENDS+= ldb>=1.1.17:${PORTSDIR}/databases/ldb RUN_DEPENDS+= ldb>=1.1.17:${PORTSDIR}/databases/ldb SAMBA4_BUNDLED_LIBS+= !ldb # Don't use external libcom_err SAMBA4_BUNDLED_LIBS+= com_err ############################################################################## # Options OPTIONS_DEFINE= ACL_SUPPORT AD_DC ADS AIO_SUPPORT CUPS DEBUG \ DNSUPDATE DOCS FAM LDAP PAM_SMBPASS \ PTHREADPOOL QUOTAS SWAT SYSLOG UTMP OPTIONS_DEFAULT= ACL_SUPPORT AD_DC ADS AIO_SUPPORT DEBUG \ DNSUPDATE DOCS FAM LDAP PAM_SMBPASS \ PTHREADPOOL QUOTAS SWAT SYSLOG UTMP ACL_SUPPORT_DESC= File system ACL support AD_DC_DESC= Active Directory Domain Controller support ADS_DESC= Active Directory client support AIO_SUPPORT_DESC= Asynchronous IO support DNSUPDATE_DESC= Dynamic DNS update (requires ADS) EXP_MODULES_DESC= Experimental modules DEBUG_DESC= With debug information in the binaries LDAP_DESC= LDAP client support PAM_SMBPASS_DESC= PAM authentication via passdb backends PTHREADPOOL_DESC= Pthread pool QUOTAS_DESC= Disk quota support SWAT_DESC= SWAT WebGUI UTMP_DESC= UTMP accounting support ############################################################################## OPTIONS_DEFINE+= DEVELOPER MANPAGES EXP_MODULES DEVELOPER_DESC= With development support MANPAGES_DESC= Build manpages from DOCBOOK templates OPTIONS_RADIO= DNS ZEROCONF OPTIONS_RADIO_DNS= NSUPDATE BIND99 BIND910 OPTIONS_RADIO_ZEROCONF= AVAHI MDNSRESPONDER BIND99_DESC= Use bind99 as AD DC DNS server frontend BIND910_DESC= Use bind910 as AD DC DNS server frontend NSUPDATE_DESC= Use samba NSUPDATE utility for AD DC .include CONFIGURE_ARGS+= \ --with-pam \ --with-iconv \ --with-winbind \ --without-gettext \ --with-sendfile-support \ --builtin-libraries=smbclient \ ${ICONV_CONFIGURE_BASE} # for libexecinfo: (so that __builtin_frame_address() finds the top of the stack) .if ${ARCH} == "amd64" CFLAGS+= -fno-omit-frame-pointer .endif .if ${PORT_OPTIONS:MBIND99} RUN_DEPENDS+= bind99>=9.9.0.0:${PORTSDIR}/dns/bind99 SUB_LIST+= NSUPDATE="@comment " .elif ${PORT_OPTIONS:MBIND910} RUN_DEPENDS+= bind910>=9.10.0.0:${PORTSDIR}/dns/bind910 SUB_LIST+= NSUPDATE="@comment " .elif ${PORT_OPTIONS:MNSUPDATE} RUN_DEPENDS+= samba-nsupdate:${PORTSDIR}/dns/samba-nsupdate SUB_LIST+= NSUPDATE="" .endif .if ${PORT_OPTIONS:MDEBUG} WITH_DEBUG= yes CONFIGURE_ARGS+= --verbose _MAKE_JOBS+= --verbose CONFIGURE_ARGS+= --enable-debug .endif # https://bugzilla.samba.org/show_bug.cgi?id=8969 .if ${PORT_OPTIONS:MDEVELOPER} GDB_CMD?= gdb78 BUILD_DEPENDS+= ${GDB_CMD}:${PORTSDIR}/devel/gdb RUN_DEPENDS+= ${GDB_CMD}:${PORTSDIR}/devel/gdb SAMBA4_MODULES+= auth_skel perfcount_test pdb_test vfs_shadow_copy_test vfs_skel_opaque vfs_skel_transparent vfs_fake_acls CONFIGURE_ARGS+= --enable-developer --enable-socket-wrapper --enable-nss-wrapper --enable-selftest PLIST_SUB+= DEVELOPER="" .else GDB_CMD= true PLIST_SUB+= DEVELOPER="@comment " .endif ############################################################################## # XXX: That will blow up your installation # https://bugzilla.samba.org/show_bug.cgi?id=9302 .if defined(CRAZY) WANT_EXP_MODULES= auth_samba4 auth_script auth_skel auth_unix auth_wbc \ gpext_registry gpext_scripts gpext_security idmap_ad \ idmap_autorid idmap_hash idmap_ldap idmap_passdb \ idmap_rid idmap_tdb idmap_tdb2 idmap_nss nss_info_template \ pdb_ldap pdb_samba_dsdb pdb_smbpasswd pdb_tdbsam \ pdb_test pdb_wbc_sam perfcount_test vfs_acl_tdb \ vfs_acl_xattr vfs_aio_fork vfs_aio_posix \ vfs_aio_pthread vfs_audit vfs_cacheprime vfs_cap \ vfs_catia vfs_commit vfs_crossrename vfs_default_quota \ vfs_dfs_samba4 vfs_dirsort vfs_expand_msdfs vfs_extd_audit \ vfs_fake_acls vfs_fake_perms vfs_full_audit vfs_media_harmony \ vfs_netatalk vfs_posix_eadb vfs_preopen vfs_readahead \ vfs_readonly vfs_recycle vfs_scannedonly vfs_shadow_copy \ vfs_shadow_copy2 vfs_shadow_copy_test vfs_skel_opaque \ vfs_skel_transparent vfs_smb_traffic_analyzer vfs_streams_depot \ vfs_streams_xattr vfs_syncops vfs_time_audit \ vfs_xattr_tdb vfs_zfsacl .endif .if ${PORT_OPTIONS:MEXP_MODULES} . if !defined(WANT_EXP_MODULES) || empty(WANT_EXP_MODULES) WANT_EXP_MODULES= idmap_ad vfs_cacheprime gpext_scripts gpext_security gpext_registry . endif .endif .if ${PORT_OPTIONS:MACL_SUPPORT} . if ${OSVERSION} > 800000 LIB_DEPENDS+= libsunacl.so:${PORTSDIR}/sysutils/libsunacl WANT_EXP_MODULES+= vfs_zfsacl SAMBA4_MODULES+= vfs_zfsacl . endif CONFIGURE_ARGS+= --with-acl-support .else CONFIGURE_ARGS+= --without-acl-support .endif .if ! ${PORT_OPTIONS:MAD_DC} CONFIGURE_ARGS+= --without-ad-dc PLIST_SUB+= AD_DC="@comment " .else PLIST_SUB+= AD_DC="" .endif .if ${PORT_OPTIONS:MADS} SAMBA4_WANT_ADS= yes SAMBA4_WANT_LDAP= yes .endif .if ${PORT_OPTIONS:MAIO_SUPPORT} CONFIGURE_ARGS+= --with-aio-support SAMBA4_MODULES+= vfs_aio_posix .else CONFIGURE_ARGS+= --without-aio-support .endif .if ${PORT_OPTIONS:MAVAHI} LIB_DEPENDS+= libavahi-client.so:${PORTSDIR}/net/avahi-app CONFIGURE_ARGS+= --enable-avahi .else CONFIGURE_ARGS+= --disable-avahi .endif .if ${PORT_OPTIONS:MMDNSRESPONDER} LIB_DEPENDS+= libdns_sd.so:${PORTSDIR}/net/mDNSResponder CONFIGURE_ARGS+= --enable-dnssd .else CONFIGURE_ARGS+= --disable-dnssd .endif .if ${PORT_OPTIONS:MCUPS} LIB_DEPENDS+= libcups.so:${PORTSDIR}/print/cups-client CONFIGURE_ARGS+= --enable-cups --enable-iprint .else CONFIGURE_ARGS+= --disable-cups --disable-iprint .endif .if ${PORT_OPTIONS:MDNSUPDATE} SAMBA_WANT_ADS= yes CONFIGURE_ARGS+= --with-dnsupdate .else CONFIGURE_ARGS+= --without-dnsupdate .endif # https://bugzilla.samba.org/show_bug.cgi?id=9545 .if ${PORT_OPTIONS:MFAM} USES+= fam CONFIGURE_ARGS+= --with-fam WANT_EXP_MODULES+= vfs_notify_fam SAMBA4_MODULES+= vfs_notify_fam .else CONFIGURE_ARGS+= --without-fam .endif .if ${PORT_OPTIONS:MLDAP} SAMBA4_WANT_LDAP= yes .endif .if ${PORT_OPTIONS:MPAM_SMBPASS} CONFIGURE_ARGS+= --with-pam_smbpass PLIST_SUB+= SMBPASS="" .else CONFIGURE_ARGS+= --without-pam_smbpass PLIST_SUB+= SMBPASS="@comment " .endif .if ${PORT_OPTIONS:MPTHREADPOOL} CONFIGURE_ARGS+= --enable-pthreadpool SAMBA4_MODULES+= vfs_aio_pthread .else CONFIGURE_ARGS+= --disable-pthreadpool .endif .if ${PORT_OPTIONS:MQUOTAS} CONFIGURE_ARGS+= --with-quotas .else CONFIGURE_ARGS+= --without-quotas .endif .if ${PORT_OPTIONS:MSYSLOG} CONFIGURE_ARGS+= --with-syslog .else CONFIGURE_ARGS+= --without-syslog .endif .if ${PORT_OPTIONS:MSWAT} CONFIGURE_ARGS+= --with-swat PLIST_SUB+= SWAT="" .else CONFIGURE_ARGS+= --without-swat PLIST_SUB+= SWAT="@comment " .endif .if ${PORT_OPTIONS:MUTMP} CONFIGURE_ARGS+= --with-utmp .else CONFIGURE_ARGS+= --without-utmp .endif .if defined(SAMBA4_WANT_ADS) CONFIGURE_ARGS+= --with-ads .else CONFIGURE_ARGS+= --without-ads .endif .if defined(SAMBA4_WANT_LDAP) USE_OPENLDAP= yes #WANT_OPENLDAP_SASL= yes CONFIGURE_ARGS+= --with-ldap PLIST_SUB+= LDAP="" .else CONFIGURE_ARGS+= --without-ldap PLIST_SUB+= LDAP="@comment " .endif .if ! ${PORT_OPTIONS:MMANPAGES} CONFIGURE_ENV+= XSLTPROC="true" .else BUILD_DEPENDS+= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:${PORTSDIR}/textproc/docbook-xsl \ xsltproc:${PORTSDIR}/textproc/libxslt .endif .if defined(SAMBA4_BUNDLED_LIBS) && !empty(SAMBA4_BUNDLED_LIBS) CONFIGURE_ARGS+= --bundled-libraries="${SAMBA4_BUNDLED_LIBS:Q:C|(\\\\ )+|,|g:S|\\||g}" .endif .if defined(WANT_EXP_MODULES) && !empty(WANT_EXP_MODULES) SAMBA4_MODULES+= ${WANT_EXP_MODULES} CONFIGURE_ARGS+= --with-shared-modules="${WANT_EXP_MODULES:Q:C|(\\\\ )+|,|g:S|\\||g}" .endif # XXX: Dirty .for module in auth_samba4 auth_skel auth_unix auth_wbc gpext_registry gpext_scripts \ gpext_security idmap_ad idmap_ldap idmap_nss idmap_passdb idmap_tdb \ nss_info_template pdb_ldap pdb_samba_dsdb pdb_smbpasswd pdb_tdbsam \ pdb_test pdb_wbc_sam perfcount_test vfs_aio_posix vfs_aio_pthread \ vfs_cacheprime vfs_dfs_samba4 vfs_fake_acls vfs_notify_fam \ vfs_shadow_copy_test vfs_skel_opaque vfs_skel_transparent . if !empty(SAMBA4_MODULES) && ${SAMBA4_MODULES:M${module}} PLIST_SUB+= MODULE_${module:tu}="" . else PLIST_SUB+= MODULE_${module:tu}="@comment " . endif .endfor ############################################################################## # !SAMBA4_SUBPORT .endif .include .if !defined(SAMBA4_SUBPORT) SAMBA4_SUB= SAMBA4_LOGDIR="${SAMBA4_LOGDIR}" \ SAMBA4_RUNDIR="${SAMBA4_RUNDIR}" \ SAMBA4_LOCKDIR="${SAMBA4_LOCKDIR}" \ SAMBA4_MODULEDIR="${SAMBA4_MODULEDIR}" \ SAMBA4_PRIVATEDIR="${SAMBA4_PRIVATEDIR}" \ SAMBA4_CONFDIR="${SAMBA4_CONFDIR}" \ SAMBA4_CONFIG="${SAMBA4_CONFIG}" PLIST_SUB+= ${SAMBA4_SUB} SUB_LIST+= ${SAMBA4_SUB} USE_RC_SUBR= samba_server SUB_FILES= pkg-message README.FreeBSD # Make sure that the right version of Python is used by the tools # https://bugzilla.samba.org/show_bug.cgi?id=7305 python_CMD= ${PYTHON_CMD} python_OLD_CMD= ${SETENV} python SHEBANG_FILES= ${PATCH_WRKSRC}/source4/scripting/bin/* # No fancy color error messages .if ${COMPILER_TYPE} == "clang" CFLAGS+= -fno-color-diagnostics .endif CONFIGURE_ENV+= NOCOLOR=yes MAKE_ENV+= NOCOLOR=yes .if !defined(DISABLE_MAKE_JOBS) && !defined(MAKE_JOBS_UNSAFE) CONFIGURE_ARGS+= --jobs=${MAKE_JOBS_NUMBER} _MAKE_JOBS+= --jobs=${MAKE_JOBS_NUMBER} .endif SAMBA_MAN1+= dbwrap_tool.1 findsmb.1 gentest.1 locktest.1 \ log2pcap.1 masktest.1 ndrdump.1 nmblookup.1 \ nmblookup4.1 ntlm_auth.1 oLschema2ldif.1 \ profiles.1 regdiff.1 regpatch.1 regshell.1 \ regtree.1 rpcclient.1 sharesec.1 smbcacls.1 \ smbclient.1 smbcontrol.1 smbcquotas.1 smbget.1 \ smbstatus.1 smbtar.1 smbtorture.1 smbtree.1 \ testparm.1 vfstest.1 wbinfo.1 SAMBA_MAN5+= lmhosts.5 smbgetrc.5 smbpasswd.5 pam_winbind.conf.5 \ smb.conf.5 SAMBA_MAN7+= samba.7 winbind_krb5_locator.7 SAMBA_MAN8+= eventlogadm.8 idmap_ad.8 idmap_autorid.8 idmap_hash.8 \ idmap_ldap.8 idmap_nss.8 idmap_rid.8 idmap_tdb.8 \ idmap_tdb2.8 net.8 nmbd.8 pam_winbind.8 pdbedit.8 \ samba-tool.8 samba.8 smbd.8 smbpasswd.8 smbspool.8 \ smbta-util.8 swat.8 vfs_acl_tdb.8 vfs_acl_xattr.8 \ vfs_aio_fork.8 vfs_aio_linux.8 vfs_aio_pthread.8 \ vfs_audit.8 vfs_cacheprime.8 vfs_cap.8 vfs_catia.8 \ vfs_commit.8 vfs_crossrename.8 vfs_default_quota.8 \ vfs_dirsort.8 vfs_extd_audit.8 vfs_fake_perms.8 vfs_fileid.8 \ vfs_full_audit.8 vfs_gpfs.8 vfs_media_harmony.8 \ vfs_netatalk.8 vfs_notify_fam.8 vfs_prealloc.8 \ vfs_preopen.8 vfs_readahead.8 vfs_readonly.8 \ vfs_recycle.8 vfs_scannedonly.8 vfs_shadow_copy.8 \ vfs_shadow_copy2.8 vfs_smb_traffic_analyzer.8 \ vfs_streams_depot.8 vfs_streams_xattr.8 vfs_time_audit.8 \ vfs_tsmsm.8 vfs_xattr_tdb.8 winbindd.8 PORTDOCS= README.FreeBSD CONFIGURE_TARGET= configure ALL_TARGET= build INSTALL_TARGET= install IGNORE_NONTHREAD_PYTHON=needs port lang/python${PYTHON_SUFFIX} to be build with THREADS support post-extract: @${RM} -rf ${WRKSRC}/pidl post-patch: @${REINPLACE_CMD} -e 's|$${PKGCONFIGDIR}|${PKGCONFIGDIR}|g' \ ${PATCH_WRKSRC}/buildtools/wafsamba/pkgconfig.py @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${PATCH_WRKSRC}/buildtools/wafsamba/samba_pidl.py \ ${PATCH_WRKSRC}/buildtools/wafsamba/wafsamba.py @${REINPLACE_CMD} -e 's|%%GDB_CMD%%|${GDB_CMD}|g' \ ${PATCH_WRKSRC}/buildtools/scripts/abi_gen.sh @${REINPLACE_CMD} -e 's|%%SAMBA4_CONFIG%%|${SAMBA4_CONFIG}|g' \ ${PATCH_WRKSRC}/dynconfig/wscript # Use threading (or multiprocessing) but not thread (renamed in python 3+). pre-configure: @if ! ${PYTHON_CMD} -c "import multiprocessing;" 2>/dev/null; then \ ${ECHO_CMD}; \ ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE_NONTHREAD_PYTHON:Q}.; \ ${ECHO_CMD}; \ ${FALSE}; \ fi do-configure: @(cd ${CONFIGURE_WRKSRC} && \ ${SET_LATE_CONFIGURE_ARGS} \ if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \ CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="${LDFLAGS}" \ INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \ INSTALL_DATA="${INSTALL_DATA}" \ INSTALL_LIB="${INSTALL_LIB}" \ INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ ${CONFIGURE_ENV} ${PYTHON_CMD} ${CONFIGURE_WRKSRC}/${WAF_TOOL} ${CONFIGURE_ARGS} ${CONFIGURE_TARGET}; then \ ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \ (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ ${FALSE}; \ fi) # XXX: Gross hack to allow build newer Samba while old one is installed. # This implies that LINKFLAGS_PYEMBED contains flags which are already # used in other parts of LINKFLAGS, namely -L$(LOCALBASE)/lib and -pthread post-configure: -${REINPLACE_CMD} -e 's|LINKFLAGS_PYEMBED.*|LINKFLAGS_PYEMBED = []|' \ ${CONFIGURE_WRKSRC}/bin/c4che/default.cache.py pre-build: .if ! ${PORT_OPTIONS:MMANPAGES} . for man in libcli/nbt/man/nmblookup4.1 \ librpc/tools/ndrdump.1 \ source4/lib/registry/man/regdiff.1 \ source4/lib/registry/man/regpatch.1 \ source4/lib/registry/man/regshell.1 \ source4/lib/registry/man/regtree.1 \ source4/torture/man/gentest.1 \ source4/torture/man/locktest.1 \ source4/torture/man/masktest.1 \ source4/torture/man/smbtorture.1 \ source4/utils/man/ntlm_auth4.1 \ source4/utils/man/oLschema2ldif.1 -@${MKDIR} `dirname ${BUILD_WRKSRC}/bin/default/${man}` @${INSTALL_MAN} ${FILESDIR}/man/`basename ${man}` ${BUILD_WRKSRC}/bin/default/${man} . endfor -@${MKDIR} ${BUILD_WRKSRC}/bin/default/docs-xml/manpages . for man in ${SAMBA_MAN1} ${SAMBA_MAN5} ${SAMBA_MAN7} ${SAMBA_MAN8} -@${INSTALL_MAN} ${BUILD_WRKSRC}/docs/manpages/${man} ${BUILD_WRKSRC}/bin/default/docs-xml/manpages . endfor .endif do-build: @(cd ${BUILD_WRKSRC}; \ if ! ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${BUILD_WRKSRC}/${WAF_TOOL} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET}; then \ if [ x != x${BUILD_FAIL_MESSAGE} ] ; then \ ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ (${ECHO_CMD} ${BUILD_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ fi; \ ${FALSE}; \ fi) do-install: @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${INSTALL_WRKSRC}/${WAF_TOOL} ${MAKE_ARGS} ${INSTALL_TARGET}) post-install: @${LN} -sf smb.conf.5.gz ${STAGEDIR}${PREFIX}/man/man5/smb4.conf.5.gz .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR} . for doc in ${PORTDOCS} @${INSTALL_DATA} ${WRKDIR}/${doc} ${STAGEDIR}${DOCSDIR} . endfor .endif # Run post-install script .for dir in ${SAMBA4_LOGDIR} ${SAMBA4_RUNDIR} ${SAMBA4_LOCKDIR} ${SAMBA4_MODULEDIR} ${SAMBA4_PRIVATEDIR} @${MKDIR} "${STAGEDIR}${dir}" .endfor .for dir in auth bind9 gensec gpext idmap ldb nss_info pdb perfcount process_model service vfs @${MKDIR} "${STAGEDIR}${SAMBA4_MODULEDIR}/${dir}" .endfor .if ${PORT_OPTIONS:MDEVELOPER} test: build @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${INSTALL_WRKSRC}/${WAF_TOOL} ${MAKE_ARGS} $@) .endif # !SAMBA4_SUBPORT .endif .include Index: head/net/samba4/distinfo =================================================================== --- head/net/samba4/distinfo (revision 379837) +++ head/net/samba4/distinfo (revision 379838) @@ -1,2 +1,2 @@ -SHA256 (samba-4.0.24.tar.gz) = e1e4068c65684848d8cb17c8997c91be426ff75ccd617f647878307817af615a -SIZE (samba-4.0.24.tar.gz) = 22148369 +SHA256 (samba-4.0.25.tar.gz) = e6a07940a658b81d368fc7ed8e5068bd27188996d73dee1cea9755682cb9a485 +SIZE (samba-4.0.25.tar.gz) = 22150978 Index: head/net/samba4/files/samba_server.in =================================================================== --- head/net/samba4/files/samba_server.in (revision 379837) +++ head/net/samba4/files/samba_server.in (revision 379838) @@ -1,199 +1,196 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: samba_server # REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv ntpd # BEFORE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # #samba_server_enable="YES" # # You can disable/enable any of the Samba daemons by specifying: #samba_enable="NO" #nmbd_enable="NO" #smbd_enable="NO" # You need to enable winbindd separately, by adding: #winbindd_enable="YES" # Configuration file can be set with: #samba_server_config="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%" # . /etc/rc.subr name="samba_server" rcvar=${name}_enable - # Defaults samba_server_config_default="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%" -samba_server_config=${samba_server_config=${samba_server_config_default}} -samba_server_configfile_arg=${samba_server_config:+--configfile="${samba_server_config}"} #" -#testparm_command="%%PREFIX%%/bin/samba-tool testparm --suppress-prompt --verbose ${samba_server_configfile_arg}" -testparm_command="%%PREFIX%%/bin/testparm --suppress-prompt --verbose ${samba_server_config}" smbcontrol_command="%%PREFIX%%/bin/smbcontrol" - # Custom commands extra_commands="reload status" start_precmd="samba_server_prestart" restart_precmd="samba_server_checkconfig" reload_precmd="samba_server_checkconfig" start_cmd="samba_server_cmd" stop_cmd="samba_server_cmd" status_cmd="samba_server_cmd" reload_cmd="samba_server_reload_cmd" rcvar_cmd="samba_server_rcvar_cmd" - samba_server_checkconfig() { echo -n "Performing sanity check on Samba configuration: " if ${testparm_command} >/dev/null 2>&1; then echo "OK" else echo "FAILED" return 1 fi } samba_server_prestart() { # Make sure we have our RUNDIR, even if it's on a tmpfs if [ ! -d "${samba_server_piddir}" -a ! -e "${samba_server_piddir}" ]; then install -m 0755 -d "${samba_server_piddir}" fi # # Remove smbd.pid before starting up samba(needed for s3fs) # if [ -e "${samba_server_piddir}/smbd.pid" ] ; then # rm -f "${samba_server_piddir}/smbd.pid" # fi samba_server_checkconfig } samba_server_rcvar_cmd() { local name rcvar rcvar=${name}_enable # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Check master variable run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} # Check dependent variables for name in ${samba_daemons}; do # XXX rcvars=''; v='' rcvar=${name}_enable run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} done } samba_server_reload_cmd() { local name rcvar command pidfile force_run # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Ignore rcvar and run command if [ -n "${_rc_prefix}" -a "${_rc_prefix}" = "one" ] || [ -n "${rc_force}" ] || [ -n "${rc_fast}" ]; then force_run=yes fi # Apply to all daemons for name in ${samba_daemons}; do rcvar=${name}_enable command="%%PREFIX%%/sbin/${name}" pidfile="${samba_server_piddir}/${name}.pid" # Daemon should be enabled and running if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]; then if [ -n "$(check_pidfile "${pidfile}" "${command}")" ]; then debug "reloading ${name} configuration" echo "Reloading ${name}." ${smbcontrol_command} "${name}" 'reload-config' ${command_args} >/dev/null 2>&1 fi fi done } samba_server_cmd() { local name rcvar rcvars v command pidfile samba_daemons result force_run # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Stop processes in the reverse order if [ "${rc_arg}" = "stop" ] ; then samba_daemons=$(reverse_list ${samba_daemons}) fi # Ignore rcvar and run command if [ -n "${_rc_prefix}" -a "${_rc_prefix}" = "one" ] || [ -n "${rc_force}" ] || [ -n "${rc_fast}" ]; then force_run=yes fi # Assume success result=0 # Apply to all daemons for name in ${samba_daemons}; do # XXX rcvars=''; v='' rcvar=${name}_enable command="%%PREFIX%%/sbin/${name}" pidfile="${samba_server_piddir}/${name}.pid" # Daemon should be enabled and running if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]; then run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} # If any of the commands failed, take it as a global result result=$((${result} || $?)) fi done return ${result} } samba_server_config_init() { local name + # Load configuration + load_rc_config "${name}" + # Defaults + samba_server_enable=${samba_server_enable:=NO} + samba_server_config=${samba_server_config=${samba_server_config_default}} + samba_server_configfile_arg=${samba_server_config:+--configfile="${samba_server_config}"} #" + #testparm_command="%%PREFIX%%/bin/samba-tool testparm --suppress-prompt --verbose ${samba_server_configfile_arg}" + testparm_command="%%PREFIX%%/bin/testparm --suppress-prompt --verbose ${samba_server_config}" # Determine what daemons are necessary to run Samba in the current role samba_server_role=$(${testparm_command} --parameter-name='server role' 2>/dev/null) case "${samba_server_role}" in active\ directory\ domain\ controller) samba_daemons="samba" ;; auto|*) samba_daemons="nmbd smbd winbindd" ;; esac - # Load configuration - load_rc_config "${name}" + # Load daemons configuration for name in ${samba_daemons}; do load_rc_config "${name}" - done - # Defaults - samba_server_enable=${samba_server_enable:=NO} - # Setup dependent variables - if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then - for name in ${samba_daemons}; do - # Winbindd - if [ "${name}" = "winbindd" ]; then + # If samba_server_enable is 'YES' + if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then + if [ "${name}" != "winbindd" ]; then + # Set variable to 'YES' only if it is unset + eval ${name}_enable=\${${name}_enable-YES} + else + # Winbindd samba_server_idmap=$(${testparm_command} --parameter-name='idmap uid' 2>/dev/null) if [ -n "${samba_server_idmap}" ]; then winbindd_enable="YES" fi fi - # Set variable to 'YES' only if it is unset - eval ${name}_enable=\${${name}_enable-YES} - # If variable is empty set it to 'NO' - eval ${name}_enable=\${${name}_enable:-NO} - done - fi + fi + # If variable is empty, set it to 'NO' + eval ${name}_enable=\${${name}_enable:-NO} + done + # Fetch parameters from configuration file + samba_server_lockdir="$(${testparm_command} --parameter-name='lock directory' 2>/dev/null)" + samba_server_lockdir=${samba_server_lockdir:=%%SAMBA4_LOCKDIR%%} + samba_server_piddir="$(${testparm_command} --parameter-name='pid directory' 2>/dev/null)" + samba_server_piddir=${samba_server_piddir:=%%SAMBA4_RUNDIR%%} } # Load configuration variables samba_server_config_init -# Fetch parameters from configuration file -samba_server_lockdir=$(${testparm_command} --parameter-name='lock directory' 2>/dev/null) -samba_server_lockdir=${samba_server_lockdir=%%SAMBA4_LOCKDIR%%} -samba_server_piddir=$(${testparm_command} --parameter-name='pid directory' 2>/dev/null) -samba_server_piddir=${samba_server_piddir=%%SAMBA4_RUNDIR%%} # Common flags command_args=${samba_server_configfile_arg} samba_flags=${samba_flags="--daemon"} nmbd_flags=${nmbd_flags="--daemon"} smbd_flags=${smbd_flags="--daemon"} winbindd_flags=${winbindd_flags="--daemon"} # Requirements required_files="${samba_server_config}" required_dirs="${samba_server_lockdir}" run_rc_command "$1" Index: head/net/samba41/Makefile =================================================================== --- head/net/samba41/Makefile (revision 379837) +++ head/net/samba41/Makefile (revision 379838) @@ -1,564 +1,564 @@ # Created by: timur@FreeBSD.org # $FreeBSD$ PORTNAME?= ${SAMBA4_BASENAME}41 PORTVERSION?= ${SAMBA4_VERSION} PORTREVISION?= 0 CATEGORIES?= net MASTER_SITES= ${MASTER_SITE_SAMBA} MASTER_SITE_SUBDIR= samba/stable samba/rc DISTNAME= ${SAMBA4_DISTNAME} MAINTAINER?= timur@FreeBSD.org COMMENT?= Free SMB/CIFS and AD/DC server and client for Unix LICENSE= GPLv3 CONFLICTS?= *samba3[2-6]-3.* samba4-4.0.* SAMBA4_BASENAME= samba SAMBA4_PORTNAME= ${SAMBA4_BASENAME}4 -SAMBA4_VERSION= 4.1.16 +SAMBA4_VERSION= 4.1.17 SAMBA4_DISTNAME= ${SAMBA4_BASENAME}-${SAMBA4_VERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|} WRKSRC?= ${WRKDIR}/${DISTNAME} .if !defined(SAMBA4_SUBPORT) CPE_VENDOR= samba CPE_PRODUCT= samba # Directories VARDIR= ${DESTDIR}/var SAMBA4_RUNDIR= ${VARDIR}/run/${SAMBA4_PORTNAME} SAMBA4_LOGDIR= ${VARDIR}/log/${SAMBA4_PORTNAME} SAMBA4_LOCKDIR= ${VARDIR}/db/${SAMBA4_PORTNAME} SAMBA4_PRIVATEDIR= ${SAMBA4_LOCKDIR}/private SAMBA4_LIBDIR= ${PREFIX}/lib SAMBA4_MODULEDIR= ${SAMBA4_LIBDIR}/shared-modules SAMBA4_INCLUDEDIR= ${PREFIX}/include/${SAMBA4_PORTNAME} SAMBA4_CONFDIR= ${PREFIX}/etc SAMBA4_CONFIG= smb4.conf CONFIGURE_ARGS+= --prefix="${PREFIX}" \ --exec-prefix="${PREFIX}" \ --mandir="${MANPREFIX}/man" \ --sysconfdir="${SAMBA4_CONFDIR}" \ --includedir="${SAMBA4_INCLUDEDIR}" \ --datadir="${DATADIR}" \ --libdir="${SAMBA4_LIBDIR}" \ --with-pammodulesdir="${SAMBA4_LIBDIR}" \ --with-privatelibdir="${SAMBA4_LIBDIR}/samba" \ --with-modulesdir="${SAMBA4_MODULEDIR}" \ --with-pkgconfigdir="${PKGCONFIGDIR}" \ --localstatedir="${VARDIR}" \ --with-piddir="${SAMBA4_RUNDIR}" \ --with-sockets-dir="${SAMBA4_RUNDIR}" \ --with-privileged-socket-dir="${SAMBA4_RUNDIR}" \ --with-lockdir="${SAMBA4_LOCKDIR}" \ --with-statedir="${SAMBA4_LOCKDIR}" \ --with-cachedir="${SAMBA4_LOCKDIR}" \ --with-privatedir="${SAMBA4_PRIVATEDIR}" \ --with-logfilebase="${SAMBA4_LOGDIR}" # Support staging DESTDIRNAME= --destdir # Flags CONFIGURE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ PTHREAD_LDFLAGS="${PTHREAD_LIBS}" USES= compiler cpe execinfo iconv perl5 pkgconfig \ python:2 readline shebangfix USE_PERL5= build USE_LDCONFIG= ${SAMBA4_LIBDIR} WAF_TOOL= buildtools/bin/waf CONFIGURE_LOG= bin/config.log PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig PLIST_SUB+= PKGCONFIGDIR=${PKGCONFIGDIR:S;${PREFIX}/;;} # XXX: Unconditional dependencies which can't be switched off (if present # in the system) # popt LIB_DEPENDS+= libpopt.so:${PORTSDIR}/devel/popt # inotify LIB_DEPENDS+= libinotify.so:${PORTSDIR}/devel/libinotify # SASL LIB_DEPENDS+= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2 # GNUTLS LIB_DEPENDS+= libgcrypt.so:${PORTSDIR}/security/libgcrypt LIB_DEPENDS+= libgnutls.so:${PORTSDIR}/security/gnutls # NFS4 ACL glue LIB_DEPENDS+= libsunacl.so:${PORTSDIR}/sysutils/libsunacl # External Samba dependencies # IDL compiler BUILD_DEPENDS+= p5-Parse-Pidl>=4.0.0:${PORTSDIR}/devel/p5-Parse-Pidl # BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dnspython>=1.9.4:${PORTSDIR}/dns/py-dnspython RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dnspython>=1.9.4:${PORTSDIR}/dns/py-dnspython PLIST_SUB+= PY_DNSPYTHON="@comment " # talloc BUILD_DEPENDS+= talloc>=2.1.0:${PORTSDIR}/devel/talloc RUN_DEPENDS+= talloc>=2.1.0:${PORTSDIR}/devel/talloc SAMBA4_BUNDLED_LIBS+= !talloc # tevent BUILD_DEPENDS+= tevent>=0.9.18:${PORTSDIR}/devel/tevent RUN_DEPENDS+= tevent>=0.9.18:${PORTSDIR}/devel/tevent SAMBA4_BUNDLED_LIBS+= !tevent # tdb -BUILD_DEPENDS+= tdb>=1.2.11:${PORTSDIR}/databases/tdb -RUN_DEPENDS+= tdb>=1.2.11:${PORTSDIR}/databases/tdb +BUILD_DEPENDS+= tdb>=1.2.12:${PORTSDIR}/databases/tdb +RUN_DEPENDS+= tdb>=1.2.12:${PORTSDIR}/databases/tdb SAMBA4_BUNDLED_LIBS+= !tdb # ntdb BUILD_DEPENDS+= ntdb>=1.0:${PORTSDIR}/databases/ntdb RUN_DEPENDS+= ntdb>=1.0:${PORTSDIR}/databases/ntdb SAMBA4_BUNDLED_LIBS+= !ntdb # ldb BUILD_DEPENDS+= ldb>=1.1.17:${PORTSDIR}/databases/ldb RUN_DEPENDS+= ldb>=1.1.17:${PORTSDIR}/databases/ldb SAMBA4_BUNDLED_LIBS+= !ldb # Don't use external libcom_err SAMBA4_BUNDLED_LIBS+= com_err ############################################################################## # Options OPTIONS_DEFINE= ACL_SUPPORT AD_DC ADS AIO_SUPPORT CUPS DEBUG \ DNSUPDATE DOCS FAM LDAP PAM_SMBPASS \ PTHREADPOOL QUOTAS SYSLOG UTMP OPTIONS_DEFAULT= ACL_SUPPORT AD_DC ADS AIO_SUPPORT DEBUG \ DNSUPDATE DOCS FAM LDAP \ PTHREADPOOL QUOTAS SYSLOG UTMP ACL_SUPPORT_DESC= File system ACL support AD_DC_DESC= Active Directory Domain Controller support ADS_DESC= Active Directory client support AIO_SUPPORT_DESC= Asynchronous IO support DNSUPDATE_DESC= Dynamic DNS update (requires ADS) EXP_MODULES_DESC= Experimental modules DEBUG_DESC= With debug information in the binaries LDAP_DESC= LDAP client support PAM_SMBPASS_DESC= PAM authentication via passdb backends PTHREADPOOL_DESC= Pthread pool QUOTAS_DESC= Disk quota support UTMP_DESC= UTMP accounting support ############################################################################## OPTIONS_DEFINE+= DEVELOPER MANPAGES EXP_MODULES DEVELOPER_DESC= With development support MANPAGES_DESC= Build manpages from DOCBOOK templates OPTIONS_RADIO= DNS ZEROCONF OPTIONS_RADIO_DNS= NSUPDATE BIND99 BIND910 OPTIONS_RADIO_ZEROCONF= AVAHI MDNSRESPONDER BIND99_DESC= Use bind99 as AD DC DNS server frontend BIND910_DESC= Use bind910 as AD DC DNS server frontend NSUPDATE_DESC= Use samba NSUPDATE utility for AD DC .include CONFIGURE_ARGS+= \ --with-pam \ --with-iconv \ --with-winbind \ --without-gettext \ --with-sendfile-support \ --builtin-libraries=smbclient \ ${ICONV_CONFIGURE_BASE} # for libexecinfo: (so that __builtin_frame_address() finds the top of the stack) .if ${ARCH} == "amd64" CFLAGS+= -fno-omit-frame-pointer .endif .if ${PORT_OPTIONS:MBIND99} RUN_DEPENDS+= bind99>=9.9.0.0:${PORTSDIR}/dns/bind99 SUB_LIST+= NSUPDATE="@comment " .elif ${PORT_OPTIONS:MBIND910} RUN_DEPENDS+= bind910>=9.10.0.0:${PORTSDIR}/dns/bind910 SUB_LIST+= NSUPDATE="@comment " .elif ${PORT_OPTIONS:MNSUPDATE} RUN_DEPENDS+= samba-nsupdate:${PORTSDIR}/dns/samba-nsupdate SUB_LIST+= NSUPDATE="" .endif .if ${PORT_OPTIONS:MDEBUG} WITH_DEBUG= yes CONFIGURE_ARGS+= --verbose _MAKE_JOBS+= --verbose CONFIGURE_ARGS+= --enable-debug .endif # https://bugzilla.samba.org/show_bug.cgi?id=8969 .if ${PORT_OPTIONS:MDEVELOPER} GDB_CMD?= gdb78 BUILD_DEPENDS+= ${GDB_CMD}:${PORTSDIR}/devel/gdb RUN_DEPENDS+= ${GDB_CMD}:${PORTSDIR}/devel/gdb SAMBA4_MODULES+= auth_skel perfcount_test pdb_test vfs_shadow_copy_test vfs_skel_opaque vfs_skel_transparent vfs_fake_acls CONFIGURE_ARGS+= --enable-developer --enable-socket-wrapper --enable-nss-wrapper --enable-selftest PLIST_SUB+= DEVELOPER="" .else GDB_CMD= true PLIST_SUB+= DEVELOPER="@comment " .endif ############################################################################## # XXX: That will blow up your installation # https://bugzilla.samba.org/show_bug.cgi?id=9302 .if defined(CRAZY) WANT_EXP_MODULES= auth_samba4 auth_script auth_skel auth_unix auth_wbc \ gpext_registry gpext_scripts gpext_security idmap_ad \ idmap_autorid idmap_hash idmap_ldap idmap_passdb \ idmap_rid idmap_tdb idmap_tdb2 idmap_nss nss_info_template \ pdb_ldap pdb_samba_dsdb pdb_smbpasswd pdb_tdbsam \ pdb_test pdb_wbc_sam perfcount_test vfs_acl_tdb \ vfs_acl_xattr vfs_aio_fork vfs_aio_posix \ vfs_aio_pthread vfs_audit vfs_cacheprime vfs_cap \ vfs_catia vfs_commit vfs_crossrename vfs_default_quota \ vfs_dfs_samba4 vfs_dirsort vfs_expand_msdfs vfs_extd_audit \ vfs_fake_acls vfs_fake_perms vfs_full_audit vfs_media_harmony \ vfs_netatalk vfs_posix_eadb vfs_preopen vfs_readahead \ vfs_readonly vfs_recycle vfs_scannedonly vfs_shadow_copy \ vfs_shadow_copy2 vfs_shadow_copy_test vfs_skel_opaque \ vfs_skel_transparent vfs_smb_traffic_analyzer vfs_streams_depot \ vfs_streams_xattr vfs_syncops vfs_time_audit \ vfs_xattr_tdb vfs_zfsacl .endif .if ${PORT_OPTIONS:MEXP_MODULES} . if !defined(WANT_EXP_MODULES) || empty(WANT_EXP_MODULES) WANT_EXP_MODULES= idmap_ad vfs_cacheprime gpext_scripts gpext_security gpext_registry . endif .endif .if ${PORT_OPTIONS:MACL_SUPPORT} . if ${OSVERSION} > 800000 LIB_DEPENDS+= libsunacl.so:${PORTSDIR}/sysutils/libsunacl WANT_EXP_MODULES+= vfs_zfsacl SAMBA4_MODULES+= vfs_zfsacl . endif CONFIGURE_ARGS+= --with-acl-support .else CONFIGURE_ARGS+= --without-acl-support .endif .if ! ${PORT_OPTIONS:MAD_DC} CONFIGURE_ARGS+= --without-ad-dc PLIST_SUB+= AD_DC="@comment " .else PLIST_SUB+= AD_DC="" .endif .if ${PORT_OPTIONS:MADS} SAMBA4_WANT_ADS= yes SAMBA4_WANT_LDAP= yes .endif .if ${PORT_OPTIONS:MAIO_SUPPORT} CONFIGURE_ARGS+= --with-aio-support SAMBA4_MODULES+= vfs_aio_posix .else CONFIGURE_ARGS+= --without-aio-support .endif .if ${PORT_OPTIONS:MAVAHI} LIB_DEPENDS+= libavahi-client.so:${PORTSDIR}/net/avahi-app CONFIGURE_ARGS+= --enable-avahi .else CONFIGURE_ARGS+= --disable-avahi .endif .if ${PORT_OPTIONS:MMDNSRESPONDER} LIB_DEPENDS+= libdns_sd.so:${PORTSDIR}/net/mDNSResponder CONFIGURE_ARGS+= --enable-dnssd .else CONFIGURE_ARGS+= --disable-dnssd .endif .if ${PORT_OPTIONS:MCUPS} LIB_DEPENDS+= libcups.so:${PORTSDIR}/print/cups-client CONFIGURE_ARGS+= --enable-cups --enable-iprint .else CONFIGURE_ARGS+= --disable-cups --disable-iprint .endif .if ${PORT_OPTIONS:MDNSUPDATE} SAMBA_WANT_ADS= yes CONFIGURE_ARGS+= --with-dnsupdate .else CONFIGURE_ARGS+= --without-dnsupdate .endif # https://bugzilla.samba.org/show_bug.cgi?id=9545 .if ${PORT_OPTIONS:MFAM} USES+= fam CONFIGURE_ARGS+= --with-fam WANT_EXP_MODULES+= vfs_notify_fam SAMBA4_MODULES+= vfs_notify_fam .else CONFIGURE_ARGS+= --without-fam .endif .if ${PORT_OPTIONS:MLDAP} SAMBA4_WANT_LDAP= yes .endif .if ${PORT_OPTIONS:MPAM_SMBPASS} CONFIGURE_ARGS+= --with-pam_smbpass PLIST_SUB+= SMBPASS="" .else CONFIGURE_ARGS+= --without-pam_smbpass PLIST_SUB+= SMBPASS="@comment " .endif .if ${PORT_OPTIONS:MPTHREADPOOL} CONFIGURE_ARGS+= --enable-pthreadpool SAMBA4_MODULES+= vfs_aio_pthread .else CONFIGURE_ARGS+= --disable-pthreadpool .endif .if ${PORT_OPTIONS:MQUOTAS} CONFIGURE_ARGS+= --with-quotas .else CONFIGURE_ARGS+= --without-quotas .endif .if ${PORT_OPTIONS:MSYSLOG} CONFIGURE_ARGS+= --with-syslog .else CONFIGURE_ARGS+= --without-syslog .endif .if ${PORT_OPTIONS:MUTMP} CONFIGURE_ARGS+= --with-utmp .else CONFIGURE_ARGS+= --without-utmp .endif .if defined(SAMBA4_WANT_ADS) CONFIGURE_ARGS+= --with-ads .else CONFIGURE_ARGS+= --without-ads .endif .if defined(SAMBA4_WANT_LDAP) USE_OPENLDAP= yes #WANT_OPENLDAP_SASL= yes CONFIGURE_ARGS+= --with-ldap PLIST_SUB+= LDAP="" .else CONFIGURE_ARGS+= --without-ldap PLIST_SUB+= LDAP="@comment " .endif .if ! ${PORT_OPTIONS:MMANPAGES} CONFIGURE_ENV+= XSLTPROC="true" .else BUILD_DEPENDS+= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:${PORTSDIR}/textproc/docbook-xsl \ xsltproc:${PORTSDIR}/textproc/libxslt .endif .if defined(SAMBA4_BUNDLED_LIBS) && !empty(SAMBA4_BUNDLED_LIBS) CONFIGURE_ARGS+= --bundled-libraries="${SAMBA4_BUNDLED_LIBS:Q:C|(\\\\ )+|,|g:S|\\||g}" .endif .if defined(WANT_EXP_MODULES) && !empty(WANT_EXP_MODULES) SAMBA4_MODULES+= ${WANT_EXP_MODULES} CONFIGURE_ARGS+= --with-shared-modules="${WANT_EXP_MODULES:Q:C|(\\\\ )+|,|g:S|\\||g}" .endif # XXX: Dirty .for module in auth_samba4 auth_skel auth_unix auth_wbc gpext_registry gpext_scripts \ gpext_security idmap_ad idmap_ldap idmap_nss idmap_passdb idmap_tdb \ nss_info_template pdb_ldap pdb_samba_dsdb pdb_smbpasswd pdb_tdbsam \ pdb_test pdb_wbc_sam perfcount_test vfs_aio_posix vfs_aio_pthread \ vfs_cacheprime vfs_dfs_samba4 vfs_fake_acls vfs_notify_fam \ vfs_shadow_copy_test vfs_skel_opaque vfs_skel_transparent . if !empty(SAMBA4_MODULES) && ${SAMBA4_MODULES:M${module}} PLIST_SUB+= MODULE_${module:tu}="" . else PLIST_SUB+= MODULE_${module:tu}="@comment " . endif .endfor ############################################################################## # !SAMBA4_SUBPORT .endif .include .if !defined(SAMBA4_SUBPORT) SAMBA4_SUB= SAMBA4_LOGDIR="${SAMBA4_LOGDIR}" \ SAMBA4_RUNDIR="${SAMBA4_RUNDIR}" \ SAMBA4_LOCKDIR="${SAMBA4_LOCKDIR}" \ SAMBA4_MODULEDIR="${SAMBA4_MODULEDIR}" \ SAMBA4_PRIVATEDIR="${SAMBA4_PRIVATEDIR}" \ SAMBA4_CONFDIR="${SAMBA4_CONFDIR}" \ SAMBA4_CONFIG="${SAMBA4_CONFIG}" PLIST_SUB+= ${SAMBA4_SUB} SUB_LIST+= ${SAMBA4_SUB} USE_RC_SUBR= samba_server SUB_FILES= pkg-message README.FreeBSD # Make sure that the right version of Python is used by the tools # https://bugzilla.samba.org/show_bug.cgi?id=7305 python_CMD= ${PYTHON_CMD} python_OLD_CMD= ${SETENV} python SHEBANG_FILES= ${PATCH_WRKSRC}/source4/scripting/bin/* # No fancy color error messages .if ${COMPILER_TYPE} == "clang" CFLAGS+= -fno-color-diagnostics .endif CONFIGURE_ENV+= NOCOLOR=yes MAKE_ENV+= NOCOLOR=yes .if !defined(DISABLE_MAKE_JOBS) && !defined(MAKE_JOBS_UNSAFE) CONFIGURE_ARGS+= --jobs=${MAKE_JOBS_NUMBER} _MAKE_JOBS+= --jobs=${MAKE_JOBS_NUMBER} .endif SAMBA_MAN1+= dbwrap_tool.1 findsmb.1 gentest.1 locktest.1 \ log2pcap.1 masktest.1 ndrdump.1 nmblookup.1 \ nmblookup4.1 ntlm_auth.1 oLschema2ldif.1 \ profiles.1 regdiff.1 regpatch.1 regshell.1 \ regtree.1 rpcclient.1 sharesec.1 smbcacls.1 \ smbclient.1 smbcontrol.1 smbcquotas.1 smbget.1 \ smbstatus.1 smbtar.1 smbtorture.1 smbtree.1 \ testparm.1 vfstest.1 wbinfo.1 SAMBA_MAN5+= lmhosts.5 smbgetrc.5 smbpasswd.5 pam_winbind.conf.5 \ smb.conf.5 SAMBA_MAN7+= samba.7 winbind_krb5_locator.7 SAMBA_MAN8+= eventlogadm.8 idmap_ad.8 idmap_autorid.8 idmap_hash.8 \ idmap_ldap.8 idmap_nss.8 idmap_rfc2307.8 idmap_rid.8 \ idmap_tdb.8 idmap_tdb2.8 net.8 nmbd.8 pam_winbind.8 pdbedit.8 \ samba-regedit.8 samba-tool.8 samba.8 smbd.8 smbpasswd.8 \ smbspool.8 smbta-util.8 vfs_acl_tdb.8 vfs_acl_xattr.8 \ vfs_aio_fork.8 vfs_aio_linux.8 vfs_aio_pthread.8 \ vfs_audit.8 vfs_cacheprime.8 vfs_cap.8 vfs_catia.8 \ vfs_commit.8 vfs_crossrename.8 vfs_default_quota.8 \ vfs_dirsort.8 vfs_extd_audit.8 vfs_fake_perms.8 vfs_fileid.8 \ vfs_full_audit.8 vfs_gpfs.8 vfs_media_harmony.8 \ vfs_netatalk.8 vfs_notify_fam.8 vfs_prealloc.8 \ vfs_preopen.8 vfs_readahead.8 vfs_readonly.8 \ vfs_recycle.8 vfs_scannedonly.8 vfs_shadow_copy.8 \ vfs_shadow_copy2.8 vfs_smb_traffic_analyzer.8 \ vfs_streams_depot.8 vfs_streams_xattr.8 vfs_syncops.8 vfs_time_audit.8 \ vfs_tsmsm.8 vfs_xattr_tdb.8 winbindd.8 \ vfs_linux_xfs_sgid.8 vfs_btrfs.8 PORTDOCS= README.FreeBSD CONFIGURE_TARGET= configure ALL_TARGET= build INSTALL_TARGET= install IGNORE_NONTHREAD_PYTHON=needs port lang/python${PYTHON_SUFFIX} to be build with THREADS support post-extract: @${RM} -rf ${WRKSRC}/pidl post-patch: @${REINPLACE_CMD} -e 's|$${PKGCONFIGDIR}|${PKGCONFIGDIR}|g' \ ${PATCH_WRKSRC}/buildtools/wafsamba/pkgconfig.py @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${PATCH_WRKSRC}/buildtools/wafsamba/samba_pidl.py \ ${PATCH_WRKSRC}/buildtools/wafsamba/wafsamba.py @${REINPLACE_CMD} -e 's|%%GDB_CMD%%|${GDB_CMD}|g' \ ${PATCH_WRKSRC}/buildtools/scripts/abi_gen.sh @${REINPLACE_CMD} -e 's|%%SAMBA4_CONFIG%%|${SAMBA4_CONFIG}|g' \ ${PATCH_WRKSRC}/dynconfig/wscript # Use threading (or multiprocessing) but not thread (renamed in python 3+). pre-configure: @if ! ${PYTHON_CMD} -c "import multiprocessing;" 2>/dev/null; then \ ${ECHO_CMD}; \ ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE_NONTHREAD_PYTHON:Q}.; \ ${ECHO_CMD}; \ ${FALSE}; \ fi do-configure: @(cd ${CONFIGURE_WRKSRC} && \ ${SET_LATE_CONFIGURE_ARGS} \ if ! ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \ CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="${LDFLAGS}" \ INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \ INSTALL_DATA="${INSTALL_DATA}" \ INSTALL_LIB="${INSTALL_LIB}" \ INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ ${CONFIGURE_ENV} ${PYTHON_CMD} ${CONFIGURE_WRKSRC}/${WAF_TOOL} ${CONFIGURE_ARGS} ${CONFIGURE_TARGET}; then \ ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \ (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ ${FALSE}; \ fi) # XXX: Gross hack to allow build newer Samba while old one is installed. # This implies that LINKFLAGS_PYEMBED contains flags which are already # used in other parts of LINKFLAGS, namely -L$(LOCALBASE)/lib and -pthread post-configure: -${REINPLACE_CMD} -e 's|LINKFLAGS_PYEMBED.*|LINKFLAGS_PYEMBED = []|' \ ${CONFIGURE_WRKSRC}/bin/c4che/default.cache.py pre-build: .if ! ${PORT_OPTIONS:MMANPAGES} . for man in libcli/nbt/man/nmblookup4.1 \ librpc/tools/ndrdump.1 \ source4/lib/registry/man/regdiff.1 \ source4/lib/registry/man/regpatch.1 \ source4/lib/registry/man/regshell.1 \ source4/lib/registry/man/regtree.1 \ source4/torture/man/gentest.1 \ source4/torture/man/locktest.1 \ source4/torture/man/masktest.1 \ source4/torture/man/smbtorture.1 \ source4/utils/man/ntlm_auth4.1 \ source4/utils/man/oLschema2ldif.1 -@${MKDIR} `dirname ${BUILD_WRKSRC}/bin/default/${man}` @${INSTALL_MAN} ${FILESDIR}/man/`basename ${man}` ${BUILD_WRKSRC}/bin/default/${man} . endfor -@${MKDIR} ${BUILD_WRKSRC}/bin/default/docs-xml/manpages . for man in ${SAMBA_MAN1} ${SAMBA_MAN5} ${SAMBA_MAN7} ${SAMBA_MAN8} -@${INSTALL_MAN} ${BUILD_WRKSRC}/docs/manpages/${man} ${BUILD_WRKSRC}/bin/default/docs-xml/manpages . endfor .endif do-build: @(cd ${BUILD_WRKSRC}; \ if ! ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${BUILD_WRKSRC}/${WAF_TOOL} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET}; then \ if [ x != x${BUILD_FAIL_MESSAGE} ] ; then \ ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ (${ECHO_CMD} ${BUILD_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ fi; \ ${FALSE}; \ fi) do-install: @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${INSTALL_WRKSRC}/${WAF_TOOL} ${MAKE_ARGS} ${INSTALL_TARGET}) post-install: @${LN} -sf smb.conf.5.gz ${STAGEDIR}${PREFIX}/man/man5/smb4.conf.5.gz .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR} . for doc in ${PORTDOCS} @${INSTALL_DATA} ${WRKDIR}/${doc} ${STAGEDIR}${DOCSDIR} . endfor .endif # Run post-install script .for dir in ${SAMBA4_LOGDIR} ${SAMBA4_RUNDIR} ${SAMBA4_LOCKDIR} ${SAMBA4_MODULEDIR} ${SAMBA4_PRIVATEDIR} @${MKDIR} "${STAGEDIR}${dir}" .endfor .for dir in auth bind9 gensec gpext idmap ldb nss_info pdb perfcount process_model service vfs @${MKDIR} "${STAGEDIR}${SAMBA4_MODULEDIR}/${dir}" .endfor .if ${PORT_OPTIONS:MDEVELOPER} test: build @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${INSTALL_WRKSRC}/${WAF_TOOL} ${MAKE_ARGS} $@) .endif # !SAMBA4_SUBPORT .endif .include Index: head/net/samba41/distinfo =================================================================== --- head/net/samba41/distinfo (revision 379837) +++ head/net/samba41/distinfo (revision 379838) @@ -1,2 +1,2 @@ -SHA256 (samba-4.1.16.tar.gz) = 12a09c167bfa25f50b82775bcbeda94c71c5d71d3b0d1210f6dae0f23020a87b -SIZE (samba-4.1.16.tar.gz) = 19534236 +SHA256 (samba-4.1.17.tar.gz) = 7aeb5d09e9c84bbeeb4b98d33404e9dbc4d99c54e64a447cc9c4d57e9255cb1d +SIZE (samba-4.1.17.tar.gz) = 19536407 Index: head/net/samba41/files/samba_server.in =================================================================== --- head/net/samba41/files/samba_server.in (revision 379837) +++ head/net/samba41/files/samba_server.in (revision 379838) @@ -1,199 +1,196 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: samba_server # REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv ntpd # BEFORE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # #samba_server_enable="YES" # # You can disable/enable any of the Samba daemons by specifying: #samba_enable="NO" #nmbd_enable="NO" #smbd_enable="NO" # You need to enable winbindd separately, by adding: #winbindd_enable="YES" # Configuration file can be set with: #samba_server_config="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%" # . /etc/rc.subr name="samba_server" rcvar=${name}_enable - # Defaults samba_server_config_default="%%SAMBA4_CONFDIR%%/%%SAMBA4_CONFIG%%" -samba_server_config=${samba_server_config=${samba_server_config_default}} -samba_server_configfile_arg=${samba_server_config:+--configfile="${samba_server_config}"} #" -#testparm_command="%%PREFIX%%/bin/samba-tool testparm --suppress-prompt --verbose ${samba_server_configfile_arg}" -testparm_command="%%PREFIX%%/bin/testparm --suppress-prompt --verbose ${samba_server_config}" smbcontrol_command="%%PREFIX%%/bin/smbcontrol" - # Custom commands extra_commands="reload status" start_precmd="samba_server_prestart" restart_precmd="samba_server_checkconfig" reload_precmd="samba_server_checkconfig" start_cmd="samba_server_cmd" stop_cmd="samba_server_cmd" status_cmd="samba_server_cmd" reload_cmd="samba_server_reload_cmd" rcvar_cmd="samba_server_rcvar_cmd" - samba_server_checkconfig() { echo -n "Performing sanity check on Samba configuration: " if ${testparm_command} >/dev/null 2>&1; then echo "OK" else echo "FAILED" return 1 fi } samba_server_prestart() { # Make sure we have our RUNDIR, even if it's on a tmpfs if [ ! -d "${samba_server_piddir}" -a ! -e "${samba_server_piddir}" ]; then install -m 0755 -d "${samba_server_piddir}" fi # # Remove smbd.pid before starting up samba(needed for s3fs) # if [ -e "${samba_server_piddir}/smbd.pid" ] ; then # rm -f "${samba_server_piddir}/smbd.pid" # fi samba_server_checkconfig } samba_server_rcvar_cmd() { local name rcvar rcvar=${name}_enable # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Check master variable run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} # Check dependent variables for name in ${samba_daemons}; do # XXX rcvars=''; v='' rcvar=${name}_enable run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} done } samba_server_reload_cmd() { local name rcvar command pidfile force_run # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Ignore rcvar and run command if [ -n "${_rc_prefix}" -a "${_rc_prefix}" = "one" ] || [ -n "${rc_force}" ] || [ -n "${rc_fast}" ]; then force_run=yes fi # Apply to all daemons for name in ${samba_daemons}; do rcvar=${name}_enable command="%%PREFIX%%/sbin/${name}" pidfile="${samba_server_piddir}/${name}.pid" # Daemon should be enabled and running if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]; then if [ -n "$(check_pidfile "${pidfile}" "${command}")" ]; then debug "reloading ${name} configuration" echo "Reloading ${name}." ${smbcontrol_command} "${name}" 'reload-config' ${command_args} >/dev/null 2>&1 fi fi done } samba_server_cmd() { local name rcvar rcvars v command pidfile samba_daemons result force_run # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Stop processes in the reverse order if [ "${rc_arg}" = "stop" ] ; then samba_daemons=$(reverse_list ${samba_daemons}) fi # Ignore rcvar and run command if [ -n "${_rc_prefix}" -a "${_rc_prefix}" = "one" ] || [ -n "${rc_force}" ] || [ -n "${rc_fast}" ]; then force_run=yes fi # Assume success result=0 # Apply to all daemons for name in ${samba_daemons}; do # XXX rcvars=''; v='' rcvar=${name}_enable command="%%PREFIX%%/sbin/${name}" pidfile="${samba_server_piddir}/${name}.pid" # Daemon should be enabled and running if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]; then run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} # If any of the commands failed, take it as a global result result=$((${result} || $?)) fi done return ${result} } samba_server_config_init() { local name + # Load configuration + load_rc_config "${name}" + # Defaults + samba_server_enable=${samba_server_enable:=NO} + samba_server_config=${samba_server_config=${samba_server_config_default}} + samba_server_configfile_arg=${samba_server_config:+--configfile="${samba_server_config}"} #" + #testparm_command="%%PREFIX%%/bin/samba-tool testparm --suppress-prompt --verbose ${samba_server_configfile_arg}" + testparm_command="%%PREFIX%%/bin/testparm --suppress-prompt --verbose ${samba_server_config}" # Determine what daemons are necessary to run Samba in the current role samba_server_role=$(${testparm_command} --parameter-name='server role' 2>/dev/null) case "${samba_server_role}" in active\ directory\ domain\ controller) samba_daemons="samba" ;; auto|*) samba_daemons="nmbd smbd winbindd" ;; esac - # Load configuration - load_rc_config "${name}" + # Load daemons configuration for name in ${samba_daemons}; do load_rc_config "${name}" - done - # Defaults - samba_server_enable=${samba_server_enable:=NO} - # Setup dependent variables - if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then - for name in ${samba_daemons}; do - # Winbindd - if [ "${name}" = "winbindd" ]; then + # If samba_server_enable is 'YES' + if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then + if [ "${name}" != "winbindd" ]; then + # Set variable to 'YES' only if it is unset + eval ${name}_enable=\${${name}_enable-YES} + else + # Winbindd samba_server_idmap=$(${testparm_command} --parameter-name='idmap uid' 2>/dev/null) if [ -n "${samba_server_idmap}" ]; then winbindd_enable="YES" fi fi - # Set variable to 'YES' only if it is unset - eval ${name}_enable=\${${name}_enable-YES} - # If variable is empty set it to 'NO' - eval ${name}_enable=\${${name}_enable:-NO} - done - fi + fi + # If variable is empty, set it to 'NO' + eval ${name}_enable=\${${name}_enable:-NO} + done + # Fetch parameters from configuration file + samba_server_lockdir="$(${testparm_command} --parameter-name='lock directory' 2>/dev/null)" + samba_server_lockdir=${samba_server_lockdir:=%%SAMBA4_LOCKDIR%%} + samba_server_piddir="$(${testparm_command} --parameter-name='pid directory' 2>/dev/null)" + samba_server_piddir=${samba_server_piddir:=%%SAMBA4_RUNDIR%%} } # Load configuration variables samba_server_config_init -# Fetch parameters from configuration file -samba_server_lockdir=$(${testparm_command} --parameter-name='lock directory' 2>/dev/null) -samba_server_lockdir=${samba_server_lockdir=%%SAMBA4_LOCKDIR%%} -samba_server_piddir=$(${testparm_command} --parameter-name='pid directory' 2>/dev/null) -samba_server_piddir=${samba_server_piddir=%%SAMBA4_RUNDIR%%} # Common flags command_args=${samba_server_configfile_arg} samba_flags=${samba_flags="--daemon"} nmbd_flags=${nmbd_flags="--daemon"} smbd_flags=${smbd_flags="--daemon"} winbindd_flags=${winbindd_flags="--daemon"} # Requirements required_files="${samba_server_config}" required_dirs="${samba_server_lockdir}" run_rc_command "$1"