Index: Portfile
===================================================================
--- Portfile	(revision 71325)
+++ Portfile	(working copy)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
 # $Id$
 
 PortSystem 1.0
@@ -6,6 +7,7 @@
 name			openssl
 version			1.0.0a
 epoch			1
+revision        1
 platforms		darwin freebsd
 categories		devel security
 maintainers		mww
@@ -35,15 +37,50 @@
 configure.args	-L${prefix}/lib --openssldir=${prefix}/etc/openssl zlib no-asm no-krb5 shared
 configure.ccache	no
 
-variant rfc3779 description {enable RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers} {
-	configure.args-append	enable-rfc3779
+variant rfc3779 description {enable support for RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers} {
+    configure.args-append  enable-rfc3779
 }
 
+variant md2 description {enable support for RFC 1319: MD2 message digest algorithm; also used as a hash function for PKI certificates; WARNING: no longer considered secure} {
+    configure.args-append  enable-md2
+}
+
+variant rc5 description {enable support for RFC 2040: RC5 general block cipher; patented by RSA Security; still considered secure for keys of at least 72 bits} {
+    configure.args-append  enable-rc5
+}
+
+variant krb5 description {enable experimental support for RFC 4120: the Kerberos 5 network authentication protocol, MIT version} {
+    configure.args-delete  no-krb5
+    configure.args-append  --with-krb5-flavor=MIT \
+                           --with-krb5-dir=${prefix}
+    depends_lib-append     port:kerberos5
+}
+
+variant gmp description {enable support for GMP (the GNU Multiple Precision Arithmetic Library) to perform RSA private key operations} {
+    configure.args-delete  no-gmp
+    configure.args-append  enable-gmp -lgmp
+    depends_lib-append     port:gmp
+}
+
+variant jpake description {enable experimental support for J-PAKE (Password Authenticated Key Exchange by Juggling; possibly part of IEEE P1363)} {
+    configure.args-delete  no-jpake
+    configure.args-append  experimental-jpake
+}
+
 use_parallel_build	no
 
 destroot.destdir	INSTALL_PREFIX=${destroot}
 destroot.args		MANDIR=${prefix}/share/man
 
+post-destroot {
+    # make sure engines (shared libraries) reference themselves
+    # using full paths (just like all other shared libraries)
+    foreach fixfile [exec /bin/ls ${destroot}${prefix}/lib/engines] {
+        system "install_name_tool -id ${prefix}/lib/engines/${fixfile} \
+${destroot}${prefix}/lib/engines/${fixfile}"
+    }
+}
+
 test.run		yes
 
 livecheck.type	regex
