# $Id: Portfile,v 1.9 2005/11/22 20:38:30 mww Exp $

PortSystem 1.0

name			samba3
version			3.0.20b
categories		net
platforms		darwin
maintainers		mww@opendarwin.org
description		SMB/CIFS implementation
long_description	Samba is an software suite that provides seamless file and \
					print services to SMB/CIFS clients

homepage		http://www.samba.org/
master_sites	http://us1.samba.org/samba/ftp/stable/ \
				ftp://ftp.bit.nl/mirror/samba/stable/ \
				ftp://de.samba.org/samba.org/stable/ \
				ftp://us1.samba.org/pub/samba/stable/ \
				ftp://us2.samba.org/pub/samba/stable/ \
				ftp://us4.samba.org/pub/samba/stable/ \
				ftp://ru.samba.org/pub/samba/stable/ \
				ftp://au1.samba.org/pub/samba/stable/
distname		samba-${version}
checksums		md5 39c0cae08fe0224cb003aa0af97d3050
depends_build	port:cups-headers
depends_lib		port:libiconv \
				port:openssl \
				port:popt

worksrcdir		${worksrcdir}/source

patchfiles		patch-configure patch-libsmb_clikrb5.c

configure.env	CFLAGS=-I${prefix}/include \
				CPPFLAGS="-I${prefix}/include -DHAVE_STRUCT_TIMESPEC" \
				LDFLAGS=-L${prefix}/lib
configure.args	--with-mandir=${prefix}/share/man \
				--with-libdir=${prefix}/lib/${name} \
				--with-privatedir=${prefix}/var/db/smb \
				--with-configdir=${prefix}/etc/samba3/ \
				--with-swatdir=${prefix}/share/${name}/swat \
				--with-readline=${prefix} \
				--with-krb5=/usr \
				--without-included-popt \
				--without-readline \
				--enable-cups

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 \
		${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"
}

