# $Id: Portfile,v 1.40 2006/08/01 19:47:12 waqar Exp $

PortSystem	1.0
name		gnupg
version		1.4.5
categories	mail security
maintainers	waqar@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
master_sites	http://ftp.gnupg.org/gcrypt/gnupg/		\
		ftp://ftp.gnupg.org/gcrypt/gnupg/ 		\
		ftp://ftp.planetmirror.com/pub/gnupg/ 		\
		ftp://gd.tuwien.ac.at/privacy/gnupg/gnupg/ 	\
		ftp://ftp.jyu.fi/pub/crypt/gcrypt/gnupg/ 	\
		ftp://ftp.freenet.de/pub/ftp.gnupg.org/gcrypt/gnupg/

use_bzip2	yes
checksums	${distfiles} md5 811525965b4c0987e6418a7729a6444d \
		${distfiles} sha1 553fefe0da5a91108dd9468e381faf9487754f9a 

configure.args	--mandir=${prefix}/share/man 		\
		--infodir=${prefix}/share/info 		\
		--disable-asm --disable-dynload 	\
		--with-libiconv-prefix=${prefix} 	\
		--with-libintl-prefix=${prefix} 	\
		--with-zlib=${prefix} 			\
		--with-bzip2=${prefix}

depends_lib	port:libiconv 	\
		port:gettext 	\
		port:zlib 	\
		port:bzip2 

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

variant idea 	{
	patch_sites-append	http://www.gnupg.dk/contrib-dk
  	patchfiles 	idea.c.gz
  	checksums-append \
      			idea.c.gz md5 9dc3bc086824a8c7a331f35e09a3e57f
  	patch.dir 	${worksrcpath}/cipher
  	patch.cmd 	cat
   	patch.pre_args 	> idea.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
}
