Index: files/patch-update-smart-drivedb.in.diff
===================================================================
--- files/patch-update-smart-drivedb.in.diff	(revision 0)
+++ files/patch-update-smart-drivedb.in.diff	(revision 0)
@@ -0,0 +1,20 @@
+--- update-smart-drivedb.in.orig	2010-03-05 06:56:41.000000000 +0900
++++ update-smart-drivedb.in	2010-11-16 03:13:50.000000000 +0900
+@@ -40,7 +40,7 @@
+ SRCEXPR='http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/$location/smartmontools/drivedb.h?revision=HEAD'
+ 
+ # Convert version into branch name: 5.41[.X] -> "RELEASE_5_41_DRIVEDB"
+-BRANCH="`echo $VERSION | sed -n 's|^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\([^0-9].*\)\?$|RELEASE_\1_\2_DRIVEDB|p'`"
++BRANCH="`echo $VERSION | gsed -n 's|^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\([^0-9].*\)\?$|RELEASE_\1_\2_DRIVEDB|p'`"
+ 
+ if [ -z "$BRANCH" ]; then
+   echo "$0: syntax error in version number: $VERSION" >&2; exit 1
+@@ -129,7 +129,7 @@
+ # Keep old file if identical, ignore differences in Id string
+ rm -f "$DEST.lastcheck"
+ if [ -f "$DEST" ]; then
+-  if cat "$DEST" | sed 's|\$''Id''[^$]*\$|$''Id''$|' | cmp - "$DEST.new" >/dev/null; then
++  if cat "$DEST" | gsed 's|\$''Id''[^$]*\$|$''Id''$|' | cmp - "$DEST.new" >/dev/null; then
+     rm -f "$DEST.new"
+     touch "$DEST.lastcheck"
+     echo "$DEST is already up to date"
Index: Portfile
===================================================================
--- Portfile	(revision 73503)
+++ Portfile	(working copy)
@@ -4,6 +4,7 @@
 
 name            smartmontools
 version         5.40
+revision        1
 categories      sysutils
 maintainers     toby
 description     SMART hard drive monitoring
@@ -17,9 +18,13 @@
 platforms       darwin
 license         GPLv2
 master_sites    sourceforge
+patchfiles      patch-update-smart-drivedb.in.diff
 checksums       md5     0f0be0239914ad87830a4fff594bda5b \
                 sha1    08a86a939a2e2cd85d2c88c09188d494f06ce050 \
                 rmd160  ff2ebfd130182ba721248ebfebd9d4d5cc325ff4
+
+depends_run     port:gsed
+
 configure.args  --mandir=${prefix}/share/man \
                 --enable-drivedb \
                 --enable-savestates \
