diff options
author | Marcus Alves Grando <mnag@FreeBSD.org> | 2006-12-07 13:55:52 +0000 |
---|---|---|
committer | Marcus Alves Grando <mnag@FreeBSD.org> | 2006-12-07 13:55:52 +0000 |
commit | 38e287f7700eed67986087d37598fa57e751ffa1 (patch) | |
tree | cb77c6cf3bf51a852b1c63201f7d0c5e894e1887 /net/samba3 | |
parent | 3d633d08574c5323b7d81b3f6eb596f0931e2ecf (diff) | |
download | ports-38e287f7700eed67986087d37598fa57e751ffa1.tar.gz ports-38e287f7700eed67986087d37598fa57e751ffa1.zip |
Notes
Diffstat (limited to 'net/samba3')
-rw-r--r-- | net/samba3/Makefile | 79 | ||||
-rw-r--r-- | net/samba3/distinfo | 6 | ||||
-rw-r--r-- | net/samba3/files/patch-configure.in | 138 | ||||
-rw-r--r-- | net/samba3/files/patch-za | 129 | ||||
-rw-r--r-- | net/samba3/files/pkg-deinstall.in | 32 | ||||
-rw-r--r-- | net/samba3/files/pkg-install.in | 28 | ||||
-rw-r--r-- | net/samba3/pkg-plist | 3 |
7 files changed, 151 insertions, 264 deletions
diff --git a/net/samba3/Makefile b/net/samba3/Makefile index 797437d5e9a0..e81bc2d0d6a0 100644 --- a/net/samba3/Makefile +++ b/net/samba3/Makefile @@ -6,8 +6,8 @@ # PORTNAME= samba -PORTVERSION?= 3.0.23c -PORTREVISION?= 2 +PORTVERSION?= 3.0.23d +PORTREVISION?= 0 PORTEPOCH?= 1 CATEGORIES?= net MASTER_SITES= ${MASTER_SITE_SAMBA} @@ -64,25 +64,25 @@ OPTIONS= LDAP "With LDAP support" on \ CUPS "With CUPS printing support" on \ WINBIND "With WinBIND support" on \ ACL_SUPPORT "With ACL support" off \ - AIO_SUPPORT "With experimental AIO support" off \ FAM_SUPPORT "With File Alteration Monitor" off \ SYSLOG "With Syslog support" off \ QUOTAS "With Disk quota support" off \ UTMP "With UTMP accounting support" on \ MSDFS "With MSDFS support" off \ - SMBSH "With SMBSH wrapper for UNIX commands" off \ PAM_SMBPASS "With PAM authentication vs passdb backends" off \ + CLUSTER "With experimental cluster support" off \ EXP_MODULES "With experimental modules" off \ - POPT "With system-wide POPT library" on + POPT "With system-wide POPT library" on \ + MAX_DEBUG "With maximum debuging" off .endif .include <bsd.port.pre.mk> .if defined(SAMBA_SUBPORT) # Switch off all extra functionality -CONFIGURE_ARGS+= --disable-cups --without-winbind --without-syslog \ - --without-quotas --without-utmp --without-pam \ - --without-pam_smbpass --without-aio-support +CONFIGURE_ARGS+= --disable-cups --disable-fam --without-winbind \ + --without-syslog --without-quotas --without-utmp \ + --without-pam --without-pam_smbpass --without-aio-support # Dirty hack to work around usage of OPTIONS in slave ports . if exists(${.CURDIR}/Makefile.inc) @@ -113,6 +113,16 @@ CONFIGURE_ARGS+= --disable-cups SUB_LIST+= CUPSD="@comment " .endif +.if defined(WITH_MAX_DEBUG) +LIB_DEPENDS+= dmalloc.1:${PORTSDIR}/devel/dmalloc +CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +CONFIGURE_ARGS+= --enable-debug --enable-developer --enable-krb5developer --enable-dmalloc --with-profiling-data +.else +CONFIGURE_ARGS+= --disable-debug --disable-developer --disable-krb5developer --disable-dmalloc --without-profiling-data +.endif + .if defined(WITH_SYSLOG) CONFIGURE_ARGS+= --with-syslog .else @@ -153,25 +163,20 @@ PLIST_SUB+= WINBIND="@comment " SUB_LIST+= WINBIND="@comment " .endif -# Taken from bsd.port.mk -.if exists(${LOCALBASE}/libexec/gam_server) -WANT_FAM_SYSTEM= gamin -WITH_FAM_SUPPORT= on -. undef WITHOUT_FAM_SUPPORT -.elif exists(${LOCALBASE}/bin/fam) -WANT_FAM_SYSTEM= fam -WITH_FAM_SUPPORT= on -. undef WITHOUT_FAM_SUPPORT -.endif - -.if defined(WITH_FAM_SUPPORT) || defined(WANT_FAM_SYSTEM) +.if defined(WITH_FAM_SUPPORT) USE_FAM= yes +CONFIGURE_ARGS+= --enable-fam +.else +CONFIGURE_ARGS+= --disable-fam .endif .if defined(WITH_EXP_MODULES) -.if !defined(WANT_EXP_MODULES) || empty(WANT_EXP_MODULES) -WANT_EXP_MODULES= rpc_echo idmap_ad idmap_rid charset_weird -.endif +. if !defined(WANT_EXP_MODULES) || empty(WANT_EXP_MODULES) +WANT_EXP_MODULES= idmap_ad idmap_rid charset_weird +. if !defined(WITH_MAX_DEBUG) +WANT_EXP_MODULES+= rpc_echo +. endif +. endif WANT_EXP_MODULES!= ${ECHO_CMD} ${WANT_EXP_MODULES} | ${SED} -E 's/ +/,/g' CONFIGURE_ARGS+= --with-shared-modules=${WANT_EXP_MODULES} .endif @@ -186,7 +191,7 @@ PLIST_SUB+= SMBPASS="@comment " .if defined(WITH_ACL_SUPPORT) .if ${OSVERSION} < 500018 -BROKEN= ACL support requires FreeBSD 5.x at least after 20010326 +BROKEN= ACL support requires FreeBSD 5.x at least after 20010326. Disable ACL support .endif CONFIGURE_ARGS+= --with-acl-support .else @@ -194,7 +199,7 @@ CONFIGURE_ARGS+= --without-acl-support .endif .if defined(WITH_SMBSH) -IGNORE= broken IPC and code +IGNORE= broken IPC and code. Disable SMBSH support CONFIGURE_ARGS+= --with-smbwrapper PLIST_SUB+= SMBSH="" .else @@ -202,8 +207,14 @@ CONFIGURE_ARGS+= --without-smbwrapper PLIST_SUB+= SMBSH="@comment " .endif +.if defined(WITH_CLUSTER) +CONFIGURE_ARGS+= --with-cluster-support +.else +CONFIGURE_ARGS+= --without-cluster-support +.endif + .if defined(WITH_AIO_SUPPORT) -IGNORE= broken kernel API until now (7-CURRENT) +IGNORE= broken kernel API until now (7-CURRENT). Disable AIO support CONFIGURE_ARGS+= --with-aio-support .else CONFIGURE_ARGS+= --without-aio-support @@ -240,11 +251,11 @@ CONFIGURE_ARGS+= --without-ads .endif # Kerberos5 is necessary for ADS .if defined(SAMBA_WANT_KRB5) -.if defined(KRB5_HOME) && exists(${KRB5_HOME}/lib/libgssapi_krb5.a) +.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.a) +.elif defined(HEIMDAL_HOME) && exists(${HEIMDAL_HOME}/lib/libgssapi.so) CONFIGURE_ARGS+= --with-krb5=${HEIMDAL_HOME} -.elif exists(${DESTDIR}/usr/lib/libkrb5.a) && exists(${DESTDIR}/usr/bin/krb5-config) +.elif exists(${DESTDIR}/usr/lib/libkrb5.so) && exists(${DESTDIR}/usr/bin/krb5-config) CONFIGURE_ARGS+= --with-krb5=${DESTDIR}/usr .else LIB_DEPENDS+= krb5:${PORTSDIR}/security/heimdal @@ -299,10 +310,6 @@ SUB_LIST+= SAMBA_LOGDIR=${SAMBA_LOGDIR} \ SAMBA_PRIVATE=${SAMBA_PRIVATE} pre-everything:: -.if defined(WANT_FAM_SYSTEM) - @${ECHO_CMD} "===> NOTICE: ${WANT_FAM_SYSTEM} detected, forcing FAM_SUPPORT" - @${ECHO_CMD} "" -.endif @${ECHO_CMD} "===> NOTICE: This version of port has changed location of Samba password" @${ECHO_CMD} "===> NOTICE: (smbpasswd) directory. Files in '${SAMBA_PRIVATE}'" @${ECHO_CMD} "===> NOTICE: have moved to '${SAMBA_PRIVATEDIR}'." @@ -340,16 +347,14 @@ post-install: @${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/docs/manpages/${man} ${MAN${sect}PREFIX}/man/man${sect} . endfor .endfor +# Put examples in place @${MKDIR} ${EXAMPLESDIR} @${CP} -Rp ${WRKDIR}/${DISTNAME}/examples/* ${EXAMPLESDIR} .if defined(WITH_PAM_SMBPASS) @${MKDIR} ${EXAMPLESDIR}/pam_smbpass @${CP} -Rp ${WRKSRC}/pam_smbpass/samples/* ${EXAMPLESDIR}/pam_smbpass .endif - ${INSTALL_DATA} ${WRKDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR} - @if [ ! -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG} ]; then \ - ${INSTALL_DATA} ${WRKDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR}/${SAMBA_CONFIG} ; \ - fi + ${CP} -p ${WRKDIR}/${SAMBA_CONFIG}.sample ${EXAMPLESDIR} ${INSTALL_SCRIPT} ${WRKSRC}/script/mksmbpasswd.sh ${PREFIX}/bin/make_smbpasswd # Winbind .if !defined(WITHOUT_WINBIND) diff --git a/net/samba3/distinfo b/net/samba3/distinfo index 9285bf009e6d..c39e0e36ed85 100644 --- a/net/samba3/distinfo +++ b/net/samba3/distinfo @@ -1,3 +1,3 @@ -MD5 (samba-3.0.23c.tar.gz) = 9e06d5e10f4ae84f7fafad75d1b4184c -SHA256 (samba-3.0.23c.tar.gz) = f333051eadf6ae88c30bd3d62eb94e9d6cf4a21912c4923d6ffddb029a42631c -SIZE (samba-3.0.23c.tar.gz) = 17690045 +MD5 (samba-3.0.23d.tar.gz) = afe6923d05fed5b5ccab593c7a407cd1 +SHA256 (samba-3.0.23d.tar.gz) = 0af21d6cfeb8186987cc5b59e41034f663124859ce30b5b98f3abed501f2cd46 +SIZE (samba-3.0.23d.tar.gz) = 17704221 diff --git a/net/samba3/files/patch-configure.in b/net/samba3/files/patch-configure.in index 4b31e61be751..39dbdc586c23 100644 --- a/net/samba3/files/patch-configure.in +++ b/net/samba3/files/patch-configure.in @@ -1,14 +1,6 @@ ---- configure.in.orig Fri Jul 21 18:22:57 2006 -+++ configure.in Thu Aug 24 01:30:57 2006 -@@ -242,7 +242,6 @@ - AC_SUBST(SHELL) - AC_SUBST(LDSHFLAGS) - AC_SUBST(SONAMEFLAG) --AC_SUBST(NSSSONAMEVERSIONSUFFIX) - AC_SUBST(SHLD) - AC_SUBST(HOST_OS) - AC_SUBST(PICFLAGS) -@@ -1089,6 +1088,21 @@ +--- configure.in.orig Tue Nov 14 15:42:15 2006 ++++ configure.in Sat Nov 18 03:19:57 2006 +@@ -1088,6 +1088,21 @@ AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type]) fi @@ -30,69 +22,67 @@ AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [ AC_TRY_COMPILE([ #include <sys/types.h> -@@ -1639,7 +1653,6 @@ - HOST_OS="$host_os" - LDSHFLAGS="-shared" - SONAMEFLAG="#" --NSSSONAMEVERSIONSUFFIX="" - SHLD="\${CC} \${CFLAGS}" - PICFLAGS="" - PICSUFFIX="po" -@@ -1664,7 +1677,6 @@ - DYNEXP="-Wl,--export-dynamic" - PICFLAGS="-fPIC" - SONAMEFLAG="-Wl,-soname=" -- NSSSONAMEVERSIONSUFFIX=".2" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) - ;; - *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris]) -@@ -1674,7 +1686,6 @@ - if test "${GCC}" = "yes"; then - PICFLAGS="-fPIC" - SONAMEFLAG="-Wl,-soname=" -- NSSSONAMEVERSIONSUFFIX=".1" - if test "${ac_cv_prog_gnu_ld}" = "yes"; then - DYNEXP="-Wl,-E" - fi -@@ -4882,6 +4893,7 @@ - AC_MSG_RESULT(yes) - case "$host_os" in - *) -+ AIO_LIBS=$LIBS - AC_CHECK_LIB(rt,aio_read,[AIO_LIBS="$LIBS -lrt"]) - AC_CHECK_LIB(aio,aio_read,[AIO_LIBS="$LIBS -laio"]) - AC_CACHE_CHECK([for asynchronous io support],samba_cv_HAVE_AIO,[ -@@ -5282,14 +5294,17 @@ - WINBIND_NSS="nsswitch/libnss_winbind.$SHLIBEXT" - WINBIND_WINS_NSS="nsswitch/libnss_wins.$SHLIBEXT" - WINBIND_NSS_LDSHFLAGS=$LDSHFLAGS -+NSSSONAMEVERSIONSUFFIX="" +@@ -2463,32 +2478,40 @@ + # Check if FAM notifications are available. For FAM info, see + # http://oss.sgi.com/projects/fam/ + # http://savannah.nongnu.org/projects/fam/ ++AC_ARG_ENABLE(fam, ++[ --enable-fam Turn on FAM support (default=auto)]) - case "$host_os" in - *linux*) -+ NSSSONAMEVERSIONSUFFIX=".2" - WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_linux.o" - ;; - *freebsd[[5-9]]*) - # FreeBSD winbind client is implemented as a wrapper around - # the Linux version. -+ NSSSONAMEVERSIONSUFFIX=".1" - WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \ - nsswitch/winbind_nss_linux.o" - WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT" -@@ -5304,6 +5319,7 @@ - *solaris*) - # Solaris winbind client is implemented as a wrapper around - # the Linux version. -+ NSSSONAMEVERSIONSUFFIX=".1" - WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o \ - nsswitch/winbind_nss_linux.o" - WINBIND_NSS_EXTRA_LIBS="-lsocket" -@@ -5330,6 +5346,7 @@ - AC_SUBST(WINBIND_NSS_LDSHFLAGS) - AC_SUBST(WINBIND_NSS_EXTRA_OBJS) - AC_SUBST(WINBIND_NSS_EXTRA_LIBS) -+AC_SUBST(NSSSONAMEVERSIONSUFFIX) +-AC_CHECK_HEADERS(fam.h, [samba_cv_HAVE_FAM_H=yes], [samba_cv_HAVE_FAM_H=no]) +-if test x"$samba_cv_HAVE_FAM_H" = x"yes"; then +- # On IRIX, libfam requires libC, but other FAM implementations might not +- # need it. +- AC_CHECK_LIB(fam, FAMOpen2, +- [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam"], +- [samba_cv_HAVE_LIBFAM=no]) +- +- if test x"$samba_cv_HAVE_LIBFAM" = x"no" ; then +- samba_fam_xtra=-lC +- AC_CHECK_LIB_EXT(fam, samba_fam_xtra, FAMOpen2, +- [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam -lC"], +- [samba_cv_HAVE_LIBFAM=no]) +- unset samba_fam_xtra ++if test x$enable_fam != xno; then ++ AC_CHECK_HEADERS(fam.h, [samba_cv_HAVE_FAM_H=yes], [samba_cv_HAVE_FAM_H=no]) ++ if test x"$samba_cv_HAVE_FAM_H" = x"yes"; then ++ # On IRIX, libfam requires libC, but other FAM implementations ++ # might not need it. ++ AC_CHECK_LIB(fam, FAMOpen2, ++ [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam"], ++ [samba_cv_HAVE_LIBFAM=no]) ++ ++ if test x"$samba_cv_HAVE_LIBFAM" = x"no" ; then ++ samba_fam_xtra=-lC ++ AC_CHECK_LIB_EXT(fam, samba_fam_xtra, FAMOpen2, ++ [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam -lC"], ++ [samba_cv_HAVE_LIBFAM=no]) ++ unset samba_fam_xtra ++ fi + fi +-fi - # Check the setting of --with-winbind +-if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then +- AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1, +- [Whether FAM is file notifications are available]) +- AC_TRY_COMPILE([#include <fam.h>], +- [FAMCodes code = FAMChanged;], +- AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1, +- [Whether fam.h contains a typedef for enum FAMCodes]), +- []) ++ if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then ++ AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1, ++ [Whether FAM file notifications are available]) ++ AC_TRY_COMPILE([#include <fam.h>], ++ [FAMCodes code = FAMChanged;], ++ AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1, ++ [Whether fam.h contains a typedef for enum FAMCodes]), ++ []) ++ fi ++ ++ if test x$enable_fam = xyes && test x"$samba_cv_HAVE_LIBFAM" != xyes ; then ++ AC_MSG_ERROR(FAM support requested but FAM library not available ) ++ fi + fi + ################################################# diff --git a/net/samba3/files/patch-za b/net/samba3/files/patch-za deleted file mode 100644 index d92a775832ff..000000000000 --- a/net/samba3/files/patch-za +++ /dev/null @@ -1,129 +0,0 @@ ---- nsswitch/wb_common.c.orig Thu Apr 20 04:29:21 2006 -+++ nsswitch/wb_common.c Mon Sep 25 12:49:04 2006 -@@ -525,15 +525,11 @@ - NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request) - { - struct winbindd_request lrequest; -- char *env; -- int value; -- -+ - /* Check for our tricky environment variable */ - -- if ( (env = getenv(WINBINDD_DONT_ENV)) != NULL ) { -- value = atoi(env); -- if ( value == 1 ) -- return NSS_STATUS_NOTFOUND; -+ if (winbind_env_set()) { -+ return NSS_STATUS_NOTFOUND; - } - - if (!request) { -@@ -632,3 +628,14 @@ - return putenv(s) != -1; - } - -+BOOL winbind_env_set( void ) -+{ -+ char *env; -+ -+ if ((env=getenv(WINBINDD_DONT_ENV)) != NULL) { -+ if(strcmp(env, "1")) { -+ return True; -+ } -+ } -+ return False; -+} ---- passdb/pdb_interface.c.orig Wed Aug 23 18:16:38 2006 -+++ passdb/pdb_interface.c Mon Sep 25 13:10:15 2006 -@@ -1321,27 +1321,25 @@ - struct group *grp; - char **gr; - struct passwd *pwd; -- char *winbindd_env; -+ BOOL winbind_env; - - *pp_uids = NULL; - *p_num = 0; - - /* We only look at our own sam, so don't care about imported stuff */ -- -- winbindd_env = getenv(WINBINDD_DONT_ENV); -+ winbind_env = winbind_env_set(); - winbind_off(); - - if ((grp = getgrgid(gid)) == NULL) { - /* allow winbindd lookups, but only if they weren't already disabled */ -- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) { -+ if (!winbind_env) { - winbind_on(); - } -- -+ - return False; - } - - /* Primary group members */ -- - setpwent(); - while ((pwd = getpwent()) != NULL) { - if (pwd->pw_gid == gid) { -@@ -1352,7 +1350,6 @@ - endpwent(); - - /* Secondary group members */ -- - for (gr = grp->gr_mem; (*gr != NULL) && ((*gr)[0] != '\0'); gr += 1) { - struct passwd *pw = getpwnam(*gr); - -@@ -1362,11 +1359,10 @@ - } - - /* allow winbindd lookups, but only if they weren't already disabled */ -- -- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) { -+ if (!winbind_env) { - winbind_on(); - } -- -+ - return True; - } - ---- lib/system_smbd.c.orig Thu Apr 20 04:29:23 2006 -+++ lib/system_smbd.c Mon Sep 25 12:53:54 2006 -@@ -120,19 +120,15 @@ - static int sys_getgrouplist(const char *user, gid_t gid, gid_t *groups, int *grpcnt) - { - int retval; -- char *winbindd_env; -+ BOOL winbind_env; - - DEBUG(10,("sys_getgrouplist: user [%s]\n", user)); - -- /* Save the winbindd state and not just blindly turn it back on */ -- -- winbindd_env = getenv(WINBINDD_DONT_ENV); -- - /* This is only ever called for Unix users, remote memberships are - * always determined by the info3 coming back from auth3 or the - * PAC. */ -- -- winbind_off() ; -+ winbind_env = winbind_env_set(); -+ winbind_off(); - - #ifdef HAVE_GETGROUPLIST - retval = getgrouplist(user, gid, groups, grpcnt); -@@ -142,9 +138,8 @@ - unbecome_root(); - #endif - -- /* allow winbindd lookups , but only if they were not already disabled */ -- -- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) { -+ /* allow winbindd lookups, but only if they were not already disabled */ -+ if (!winbind_env) { - winbind_on(); - } - diff --git a/net/samba3/files/pkg-deinstall.in b/net/samba3/files/pkg-deinstall.in index e6f906d7522e..77c059ecc08b 100644 --- a/net/samba3/files/pkg-deinstall.in +++ b/net/samba3/files/pkg-deinstall.in @@ -2,29 +2,39 @@ PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin +SAMBA_CONFIG="%%SAMBA_CONFIG%%" +SAMBA_CONFDIR="%%SAMBA_CONFDIR%%" SAMBA_SPOOL="%%SAMBA_SPOOL%%" SAMBA_LOGDIR="%%SAMBA_LOGDIR%%" SAMBA_LOCKDIR="%%SAMBA_LOCKDIR%%" SAMBA_PRIVATEDIR="%%SAMBA_PRIVATEDIR%%" SAMBA_OWNER=root SAMBA_GROUP=wheel +CMP="cmp" +RM="rm" +RMDIR="rmdir" +ECHO_CMD="echo" post-deinstall() { - rm -rf ${SAMBA_SPOOL} - rmdir ${SAMBA_LOGDIR} 2>/dev/null || true + if ${CMP} -s ${SAMBA_CONFDIR}/${SAMBA_CONFIG} ${SAMBA_CONFDIR}/${SAMBA_CONFIG}.sample; then + ${RM} -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG} + fi + ${RM} -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG}.sample + ${RM} -rf ${SAMBA_SPOOL} + ${RMDIR} ${SAMBA_LOGDIR} 2>/dev/null || true for f in connections.tdb locking.tdb messages.tdb sessionid.tdb \ unexpected.tdb brlock.tdb namelist.debug do - rm -f "${SAMBA_LOCKDIR}/${f}" + ${RM} -f "${SAMBA_LOCKDIR}/${f}" done - rmdir ${SAMBA_LOCKDIR} 2>/dev/null || true - rmdir ${SAMBA_PRIVATEDIR} 2>/dev/null || true - echo "WARNING: If you will *NOT* use this package anymore, please remove the" - echo " following directories manually:" - echo " ${SAMBA_PRIVATEDIR}" - echo " ${SAMBA_LOGDIR}" - echo " ${SAMBA_LOCKDIR}" - echo + ${RMDIR} ${SAMBA_LOCKDIR} 2>/dev/null || true + ${RMDIR} ${SAMBA_PRIVATEDIR} 2>/dev/null || true + ${ECHO_CMD} "WARNING: If you will *NOT* use this package anymore, please remove the" + ${ECHO_CMD} " following directories manually:" + ${ECHO_CMD} " ${SAMBA_PRIVATEDIR}" + ${ECHO_CMD} " ${SAMBA_LOGDIR}" + ${ECHO_CMD} " ${SAMBA_LOCKDIR}" + ${ECHO_CMD} } case $2 in diff --git a/net/samba3/files/pkg-install.in b/net/samba3/files/pkg-install.in index e9d303368189..bab2395ad178 100644 --- a/net/samba3/files/pkg-install.in +++ b/net/samba3/files/pkg-install.in @@ -2,23 +2,35 @@ PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin +EXAMPLESDIR="%%EXAMPLESDIR%%" +SAMBA_CONFIG="%%SAMBA_CONFIG%%" +SAMBA_CONFDIR="%%SAMBA_CONFDIR%%" SAMBA_SPOOL="%%SAMBA_SPOOL%%" SAMBA_LOGDIR="%%SAMBA_LOGDIR%%" SAMBA_LOCKDIR="%%SAMBA_LOCKDIR%%" SAMBA_PRIVATEDIR="%%SAMBA_PRIVATEDIR%%" SAMBA_OWNER=root SAMBA_GROUP=wheel +INSTALL_DATA="install -c -m 0444" +MKDIR="mkdir -p" +CHMOD="chmod" +CHOWN="chown" post-install() { - mkdir -p ${SAMBA_SPOOL} && chmod 1777 ${SAMBA_SPOOL} - mkdir -p ${SAMBA_LOGDIR} && chmod 0755 ${SAMBA_LOGDIR} - mkdir -p ${SAMBA_LOCKDIR} && chmod 0755 ${SAMBA_LOCKDIR} - mkdir -p ${SAMBA_PRIVATEDIR} && chmod 0700 ${SAMBA_PRIVATEDIR} + ${MKDIR} ${SAMBA_SPOOL} && ${CHMOD} 1777 ${SAMBA_SPOOL} + ${MKDIR} ${SAMBA_LOGDIR} && ${CHMOD} 0755 ${SAMBA_LOGDIR} + ${MKDIR} ${SAMBA_LOCKDIR} && ${CHMOD} 0755 ${SAMBA_LOCKDIR} + ${MKDIR} ${SAMBA_PRIVATEDIR} && ${CHMOD} 0700 ${SAMBA_PRIVATEDIR} if [ $(id -u) -eq 0 ]; then - chown ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_SPOOL} - chown ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOGDIR} - chown ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOCKDIR} - chown ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_PRIVATEDIR} + INSTALL_DATA="${INSTALL_DATA} -o ${SAMBA_OWNER} -g ${SAMBA_GROUP}" + ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_SPOOL} + ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOGDIR} + ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_LOCKDIR} + ${CHOWN} ${SAMBA_OWNER}:${SAMBA_GROUP} ${SAMBA_PRIVATEDIR} + fi + ${INSTALL_DATA} ${EXAMPLESDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR} + if [ ! -f ${SAMBA_CONFDIR}/${SAMBA_CONFIG} ]; then + ${INSTALL_DATA} ${EXAMPLESDIR}/${SAMBA_CONFIG}.sample ${SAMBA_CONFDIR}/${SAMBA_CONFIG} fi } diff --git a/net/samba3/pkg-plist b/net/samba3/pkg-plist index a2418a319ede..5e57452aee34 100644 --- a/net/samba3/pkg-plist +++ b/net/samba3/pkg-plist @@ -23,8 +23,6 @@ bin/tdbtool bin/testparm %%SMBSH%%bin/smbsh %%WINBIND%%bin/wbinfo -@unexec if cmp -s %%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%% %%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%.sample; then rm -f %%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%; fi -@unexec rm -f %%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%.sample sbin/smbd sbin/nmbd sbin/swat @@ -112,6 +110,7 @@ sbin/swat %%EXAMPLESDIR%%/scripts/shares/python/smbparm.py %%EXAMPLESDIR%%/scripts/wins_hook/README %%EXAMPLESDIR%%/scripts/wins_hook/dns_update +%%EXAMPLESDIR%%/%%SAMBA_CONFIG%%.sample %%EXAMPLESDIR%%/smb.conf.default %%EXAMPLESDIR%%/tridge/README %%EXAMPLESDIR%%/tridge/smb.conf |