--- Portfile.org	2007-05-30 11:04:48.000000000 -0700
+++ Portfile	2007-05-30 22:50:47.000000000 -0700
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name			samba3
-version			3.0.20b
+version			3.0.25a
 categories		net
 platforms		darwin
 maintainers		nomaintainer@macports.org
@@ -18,7 +18,7 @@
 				ftp://us4.samba.org/pub/samba/stable/ \
 				ftp://ru.samba.org/pub/samba/stable/
 distname		samba-${version}
-checksums		md5 39c0cae08fe0224cb003aa0af97d3050
+checksums		md5 cbd33bb5d904ccd8a294a4019743745d
 depends_build	port:cups-headers
 depends_lib		port:libiconv \
 				port:openssl \
@@ -26,9 +26,7 @@
 
 worksrcdir		${worksrcdir}/source
 
-patchfiles		patch-configure patch-libsmb_clikrb5.c
-
-configure.env	CFLAGS=-I${prefix}/include \
+configure.env	CFLAGS="-I${prefix}/include -fno-common" \
 				CPPFLAGS="-I${prefix}/include -DHAVE_STRUCT_TIMESPEC" \
 				LDFLAGS=-L${prefix}/lib
 configure.args	--with-mandir=${prefix}/share/man \
@@ -42,15 +40,24 @@
 				--without-readline \
 				--enable-cups
 
+post-patch {
+	reinplace "s|-bundle|-dynamiclib|g" ${worksrcpath}/configure 
+
+### BAND-AID: libs in subdirectories of ${prefix}/lib/samba3 will
+###   still have unresolved symbols since the makefile doesn't contain
+###   any information about install location at link time...
+	reinplace "s|@\$\(SHLD\) \$\(LDSHFLAGS\)|@\$\(SHLD\) \$\(LDSHFLAGS\) -install_name @libdir@/`basename \$@`|g" \
+		${worksrcpath}/Makefile.in
+}
+
 platform darwin 8 {
-	patchfiles-append		patch-darwin8-lib-system.c
 	configure.env-append	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
 }
 
 post-destroot {
 	xinstall -m 755 -d ${destroot}${prefix}/etc/samba3/ \
 		${destroot}${prefix}/var/db/smb/
-	xinstall -m 644 ${worksrcpath}/../packaging/Fedora/smb.conf \
+	xinstall -m 644 ${worksrcpath}/../examples/smb.conf.default \
 		${destroot}${prefix}/etc/samba3/smb.conf.sample
 	system "touch ${destroot}${prefix}/etc/samba3/lmhosts.sample"
 	system "touch ${destroot}${prefix}/var/db/smb/secrets.tdb.sample"

