--- Portfile.orig	2011-11-23 23:53:13.000000000 +0100
+++ Portfile	2011-12-20 18:23:14.000000000 +0100
@@ -7,8 +7,7 @@
 
 name            ffmpeg
 conflicts       ffmpeg-devel
-epoch           1
-version         0.7.8
+version         0.9
 set branch      [join [lrange [split ${version} .] 0 1] .]
 license         GPL-2+
 categories      multimedia
@@ -27,7 +26,7 @@
                         file format to another. It also supports grabbing and \
                         encoding in real time from a TV card. \
                         \
-                        ffserver is an HTTP (RTSP is being developped) \
+                        ffserver is an HTTP (RTSP is being developed) \
                         multimedia streaming server for live broadcasts. Time \
                         shifting of live broadcast is also supported. \
                         \
@@ -51,75 +50,53 @@
 
 use_bzip2       yes
 
-checksums       sha1    df4983c028a61d4bf3baceab3bae535b91b8928a \
-                rmd160  8f69a6bc5caaba4e3d440c2d5dc96a946454a52c
+checksums	sha256 2a9eb7795e6c1ad746aa2cc0fce9f71ec3763f610e362530ab277c6bc327d705 \
+		rmd160 56e1e240363d4f1bc09390f5a3893a1b6b362908
 
-depends_build   port:pkgconfig \
-                port:gmake \
-                port:texi2html
-
-depends_lib     port:lame \
-                port:libvorbis \
-                port:libogg \
-                port:libtheora \
-                port:dirac \
-                port:schroedinger \
-                port:openjpeg \
-                path:lib/libspeex.dylib:speex \
-                port:XviD \
-                port:x264 \
-                port:libvpx \
-                path:lib/pkgconfig/sdl.pc:libsdl \
-                port:bzip2 \
-                port:zlib
+depends_build	port:pkgconfig
+depends_lib	port:lame \
+		port:libvorbis \
+		port:libogg \
+		port:libtheora \
+		port:dirac \
+		port:schroedinger \
+		port:openjpeg \
+		port:speex \
+		port:XviD \
+		port:x264 \
+		port:libvpx \
+		port:libsdl \
+		port:bzip2 \
+		port:zlib
 
 patchfiles      patch-configure.diff
 
-build.cmd       ${prefix}/bin/gmake
-build.env-append V=1
-
 #
 # enable auto configure of mmx and related Intel optimizations by default
 # requires Xcode 3.1 or better on Leopard
 #
 minimum_xcodeversions {9 3.1}
 
-# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used
-# fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
-#
-# similarly clang fails to build on i386 platforms
-#
-# use code provided by jeremyhu here to use gcc-4.2 instead
-#
-# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
-#
-
-if {${configure.compiler} == "clang" ||
-    ${configure.compiler} == "llvm-gcc-4.2"} {
-    configure.compiler gcc-4.2
-    if {![file executable ${configure.cc}]} {
-        depends_build-append port:apple-gcc42
-        configure.compiler apple-gcc-4.2
-    }
-}
-
 configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
 configure.args \
-        --enable-gpl \
-        --enable-postproc \
-        --enable-swscale --enable-avfilter \
+	--disable-doc \
+	--disable-debug \
+	--enable-gpl \
+	--enable-postproc \
+	--enable-swscale \
+	--enable-avfilter \
         --enable-libmp3lame \
         --enable-libvorbis \
         --enable-libtheora \
-        --enable-libdirac --enable-libschroedinger \
+        --enable-libdirac \
+	--enable-libschroedinger \
         --enable-libopenjpeg \
         --enable-libxvid \
         --enable-libx264 \
         --enable-libvpx \
         --enable-libspeex \
-        --mandir=${prefix}/share/man \
-        --enable-shared --enable-pthreads \
-        --cc=${configure.cc}
+        --enable-shared \
+	--cc=${configure.cc}
 
 test.run        yes
 
@@ -128,12 +105,14 @@
 #
 
 post-destroot {
-    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
-    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
-    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
-    foreach f [glob ${worksrcpath}/doc/*.txt] {
-        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
-    }
+	if {[variant_isset doc]} {
+		file mkdir ${destroot}${prefix}/share/doc/ffmpeg
+		file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
+		file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
+		foreach f [glob ${worksrcpath}/doc/*.txt] {
+			file copy $f ${destroot}${prefix}/share/doc/ffmpeg
+		}
+	}
 }
 
 platform powerpc {
@@ -190,6 +169,11 @@
     license-append          Restrictive
 }
 
+variant doc description {install documentation files} {
+	configure.args-delete	--disable-doc
+	depends_build-append	port:texi2html
+}
+
 if {[variant_isset nonfree]} {
 notes "
 *******
