--- /opt/local/var/macports/sources/rsync.macports.org/release/ports/math/ploticus/Portfile	2007-10-22 21:46:57.000000000 -0400
+++ Portfile	2007-12-07 21:19:13.000000000 -0500
@@ -2,7 +2,8 @@
 
 PortSystem 1.0
 name             ploticus
-version          2.31
+version          2.33
+revision         8
 categories       math
 maintainers      nomaintainer
 description      plot generation program
@@ -17,14 +18,17 @@
 homepage         http://ploticus.sourceforge.net/
 platforms        darwin
 
-master_sites     http://ploticus.sourceforge.net/download/
-distname         pl231src
-checksums        md5 70712f7f41484db3bfd9210ae7742762
-
-depends_lib      lib:libX11:XFree86 lib:XXX:libpng lib:XXX:zlib
-
-patchfiles       patch-src__Makefile \
-                 patch-src__gd16.c
+master_sites     sourceforge
+distname         pl233src
+checksums        md5 1e242200e7e52f7a24041c95f58f2fc1
+
+depends_lib      lib:libX11:XFree86 \
+                 port:gd2 port:libpng port:zlib port:jpeg port:freetype
+
+patchfiles       ploticus_2.33-3.diff \
+                 stack.pl.diff \
+                 patch-src__Makefile \
+                 mac.patch
 
 post-patch {
 	reinplace s|__PREFIX__|${prefix}| ${worksrcpath}/src/Makefile
@@ -34,3 +38,10 @@
 
 build.dir        ${worksrcpath}/src
 build.target
+
+destroot {
+    xinstall -d ${destroot}${prefix}/bin
+    xinstall -m 755 src/plgd18 ${destroot}${prefix}/bin/ploticus
+    xinstall -d ${destroot}${prefix}/share/man/man1
+    xinstall -m 444 man/man1/pl.1 ${destroot}${prefix}/share/man/man1/ploticus.1
+}
