Index: files/patch-po_Makevars
===================================================================
--- files/patch-po_Makevars	(revision 0)
+++ files/patch-po_Makevars	(revision 0)
@@ -0,0 +1,11 @@
+--- po/Makevars	2006-06-20 16:32:59.000000000 +0000
++++ po/Makevars.gpg-agent	2007-02-20 01:36:11.000000000 +0000
+@@ -1,7 +1,7 @@
+ # Makefile variables for PO directory in any package using GNU gettext.
+ 
+ # Usually the message domain is the same as the package name.
+-DOMAIN = gnupg2
++DOMAIN = gpg-agent
+ 
+ # These two variables depend on the location of this directory.
+ subdir = po
Index: files/patch-configure
===================================================================
--- files/patch-configure	(revision 0)
+++ files/patch-configure	(revision 0)
@@ -0,0 +1,16 @@
+--- configure	2007-01-31 14:09:31.000000000 +0000
++++ configure.gpg-agent	2007-02-20 01:24:54.000000000 +0000
+@@ -557,10 +557,10 @@
+ SHELL=${CONFIG_SHELL-/bin/sh}
+ 
+ # Identity of this package.
+-PACKAGE_NAME='gnupg'
+-PACKAGE_TARNAME='gnupg'
++PACKAGE_NAME='gpg-agent'
++PACKAGE_TARNAME='gpg-agent'
+ PACKAGE_VERSION='2.0.2'
+-PACKAGE_STRING='gnupg 2.0.2'
++PACKAGE_STRING='gpg-agent 2.0.2'
+ PACKAGE_BUGREPORT='bug-gnupg@gnupg.org'
+ 
+ ac_unique_file="sm/gpgsm.c"
Index: Portfile
===================================================================
--- Portfile	(revision 22927)
+++ Portfile	(working copy)
@@ -1,44 +1,60 @@
 # $Id$
 
-PortSystem  1.0
-name        gpg-agent
-version     1.9.10
-revision    1
-categories  security
-maintainers yeled@macports.org
-description GPG key agent
-long_description    gpg-agent is a key management agent similar \
-            in function to ssh-agent.
-homepage    http://www.gnupg.org/
-platforms   darwin
-distname    gnupg-${version}
-master_sites    ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/ \
-        ftp://ftp.freenet.de/pub/ftp.gnupg.org/gcrypt/alpha/gnupg/
-checksums   md5 d923cfe0921898fbeb66374a0e32ddc6
+PortSystem	1.0
+name		gpg-agent
+version		2.0.2
+categories	security mail 
+maintainers	yeled@macports.org
+description	GPG key agent
+long_description	gpg-agent is a key management agent similar \
+			in function to ssh-agent.
+homepage	http://www.gnupg.org
+platforms	darwin freebsd sunos
+distname        gnupg-${version}
+master_sites    http://mirrors.rootmode.com/ftp.gnupg.org/gnupg/ \
+        ftp://ftp.freenet.de/pub/ftp.gnupg.org/gcrypt/gnupg/ \
+        ftp://ftp.gnupg.org/gcrypt/gnupg/
 
-configure.args  --mandir=${prefix}/share/man \
-        --infodir=${prefix}/share/info \
-        --with-pinentry-pgm=${prefix}/bin/pinentry \
-        --enable-agent-only
+use_bzip2	yes
+checksums	${distfiles} md5 9f972c78135a7dea1bae66bb9f263980 \
+			     sha1 1a3165c5b601f3244b8885143d02bea4210495e3 \
+			     rmd160 6cc52da761927e17842842c00598c4974208affa
 
-depends_lib port:gettext port:libiconv port:zlib port:bison \
-    port:libgpg-error port:libassuan port:libgcrypt port:libksba \
-    port:pth port:pinentry 
 
-destroot.dir    ${worksrcpath}/agent
+configure.env	CPPFLAGS="-I${prefix}/include" LDFLAGS="-L${prefix}/lib"
 
-test.run    yes
-test.dir    ${worksrcpath}/checks
-test.target     check
+configure.args	--enable-agent-only \
+		--with-pinentry-pgm=${prefix}/bin/pinentry
 
-variant darwin {
-    configure.args-append --disable-asm --disable-dynload
+depends_lib	port:libiconv 		\
+		port:gettext 		\
+		port:zlib 		\
+		port:bzip2 		\
+		port:bison		\
+		port:libassuan		\
+		port:libksba		\
+		port:libgcrypt		\
+		port:libgpg-error	\
+		port:pth		\
+		port:pinentry
+
+patchfiles	patch-po_Makevars
+
+test.run	yes
+test.dir	${worksrcpath}/tests
+test.target 	check
+
+platform darwin {
+	configure.env-append	MACOSX_DEPLOYMENT_TARGET=10.3
+	build.env-append		MACOSX_DEPLOYMENT_TARGET=10.3
 }
 
-variant sunos {
-    configure.args-append --disable-asm --disable-dynload
+platform darwin 7 {
+	configure.env-delete	LDFLAGS="-L${prefix}/lib"
+	configure.env-append	LDFLAGS="-L${prefix}/lib -framework IOKit"
 }
 
-post-destroot   {
-    file delete -force ${destroot}${prefix}/share/info/dir
+variant no_pinentry {
+	depends_lib-delete	port:pinentry
+	configure.args-delete	--with-pinentry-pgm=${prefix}/bin/pinentry
 }
