--- Portfile.orig	2011-09-23 17:45:56.000000000 +0200
+++ Portfile	2011-09-20 21:54:39.000000000 +0200
@@ -5,8 +5,8 @@
 
 name			samba3
 conflicts		talloc
-version			3.2.15
-revision        2
+version			3.6.0
+revision        0
 categories		net
 platforms		darwin
 maintainers		mww openmaintainer
@@ -21,18 +21,18 @@
 				ftp://us4.samba.org/pub/samba/stable/ \
 				ftp://ru.samba.org/pub/samba/stable/
 distname		samba-${version}
-checksums           md5     5a3bcc4927c9643b9f42970d0815b18f \
-                    sha1    52240aa9f2f5584f1978d788024fa2d6cb208e56 \
-                    rmd160  0046aeaf5b91c34bbc9a387c714caf41ca84d1ae
+checksums           md5     e297e0ea7923c7de8d7c1d8fd0ec0a05 \
+                    sha1    c87e2481d755f3a7f22bae44ef2f22ca64b9d173
 depends_lib		port:libiconv port:openssl port:popt port:cyrus-sasl2
 
 # Parallel bug filed upstream: https://bugzilla.samba.org/show_bug.cgi?id=6278
 use_parallel_build no
 
-worksrcdir		${worksrcdir}/source
+worksrcdir		${worksrcdir}/source3
 
-configure.cflags-append	"-fno-common"
+configure.cflags-append	"-Derror_message=strerror -fno-common"
 configure.cppflags-append "-DHAVE_STRUCT_TIMESPEC"
+configure.ldflags-append	"-lintl"
 configure.args	--with-mandir=${prefix}/share/man \
 				--with-libdir=${prefix}/lib/${name} \
 				--with-privatedir=${prefix}/var/db/smb \
@@ -67,59 +67,55 @@
 	system "touch ${destroot}${prefix}/var/db/smb/secrets.tdb.sample"
 
 	set changeline "\
-		-change bin/libnetapi.dylib.0 ${prefix}/lib/samba3/libnetapi.dylib \
-		-change bin/libsmbclient.dylib.0 ${prefix}/lib/samba3/libsmbclient.dylib \
-		-change bin/libsmbsharemodes.dylib.0 ${prefix}/lib/samba3/libsmbsharemodes.dylib \
-		-change bin/libtalloc.dylib.1 ${prefix}/lib/samba3/libtalloc.dylib \
-		-change bin/libtdb.dylib.1 ${prefix}/lib/samba3/libtdb.dylib \
-		-change bin/audit.dylib ${prefix}/lib/samba3/vfs/audit.dylib \
-		-change bin/cap.dylib ${prefix}/lib/samba3/vfs/cap.dylib \
-		-change bin/default_quota.dylib ${prefix}/lib/samba3/vfs/default_quota.dylib \
-		-change bin/expand_msdfs.dylib ${prefix}/lib/samba3/vfs/expand_msdfs.dylib \
-		-change bin/extd_audit.dylib ${prefix}/lib/samba3/vfs/extd_audit.dylib \
-		-change bin/fake_perms.dylib ${prefix}/lib/samba3/vfs/fake_perms.dylib \
-		-change bin/full_audit.dylib ${prefix}/lib/samba3/vfs/full_audit.dylib \
-		-change bin/netatalk.dylib ${prefix}/lib/samba3/vfs/netatalk.dylib \
-		-change bin/readahead.dylib ${prefix}/lib/samba3/vfs/readahead.dylib \
-		-change bin/readonly.dylib ${prefix}/lib/samba3/vfs/readonly.dylib \
-		-change bin/recycle.dylib ${prefix}/lib/samba3/vfs/recycle.dylib \
-		-change bin/shadow_copy.dylib ${prefix}/lib/samba3/vfs/shadow_copy.dylib \
-		-change bin/shadow_copy2.dylib ${prefix}/lib/samba3/vfs/shadow_copy2.dylib \
-		-change bin/streams_xattr.dylib ${prefix}/lib/samba3/vfs/streams_xattr.dylib \
-		-change bin/xattr_tdb.dylib ${prefix}/lib/samba3/vfs/xattr_tdb.dylib"
-
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libnetapi.dylib ${destroot}${prefix}/lib/samba3/libnetapi.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libsmbclient.dylib ${destroot}${prefix}/lib/samba3/libsmbclient.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libsmbsharemodes.dylib ${destroot}${prefix}/lib/samba3/libsmbsharemodes.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libtalloc.dylib ${destroot}${prefix}/lib/samba3/libtalloc.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libtdb.dylib ${destroot}${prefix}/lib/samba3/libtdb.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/audit.dylib ${destroot}${prefix}/lib/samba3/vfs/audit.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/cap.dylib ${destroot}${prefix}/lib/samba3/vfs/cap.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/default_quota.dylib ${destroot}${prefix}/lib/samba3/vfs/default_quota.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/expand_msdfs.dylib ${destroot}${prefix}/lib/samba3/vfs/expand_msdfs.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/extd_audit.dylib ${destroot}${prefix}/lib/samba3/vfs/extd_audit.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/fake_perms.dylib ${destroot}${prefix}/lib/samba3/vfs/fake_perms.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/full_audit.dylib ${destroot}${prefix}/lib/samba3/vfs/full_audit.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/netatalk.dylib ${destroot}${prefix}/lib/samba3/vfs/netatalk.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/readahead.dylib ${destroot}${prefix}/lib/samba3/vfs/readahead.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/readonly.dylib ${destroot}${prefix}/lib/samba3/vfs/readonly.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/recycle.dylib ${destroot}${prefix}/lib/samba3/vfs/recycle.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/shadow_copy.dylib ${destroot}${prefix}/lib/samba3/vfs/shadow_copy.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/shadow_copy2.dylib ${destroot}${prefix}/lib/samba3/vfs/shadow_copy2.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/streams_xattr.dylib ${destroot}${prefix}/lib/samba3/vfs/streams_xattr.dylib"
-	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/xattr_tdb.dylib ${destroot}${prefix}/lib/samba3/vfs/xattr_tdb.dylib"
+		-change bin/libnetapi.dylib.0 ${prefix}/lib/libnetapi.dylib \
+		-change bin/libsmbclient.dylib.0 ${prefix}/lib/libsmbclient.dylib \
+		-change bin/libsmbsharemodes.dylib.0 ${prefix}/lib/libsmbsharemodes.dylib \
+		-change bin/libtalloc.dylib.2 ${prefix}/lib/libtalloc.dylib \
+		-change bin/libtdb.dylib.1 ${prefix}/lib/libtdb.dylib \
+		-change bin/audit.dylib ${prefix}/lib/vfs/audit.dylib \
+		-change bin/cap.dylib ${prefix}/lib/vfs/cap.dylib \
+		-change bin/default_quota.dylib ${prefix}/lib/vfs/default_quota.dylib \
+		-change bin/expand_msdfs.dylib ${prefix}/lib/vfs/expand_msdfs.dylib \
+		-change bin/extd_audit.dylib ${prefix}/lib/vfs/extd_audit.dylib \
+		-change bin/fake_perms.dylib ${prefix}/lib/vfs/fake_perms.dylib \
+		-change bin/full_audit.dylib ${prefix}/lib/vfs/full_audit.dylib \
+		-change bin/netatalk.dylib ${prefix}/lib/vfs/netatalk.dylib \
+		-change bin/readahead.dylib ${prefix}/lib/vfs/readahead.dylib \
+		-change bin/readonly.dylib ${prefix}/lib/vfs/readonly.dylib \
+		-change bin/recycle.dylib ${prefix}/lib/vfs/recycle.dylib \
+		-change bin/shadow_copy.dylib ${prefix}/lib/vfs/shadow_copy.dylib \
+		-change bin/shadow_copy2.dylib ${prefix}/lib/vfs/shadow_copy2.dylib \
+		-change bin/streams_xattr.dylib ${prefix}/lib/vfs/streams_xattr.dylib \
+		-change bin/xattr_tdb.dylib ${prefix}/lib/vfs/xattr_tdb.dylib"
+
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libnetapi.dylib ${destroot}${prefix}/lib/libnetapi.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libsmbclient.dylib ${destroot}${prefix}/lib/libsmbclient.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libsmbsharemodes.dylib ${destroot}${prefix}/lib/libsmbsharemodes.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libtalloc.dylib ${destroot}${prefix}/lib/libtalloc.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/libtdb.dylib ${destroot}${prefix}/lib/libtdb.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/audit.dylib ${destroot}${prefix}/lib/vfs/audit.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/cap.dylib ${destroot}${prefix}/lib/vfs/cap.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/default_quota.dylib ${destroot}${prefix}/lib/vfs/default_quota.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/expand_msdfs.dylib ${destroot}${prefix}/lib/vfs/expand_msdfs.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/extd_audit.dylib ${destroot}${prefix}/lib/vfs/extd_audit.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/fake_perms.dylib ${destroot}${prefix}/lib/vfs/fake_perms.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/full_audit.dylib ${destroot}${prefix}/lib/vfs/full_audit.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/netatalk.dylib ${destroot}${prefix}/lib/vfs/netatalk.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/readahead.dylib ${destroot}${prefix}/lib/vfs/readahead.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/readonly.dylib ${destroot}${prefix}/lib/vfs/readonly.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/recycle.dylib ${destroot}${prefix}/lib/vfs/recycle.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/shadow_copy.dylib ${destroot}${prefix}/lib/vfs/shadow_copy.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/shadow_copy2.dylib ${destroot}${prefix}/lib/vfs/shadow_copy2.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/streams_xattr.dylib ${destroot}${prefix}/lib/vfs/streams_xattr.dylib"
+	system "install_name_tool ${changeline} -id ${prefix}/lib/samba3/vfs/xattr_tdb.dylib ${destroot}${prefix}/lib/vfs/xattr_tdb.dylib"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/eventlogadm"
-	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/ldbadd"
-	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/ldbdel"
-	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/ldbedit"
-	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/ldbmodify"
-	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/ldbsearch"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/net"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/nmblookup"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/ntlm_auth"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/pdbedit"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/profiles"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/rpcclient"
+	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/sharesec"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbcacls"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbclient"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbcontrol"
@@ -128,9 +124,11 @@
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbpasswd"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbspool"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbstatus"
+	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbta-util"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/smbtree"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/tdbbackup"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/tdbdump"
+	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/tdbrestore"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/tdbtool"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/bin/testparm"
 	system "install_name_tool ${changeline} ${destroot}${prefix}/sbin/nmbd"
@@ -140,5 +138,5 @@
 
 livecheck.type	regex
 livecheck.url	http://us5.samba.org/samba/ftp/?M=D
-livecheck.regex	samba-(3\\.2\[0-9a-z.\]+)\\.tar\\.gz
+livecheck.regex	samba-(3\\.6\[0-9a-z.\]+)\\.tar\\.gz
 
