diff -Naur dports/net/maradns/Portfile dports-devel/net/maradns/Portfile
--- dports/net/maradns/Portfile	2007-03-02 05:33:43.000000000 +0000
+++ dports-devel/net/maradns/Portfile	2007-03-11 12:12:04.000000000 +0000
@@ -1,21 +1,82 @@
-# $Id: Portfile 22478 2007-03-02 05:16:40Z pipping@macports.org $
+# $Id: Portfile 20343 2006-11-02 01:28:24Z blair@macports.org $
 
 PortSystem 1.0
 
 name			maradns
-version			1.1.55
+version			1.2.12.04
+
+set branch		[strsed ${version} {s/\.[0-9]*\.[0-9]*$//}]
+
 categories		net
 platforms		darwin
-maintainers		nomaintainer@macports.org
+maintainers		boeyms@fastmail.fm openmaintainer@macports.org
 description		DNS server supporting authoritative, recursive and caching DNS
 long_description	MaraDNS is a fully functional DNS server supporting \
 			authoritative DNS, recursive DNS, and caching DNS.
 
 homepage		http://www.maradns.org/
-master_sites	http://www.maradns.org/download/1.1/
-checksums		md5 8f42f1e1de21fdd5287f58985e189a32
+master_sites		http://www.maradns.org/download/${branch}/${version} \
+			sourceforge
+			
+checksums		md5	957b7772d22f30cb948def52eb6eaaf6 \
+			sha1	02b9a8ddaedbec2b1d0113a7f2bc8b654354e657
 use_bzip2		yes
 
+patchfiles		patch-configure patch-install.darwin
+
+
+post-extract {
+	cd ${worksrcpath}
+# Delete unneeded stress-testing code (not built by default).  It may be worth
+# adding this as a variant in a future revision.
+	file delete -force sqa
+# Delete Portuguese documentation sources (documentation not built by default;
+# will need to add a section to build these docs if localisation desired)
+	file delete -force doc/pt_br
+# Delete unneeded English documentation sources (documentation already built)
+# and support files that will otherwise be installed in the doc directories
+	file delete -force doc/en/source
+	file delete doc/en/man/read.manpage
+	file delete doc/en/pdf/tmac.an.patch
+	eval file delete [glob doc/en/*/{Makefile,*.embed,make.*}]
+# Fix installation script (called by "make install") so that configuration
+# files and directories are placed in destroot
+	reinplace "s|\$RPM_BUILD_ROOT|${destroot}${prefix}|g" build/install.sh
+# Fix hardcoding of default paths to chroot, log and zone file dirs, and
+# configuration file, in source and docs. copy.devs.c is only used if maradns
+# is built for Solaris, and maraconf.sh is neither installed by default nor yet
+# by this Portfile, but hey.
+	set marabindocpages	"duende maradns mararc zoneserver"
+	set marasetupdocpages	"authoritative compile convert dangling \
+		dnsmaster dnsslave dnstcp quick_start recursive update"
+	set marareinplace	"s|/etc/mara|${prefix}/etc/mara|g"
+	foreach docpage ${marabindocpages} {
+		eval reinplace "${marareinplace}" \
+		doc/en/text/man.${docpage}.txt \
+		doc/en/tutorial/man.${docpage}.html
+	}
+	foreach docpage ${marasetupdocpages} {
+		eval reinplace "${marareinplace}" \
+		doc/en/text/${docpage}.txt \
+		doc/en/tutorial/${docpage}.html
+	}
+	eval reinplace "${marareinplace}" \
+		MaraDns.h \
+		build/copy.devs.c \
+		parse/ParseMaraRc.c \
+		tools/maraconf.sh \
+		doc/en/QuickStart \
+		doc/en/examples/example_authoritative_mararc.txt \
+		doc/en/examples/example_full_mararc \
+		doc/en/examples/example_mararc \
+		doc/en/examples/example_recursive_mararc.txt \
+		doc/en/man/duende.8 \
+		doc/en/man/maradns.8 \
+		doc/en/man/zoneserver.8 \
+		doc/en/man/mararc.5
+}
+
+
 configure.pre_args
 
 build.target
@@ -23,11 +84,24 @@
 destroot.env	PREFIX=${destroot}${prefix}
 destroot.destdir
 
+# Keep chroot directory for duende (monitors and logs maradns instances)
+#
+# (This places a .turd file in the logger directory, but the duende man page
+# states that it requires a _blank_ logger directory to run (emphasis added).
+# Testing has not revealed any interference from the .turd file so far, but
+# the testing done may not have been exhaustive (I don't know enough about
+# chroot jails).)
+destroot.keepdirs	${destroot}${prefix}/etc/maradns/logger
+
 post-destroot {
-	xinstall -m 755 -d ${destroot}${prefix}/etc/maradns/logger
-	xinstall -m 644 ${filespath}/mararc ${destroot}${prefix}/etc/maradns
-	reinplace "s|__PREFIX__|${prefix}|g" ${destroot}${prefix}/etc/maradns/mararc
-	file delete -force ${destroot}${prefix}/maradns-${version}
+# Delete remaining unneeded build files; this also deletes the man page for
+# the mqhash tool, which is not installed by default, but it appears to be only
+# for development testing.
+	file delete -force \
+		${destroot}${prefix}/share/doc/maradns-${version}/Makefile \
+		${destroot}${prefix}/share/doc/maradns-${version}/man
+	file rename ${destroot}${prefix}/etc/mararc \
+		${destroot}${prefix}/etc/example-mararc
 }
 
 startupitem.create	yes
@@ -36,7 +110,21 @@
 startupitem.start	"\[ -x \${BIN} \] && \${BIN} &; echo \$! > \${PID}"
 startupitem.stop	"\[ -r \${PID} \] && /bin/kill \$(cat \${PID})"
 
+post-install {
+	ui_msg "***************************************************************"
+	ui_msg "* To make MaraDNS functional, you will need to create"
+	ui_msg "* ${prefix}/etc/mararc.  Please read the mararc man page"
+	ui_msg "* for details.  Example mararc files are in"
+	ui_msg "* ${prefix}/share/doc/maradns-${version}/examples ."
+	ui_msg "***************************************************************"
+}
+
 platform darwin 8 {
 	build.args	CC="/usr/bin/gcc-4.0 -DDARWIN"
 }
 
+variant authonly {
+	configure.args-append	--authonly
+	startupitem.init	\
+		"PID=${prefix}/var/run/${name}.pid\nBIN=${prefix}/sbin/maradns.authonly"
+}
diff -Naur dports/net/maradns/files/mararc dports-devel/net/maradns/files/mararc
--- dports/net/maradns/files/mararc	2006-08-30 05:23:40.000000000 +0000
+++ dports-devel/net/maradns/files/mararc	1970-01-01 00:00:00.000000000 +0000
@@ -1,5 +0,0 @@
-ipv4_bind_addresses = "127.0.0.1"
-chroot_dir = "__PREFIX__/etc/maradns"
-recursive_acl = "127.0.0.1"
-hide_disclaimer = "NO"
-
diff -Naur dports/net/maradns/files/patch-configure dports-devel/net/maradns/files/patch-configure
--- dports/net/maradns/files/patch-configure	1970-01-01 00:00:00.000000000 +0000
+++ dports-devel/net/maradns/files/patch-configure	2007-02-06 02:41:49.000000000 +0000
@@ -0,0 +1,11 @@
+--- configure	2006-05-16 09:28:36.000000000 +1000
++++ configure.new	2007-02-02 16:53:12.000000000 +1100
+@@ -114,7 +114,7 @@
+ 	echo \(if you typed in \"make\" before, just type it again\)
+ 	echo
+ 	echo THIS PORT HAS NOT BEEN FULLY TESTED\; USE AT YOUR OWN RISK
+-	EXITCODE=1
++	EXITCODE=0
+ # This is a a template for adding support to a new OS for MaraDNS.
+ # Some points: If you port MaraDNS, make sure the underlying OS has
+ # /dev/urandom support or have the default mararc have a
diff -Naur dports/net/maradns/files/patch-install.darwin dports-devel/net/maradns/files/patch-install.darwin
--- dports/net/maradns/files/patch-install.darwin	1970-01-01 00:00:00.000000000 +0000
+++ dports-devel/net/maradns/files/patch-install.darwin	2007-02-06 02:37:25.000000000 +0000
@@ -0,0 +1,11 @@
+--- build/install.darwin	2005-02-20 06:04:35.000000000 +1100
++++ build/install.darwin.new	2007-02-04 16:52:16.000000000 +1100
+@@ -35,7 +35,7 @@
+ # The directory to put man pages which describe the server programs
+ MAN8="$PREFIX/share/man/man8/"
+ # The directory to put a copy of the MaraDNS documents on the system
+-DOCS="$PREFIX/maradns-$VERSION"
++DOCS="$PREFIX/share/doc/maradns-$VERSION"
+ 
+ # Mandrake does not have a /usr/local/man.  Ugh.
+ # As a result, we need the following kludge to get this to
