# $Id: Portfile,v 1.7 2006/05/29 17:58:09 markd Exp $

PortSystem 1.0

name			netatalk
version			2.0.3
categories		net
platforms		darwin
maintainers		mww@opendarwin.org
description		file and printer server for Apple Macintosh clients
long_description	netatalk is a daemon which provides POSIX-compliant \
					Unix/BSD systems with the ability to share files and \
					printers with Apple Macintosh computers.

homepage		http://netatalk.sourceforge.net/
master_sites	sourceforge
checksums		md5 28092763085783805dc2f00aa2127a3e
use_bzip2		yes
patchfiles		patch-configure.in \
				patch-configure \
				patch-bin-Makefile.am \
				patch-bin-Makefile.in \
				patch-bin-cnid-cnid_index.c \
                                patch-etc-cnid_dbd-dbif.c \
				patch-afppasswd.c \
				patch-paths.h \
				patch-uams_randnum.c


depends_lib		lib:db-4:db4 \
				port:openssl \
				bin:perl:perl5.8 \
				lib:libcrack:cracklib
depends_build	path:${prefix}/include/cups/cups.h:cups-headers

post-patch	{
	reinplace "s|__PREFIX__|${prefix}|g" \
		${worksrcpath}/include/atalk/paths.h
}

configure.args	--with-bdb=${prefix} \
				--mandir=${prefix}/share/man \
				--with-logfile=${prefix}/var/log/netatalk.log \
				--with-spooldir=${prefix}/var/spool/netatalk \
				--with-cracklib=${prefix}/lib/cracklib/pw_dict.pwd \
				--enable-a2boot \
				--with-ssl-dir=${prefix}
configure.env	CFLAGS=-I${prefix}/include \
				LDFLAGS=-L${prefix}/lib

post-destroot	{
	file delete -force ${destroot}${prefix}/sbin/atalkd \
		${destroot}${prefix}/share/netatalk ${destroot}/etc
	xinstall -m 755 -d ${destroot}${prefix}/var/log/ \
		${destroot}${prefix}/var/run/netatalk \
		${destroot}${prefix}/var/spool/netatalk
	system "touch ${destroot}${prefix}/var/log/netatalk.log"
	system "touch ${destroot}${prefix}/var/run/netatalk/afpd"
	destroot.keepdirs ${destroot}${prefix}/var/spool/netatalk
}
