# $Id: Portfile,v 1.4 2006/03/23 00:47:37 blb Exp $

PortSystem	1.0
name		gnupg2
version		1.9.20
categories	mail security
maintainers	darwinports@opendarwin.org
description	GNU pretty-good-privacy package
long_description	\
	GnuPG is a complete and free replacement for PGP. Because 	\
	it does not use the patented IDEA algorithm, it can be used 	\
	without any restrictions. GnuPG is a RFC2440 (OpenPGP) 		\
	compliant application.
homepage	http://www.gnupg.org
platforms	darwin freebsd sunos
distname        gnupg-${version}
master_sites    http://mirrors.rootmode.com/ftp.gnupg.org/alpha/gnupg/ \
                ftp://ftp.freenet.de/pub/ftp.gnupg.org/gcrypt/alpha/gnupg/ \
                ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/

use_bzip2	yes
checksums	${distfiles} md5 93899203fc0530f03e146d49b65c1e28

configure.env	CPPFLAGS="-I${prefix}/include" LDFLAGS="-L${prefix}/lib"
configure.args	--mandir=${prefix}/share/man 		\
		--infodir=${prefix}/share/info 		\
		--disable-asm --disable-dynload 	\
		--enable-gpg --disable-agent		\
		--with-libiconv-prefix=${prefix} 	\
		--with-libintl-prefix=${prefix} 	\
		--with-zlib=${prefix} 			\
		--with-bzip2=${prefix}

depends_lib	port:libiconv 		\
		port:gettext 		\
		port:zlib 		\
		port:bzip2 		\
		port:bison		\
		port:libassuan		\
		port:libksba		\
		port:libgcrypt		\
		port:libgpg-error	\
		port:pth

patchfiles	patch-g10_Makefile.in patch-tools_Makefile.in

test.run	yes
test.dir	${worksrcpath}/checks
test.target 	check

variant darwin {
	configure.env-append	MACOSX_DEPLOYMENT_TARGET=10.3
	build.env-append		MACOSX_DEPLOYMENT_TARGET=10.3
}

platform darwin 7 {
	configure.env-delete	LDFLAGS="-L${prefix}/lib"
	configure.env-append	LDFLAGS="-L${prefix}/lib -framework IOKit"
}

platform darwin 8 {
	patchfiles-append	patch-tools_gpgparsemail.c
}

platform sunos	{
	configure.args-delete --disable-asm --disable-dynload
}

post-destroot	{
	file delete -force ${destroot}${prefix}/share/info/dir \
		${destroot}${prefix}/share/locale/locale.alias \
		${destroot}${prefix}/lib/charset.alias
}

