# $Id: Portfile 50980 2009-05-14 19:41:55Z and.damore@macports.org $

PortSystem	1.0

name		gnupg
version		1.4.9
categories	mail security
maintainers	waqar
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    cc52393087480ac8d245625004a6a30c \
            ${distfiles} sha1   826f4bef1effce61c3799c8f7d3cc8313b340b55 \
            ${distfiles} rmd160 21274c6638bb1bc1983a9b5bccfa1ad9cf708edc
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:readline \
		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 \
		idea.c.gz sha1   82fded4ec31b97b3b2dd22741880b67cfee40f84 \
		idea.c.gz rmd160 e35be5a031d10d52341ac5f029d28f811edd908d
  	patch.dir 	${worksrcpath}/cipher
  	patch.cmd 	cat
   	patch.pre_args 	> idea.c
}

platform darwin 7 {
	depends_lib-append	port:gnutar
	configure.args-append --with-tar=${prefix}/bin/gnutar
}

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

livecheck.check regex
livecheck.url   http://mirrors.rootmode.com/ftp.gnupg.org/${name}/?O=D
livecheck.regex ${name}-(1\\.\\d+\\.\\d+)
