SFEffmpeg.spec ffmpeg.spec: bump to 0.8.2, add --with_runtime_cpudetect (off), fix html+man+%doc, add back reworked patches ffmpeg-09-configure* ffmpeg-10-Makefile* ffmpeg-11-add-sys_videodev2_h, parallel builds gmake -j, fix perms for %{_datadir}/doc, no mixed /bin/sh anymore - now all /usr/bin/bash
authortom68
Sun, 14 Aug 2011 15:35:27 +0000
changeset 3702 e21d4aa0f787
parent 3701 ce1eb8651d60
child 3703 121e17422039
SFEffmpeg.spec ffmpeg.spec: bump to 0.8.2, add --with_runtime_cpudetect (off), fix html+man+%doc, add back reworked patches ffmpeg-09-configure* ffmpeg-10-Makefile* ffmpeg-11-add-sys_videodev2_h, parallel builds gmake -j, fix perms for %{_datadir}/doc, no mixed /bin/sh anymore - now all /usr/bin/bash
base-specs/ffmpeg.spec
encumbered/SFEffmpeg.spec
patches/ffmpeg-09-configure-gnuism-pod2man.diff
patches/ffmpeg-10-Makefile-quick-texi2html-fix.diff
patches/ffmpeg-11-add-sys_videodev2_h.diff
--- a/base-specs/ffmpeg.spec	Sun Aug 14 15:15:09 2011 +0000
+++ b/base-specs/ffmpeg.spec	Sun Aug 14 15:35:27 2011 +0000
@@ -5,15 +5,24 @@
 #
 
 Summary:                 A very fast video and audio converter
-Version:                 0.8
+Version:                 0.8.2
 Source:                  http://www.ffmpeg.org/releases/ffmpeg-%version.tar.bz2
 URL:                     http://www.ffmpeg.org/index.html
+Patch9:			 ffmpeg-09-configure-gnuism-pod2man.diff
+Patch10:		 ffmpeg-10-Makefile-quick-texi2html-fix.diff
+Patch11:		 ffmpeg-11-add-sys_videodev2_h.diff
 SUNW_BaseDir:            %{_basedir}
 BuildRoot:               %{_tmppath}/%{name}-%{version}-build
 Autoreqprov:             on
 
 %prep
 %setup -q -n ffmpeg-%version
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+perl -w -pi.bak -e "s,^#\!\s*/bin/sh,#\!/usr/bin/bash," `find . -type f -exec grep -q "^#\!.*/bin/sh" {} \; -print`
+
+
 
 %build
 CPUS=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}')
@@ -65,16 +74,29 @@
     --enable-libopenjpeg \
     --enable-vdpau	\
     --extra-ldflags=-mimpure-text \
+%if %{with_runtime_cpudetect}
+    --enable-runtime-cpudetect \
+    --enable-sse \
+    --enable-ssse3 \
+%endif
     --enable-shared
 
-gmake 
+gmake -j$CPUS
 
 %install
+# for pod2man
+export PATH=/usr/perl5/bin:$PATH
 gmake install DESTDIR=$RPM_BUILD_ROOT BINDIR=$RPM_BUILD_ROOT%{_bindir}
 
 mkdir $RPM_BUILD_ROOT%{_libdir}/ffmpeg
 cp config.mak $RPM_BUILD_ROOT%{_libdir}/ffmpeg
 
+#workaround for occational not finding %doc files
+touch placeholder.html
+cp -p *.html doc/
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/doc/%{name}
+cp -p doc/developer.html doc/faq.html doc/ffmpeg.html doc/ffplay.html doc/ffprobe.html doc/ffserver.html doc/general.html doc/libavfilter.html $RPM_BUILD_ROOT/%{_datadir}/doc/%{name}/
+
 # Create a ffmpeg.pc - Some apps need it
 cat > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/ffmpeg.pc << EOM
 Name: ffmpeg
@@ -94,6 +116,30 @@
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Sat Aug 13 2011 - Thomas Wagner
+- bump to 0.8.2
+- change in include/x86_sse2.inc to not set -xarch=sse2 in arch_ldadd 
+  for case cc_is_gcc == 1 - this avoids gcc errors in configure
+  "gcc: error: language arch=sse2 not recognized"
+- add switch with_runtime_cpudetect, by default set to off 
+  (Distro builders may switch this to on with pkgtool --with-runtime_cpudetect )
+##TODO## might need some testing if acceleration works on CPUs
+- comment %doc, manpages - files not present in 0.8.2
+- re-add patches removed with r3618, reworked,
+  patch9: configure gnuism, re-add manpages by pod2man if texi2html not available,
+  (reworked ffmpeg-02-configure.diff and ffmpeg-03-gnuisms.diff)
+  patch10: *new* get texi2html work again - fix probably incomplete or needs updated
+  texi2html, re-add %doc and manpages
+- allow parallel build gmake -j$CPUS
+- add patch11: ffmpeg-11-add-sys_videodev2_h.diff (reworked ffmpeg-03-v4l2.diff)
+##TODO## v4l2 patch11 incomplete, maybe needs more from ffmpeg-03-v4l2.diff, ffmpeg-07-new-v4l2.diff
+- for pod2man add in %install export PATH=/usr/perl5/bin:$PATH
+- fix perms for %{_datadir}/doc
+- replace %doc with manual install
+- make all /bin/sh script in source tree use /usr/bin/bash
+##TODO## patch11 incomplete, maybe needs more from ffmpeg-03-v4l2.diff, ffmpeg-07-new-v4l2.diff
+##TODO## verify build-time dependencies (texi2html, pod2man, others)
+##TODO## check if v4l patches still apply on Solaris
 * Tue Aug  9 2011 - Alex Viskovatoff
 - add --enable-vdpau, which can speed up decoding
 * Fri Jul 29 2011 - Alex Viskovatoff
--- a/encumbered/SFEffmpeg.spec	Sun Aug 14 15:15:09 2011 +0000
+++ b/encumbered/SFEffmpeg.spec	Sun Aug 14 15:35:27 2011 +0000
@@ -11,6 +11,9 @@
 
 %define SUNWlibsdl %(/usr/bin/pkginfo -q SUNWlibsdl && echo 1 || echo 0)
 
+##TODO## this is experimental: use pkgtool --with-runtime_cpudetect ...
+%define with_runtime_cpudetect %{?_with_runtime_cpudetect:1}%{?!_with_runtime_cpudetect:0}
+
 %if %arch_sse2
 %define arch_opt --cpu=i686 --enable-mmx --enable-mmx2
 %include x86_sse2.inc
@@ -150,12 +153,14 @@
 %dir %attr (0755, root, bin) %{_libdir}/%{sse2_arch}
 %{_libdir}/%{sse2_arch}/lib*.so*
 %endif
-%dir %attr (0755, root, sys) %dir %{_datadir}
+%dir %attr (0755, root, sys) %{_datadir}
+%dir %attr (0755, root, other) %{_datadir}/doc
+%{_datadir}/doc/*
 %dir %attr(0755, root, bin) %{_datadir}/ffmpeg
 %{_datadir}/ffmpeg/*.ffpreset
 %dir %attr(0755, root, bin) %{_mandir}/man1
 %{_mandir}/man1/*
-%doc -d %base_arch/ffmpeg-%version/doc developer.html faq.html ffmpeg.html ffplay.html ffprobe.html ffserver.html general.html libavfilter.html
+#sometimes broken %doc -d %base_arch/ffmpeg-%version doc/developer.html doc/faq.html doc/ffmpeg.html doc/ffplay.html doc/ffprobe.html doc/ffserver.html doc/general.html doc/libavfilter.html
 
 %files devel
 %defattr (-, root, bin)
@@ -179,7 +184,32 @@
 %{_includedir}/libpostproc
 %{_includedir}/libswscale
 
+
 %changelog
+* Sat Aug 13 2011 - Thomas Wagner
+- bump to 0.8.2
+- change in include/x86_sse2.inc to not set -xarch=sse2 in arch_ldadd 
+  for case cc_is_gcc == 1 - this avoids gcc errors in configure
+  "gcc: error: language arch=sse2 not recognized"
+- add switch with_runtime_cpudetect, by default set to off 
+  (Distro builders may switch this to on with pkgtool --with-runtime_cpudetect )
+##TODO## might need some testing if acceleration works on CPUs
+- comment %doc, manpages - files not present in 0.8.2
+- re-add patches removed with r3618, reworked,
+  patch9: configure gnuism, re-add manpages by pod2man if texi2html not available,
+  (reworked ffmpeg-02-configure.diff and ffmpeg-03-gnuisms.diff)
+  patch10: *new* get texi2html work again - fix probably incomplete or needs updated
+  texi2html, re-add %doc and manpages
+- allow parallel build gmake -j$CPUS
+- add patch11: ffmpeg-11-add-sys_videodev2_h.diff (reworked ffmpeg-03-v4l2.diff)
+##TODO## v4l2 patch11 incomplete, maybe needs more from ffmpeg-03-v4l2.diff, ffmpeg-07-new-v4l2.diff
+- for pod2man add in %install export PATH=/usr/perl5/bin:$PATH
+- fix perms for %{_datadir}/doc
+- replace %doc with manual install
+- make all /bin/sh script in source tree use /usr/bin/bash
+##TODO## patch11 incomplete, maybe needs more from ffmpeg-03-v4l2.diff, ffmpeg-07-new-v4l2.diff
+##TODO## verify build-time dependencies (texi2html, pod2man, others)
+##TODO## check if v4l patches still apply on Solaris
 * Sat Jul 16 2011 - Alex Viskovatoff
 - Add SFEyasm as a dependency; package documentation files
 - Add --disable-asm as option for i386 so that newer versions build
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ffmpeg-09-configure-gnuism-pod2man.diff	Sun Aug 14 15:35:27 2011 +0000
@@ -0,0 +1,316 @@
+--- ffmpeg-0.8.2/configure.orig	2011-08-10 14:16:41.000000000 +0200
++++ ffmpeg-0.8.2/configure	2011-08-13 16:27:56.356242408 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # FFmpeg configure script
+ #
+@@ -307,17 +307,17 @@
+ }
+ 
+ c_escape(){
+-    echo "$*" | sed 's/["\\]/\\\0/g'
++    echo "$*" | /usr/gnu/bin/sed 's/["\\]/\\\0/g'
+ }
+ 
+ sh_quote(){
+-    v=$(echo "$1" | sed "s/'/'\\\\''/g")
++    v=$(echo "$1" | /usr/gnu/bin/sed "s/'/'\\\\''/g")
+     test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
+     echo "$v"
+ }
+ 
+ cleanws(){
+-    echo "$@" | sed 's/^ *//;s/  */ /g;s/ *$//'
++    echo "$@" | /usr/gnu/bin/sed 's/^ *//;s/  */ /g;s/ *$//'
+ }
+ 
+ filter(){
+@@ -361,11 +361,11 @@
+ set_safe(){
+     var=$1
+     shift
+-    eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
++    eval $(echo "$var" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')='$*'
+ }
+ 
+ get_safe(){
+-    eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
++    eval echo \$$(echo "$1" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')
+ }
+ 
+ pushvar(){
+@@ -405,13 +405,13 @@
+ 
+ enable_safe(){
+     for var; do
+-        enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
++        enable $(echo "$var" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')
+     done
+ }
+ 
+ disable_safe(){
+     for var; do
+-        disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
++        disable $(echo "$var" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')
+     done
+ }
+ 
+@@ -1519,7 +1519,7 @@
+ ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
+ ffserver_extralibs='$ldl'
+ 
+-doc_deps="texi2html"
++doc_deps="texi2html pod2man"
+ 
+ # tests
+ 
+@@ -1710,7 +1710,7 @@
+ 
+ # since the object filename is not given with the -MM flag, the compiler
+ # is only able to print the basename, and we must add the path ourselves
+-DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
++DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | /usr/gnu/bin/sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
+ DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
+ 
+ # find source path
+@@ -1720,7 +1720,7 @@
+ else
+     source_path=$(cd $(dirname "$0"); pwd)
+     enable source_path_used
+-    echo "$source_path" | grep -q '[[:blank:]]' &&
++    echo "$source_path" | /usr/gnu/bin/grep -q '[[:blank:]]' &&
+         die "Out of tree builds are impossible with whitespace in source path."
+     test -e "$source_path/config.h" &&
+         die "Out of tree builds are impossible with config.h in source dir."
+@@ -1737,7 +1737,7 @@
+     thing=$1
+     pattern=$2
+     file=$source_path/$3
+-    sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
++    /usr/gnu/bin/sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
+ }
+ 
+ ENCODER_LIST=$(find_things  encoder  ENC      libavcodec/allcodecs.c)
+@@ -1753,7 +1753,7 @@
+ FILTER_LIST=$(find_things   filter   FILTER   libavfilter/allfilters.c)
+ 
+ find_tests(){
+-    map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
++    map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | /usr/gnu/bin/grep -v '[^-a-z0-9_]')
+ }
+ 
+ ACODEC_TESTS=$(find_tests acodec)
+@@ -1781,7 +1781,7 @@
+ show_list() {
+     suffix=_$1
+     shift
+-    echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
++    echo $* | /usr/gnu/bin/sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
+     exit 0
+ }
+ 
+@@ -1800,14 +1800,14 @@
+     map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
+     ;;
+     --enable-*=*|--disable-*=*)
+-    eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
++    eval $(echo "${opt%%=*}" | /usr/gnu/bin/sed 's/--/action=/;s/-/ thing=/')
+     is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
+     eval list=\$$(toupper $thing)_LIST
+-    name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
++    name=$(echo "${optval}" | /usr/gnu/bin/sed "s/,/_${thing}|/g")_${thing}
+     $action $(filter "$name" $list)
+     ;;
+     --enable-?*|--disable-?*)
+-    eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
++    eval $(echo "$opt" | /usr/gnu/bin/sed 's/--/action=/;s/-/ option=/;s/-/_/g')
+     if is_in $option $COMPONENT_LIST; then
+         test $action = disable && action=unset
+         eval $action \$$(toupper ${option%s})_LIST
+@@ -1828,7 +1828,7 @@
+     *)
+     optname="${opt%%=*}"
+     optname="${optname#--}"
+-    optname=$(echo "$optname" | sed 's/-/_/g')
++    optname=$(echo "$optname" | /usr/gnu/bin/sed 's/-/_/g')
+     if is_in $optname $CMDLINE_SET; then
+         eval $optname='$optval'
+     elif is_in $optname $CMDLINE_APPEND; then
+@@ -1934,7 +1934,7 @@
+ filter_cppflags=echo
+ filter_asflags=echo
+ 
+-if   $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
++if   $cc -v 2>&1 | /usr/gnu/bin/grep -q '^gcc.*LLVM'; then
+     cc_type=llvm_gcc
+     cc_version=__VERSION__
+     gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)')
+@@ -1943,7 +1943,7 @@
+     AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+     speed_cflags='-O3'
+     size_cflags='-Os'
+-elif $cc -v 2>&1 | grep -qi ^gcc; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -qi ^gcc; then
+     cc_type=gcc
+     cc_version=__VERSION__
+     gcc_version=$($cc --version | head -n1)
+@@ -1951,13 +1951,13 @@
+     gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
+     gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
+     cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
+-    if ! $cc -dumpversion | grep -q '^2\.'; then
++    if ! $cc -dumpversion | /usr/gnu/bin/grep -q '^2\.'; then
+         CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+         AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+     fi
+     speed_cflags='-O3'
+     size_cflags='-Os'
+-elif $cc --version 2>/dev/null | grep -q Intel; then
++elif $cc --version 2>/dev/null | /usr/gnu/bin/grep -q Intel; then
+     cc_type=icc
+     cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
+     cc_ident=$($cc --version | head -n1)
+@@ -1967,13 +1967,13 @@
+     speed_cflags='-O3'
+     size_cflags='-Os'
+     noopt_cflags='-O1'
+-elif $cc -v 2>&1 | grep -q xlc; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q xlc; then
+     cc_type=xlc
+     cc_version="AV_STRINGIFY(__IBMC__)"
+     cc_ident=$($cc -qversion 2>/dev/null | head -n1)
+     speed_cflags='-O5'
+     size_cflags='-O5 -qcompact'
+-elif $cc -V 2>/dev/null | grep -q Compaq; then
++elif $cc -V 2>/dev/null | /usr/gnu/bin/grep -q Compaq; then
+     cc_type=ccc
+     cc_version="AV_STRINGIFY(__DECC_VER)"
+     cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
+@@ -1982,7 +1982,7 @@
+     add_ldflags -Wl,-z,now # calls to libots crash without this
+     speed_cflags='-fast'
+     size_cflags='-O1'
+-elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
++elif $cc --vsn 2>/dev/null | /usr/gnu/bin/grep -q "ARM C/C++ Compiler"; then
+     test -d "$sysroot" || die "No valid sysroot specified."
+     cc_type=armcc
+     cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
+@@ -1993,7 +1993,7 @@
+         --configure_sysroot="$sysroot"        \
+         --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
+         die "Error creating armcc configuration file."
+-    $cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
++    $cc --vsn | /usr/gnu/bin/grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
+     cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
+     as_default="${cross_prefix}gcc"
+     CC_DEPFLAGS='-MMD'
+@@ -2001,7 +2001,7 @@
+     speed_cflags='-O3'
+     size_cflags='-Os'
+     filter_asflags="filter_out -W${armcc_opt}*"
+-elif $cc -version 2>/dev/null | grep -q TMS470; then
++elif $cc -version 2>/dev/null | /usr/gnu/bin/grep -q TMS470; then
+     cc_type=tms470
+     cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
+     cc_ident=$($cc -version | head -n1 | tr -s ' ')
+@@ -2041,20 +2041,20 @@
+             esac
+         done
+     }
+-elif $cc -v 2>&1 | grep -q clang; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q clang; then
+     cc_type=clang
+-    $cc -dM -E $TMPC | grep -q __clang_version__ &&
++    $cc -dM -E $TMPC | /usr/gnu/bin/grep -q __clang_version__ &&
+         cc_version=__clang_version__ || cc_version=__VERSION__
+     cc_ident=$($cc --version | head -n1)
+     CC_DEPFLAGS='-MMD'
+     AS_DEPFLAGS='-MMD'
+     speed_cflags='-O3'
+     size_cflags='-Os'
+-elif $cc -V 2>&1 | grep -q Sun; then
++elif $cc -V 2>&1 | /usr/gnu/bin/grep -q Sun; then
+     cc_type=suncc
+     cc_version="AV_STRINGIFY(__SUNPRO_C)"
+     cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
+-    DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
++    DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | /usr/gnu/bin/sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
+     DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
+     speed_cflags='-O5'
+     size_cflags='-O5 -xspace'
+@@ -2092,7 +2092,7 @@
+             esac
+         done
+     }
+-elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q 'PathScale\|Path64'; then
+     cc_type=pathscale
+     cc_version=__PATHSCALE__
+     cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
+@@ -2101,7 +2101,7 @@
+     speed_cflags='-O2'
+     size_cflags='-Os'
+     filter_cflags='filter_out -Wdisabled-optimization'
+-elif $cc -v 2>&1 | grep -q Open64; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q Open64; then
+     cc_type=open64
+     cc_version=__OPEN64__
+     cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
+@@ -2146,7 +2146,7 @@
+         gcc|llvm_gcc)
+             check_native(){
+                 $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+-                sed -n "/$1=/{
++                /usr/gnu/bin/sed -n "/$1=/{
+                             s/.*$1=\\([^ ]*\\).*/\\1/
+                             p
+                             q
+@@ -2291,7 +2291,7 @@
+     case $cpu in
+         armv*)
+             cpuflags="-march=$cpu"
+-            subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
++            subarch=$(echo $cpu | /usr/gnu/bin/sed 's/[^a-z0-9]//g')
+         ;;
+         *)
+             cpuflags="-mcpu=$cpu"
+@@ -2605,7 +2605,7 @@
+ check_cc <<EOF || die "Symbol mangling check failed."
+ int ff_extern;
+ EOF
+-sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
++sym=$($nm $nm_opts $TMPO | gawk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
+ extern_prefix=${sym%%ff_extern*}
+ 
+ check_cc <<EOF && enable inline_asm
+@@ -2630,7 +2630,7 @@
+ check_cc <<EOF || die "endian test failed"
+ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
+ EOF
+-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
++od -t x1 $TMPO | /usr/gnu/bin/grep -q '42 *49 *47 *45' && enable bigendian
+ 
+ if enabled alpha; then
+ 
+@@ -2963,7 +2963,9 @@
+ fi
+ enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
+ 
+-texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
++(texi2html -version > /dev/null 2>&1 || texi2html /dev/null > /dev/null 2>&1) && enable texi2html || disable texi2html
++/usr/perl5/bin/pod2man /dev/null >/dev/null 2>&1 && enable pod2man || disable pod2man
++
+ 
+ check_header linux/fb.h
+ check_header linux/videodev.h
+@@ -3386,7 +3388,7 @@
+ get_version(){
+     name=$1
+     file=$source_path/$2
+-    eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
++    eval $(/usr/gnu/bin/grep "#define ${name}_VERSION_M" "$file" | gawk '{ print $2"="$3 }')
+     eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
+     lcname=$(tolower $name)
+     eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ffmpeg-10-Makefile-quick-texi2html-fix.diff	Sun Aug 14 15:35:27 2011 +0000
@@ -0,0 +1,16 @@
+
+remove options the texi2html doesn't know. probably this fix is incomplete
+and html index and such might not be built.
+or we need to use a updated texi2html.
+
+--- ffmpeg-0.8.2/Makefile.orig	2011-08-13 16:09:27.411986000 +0100
++++ ffmpeg-0.8.2/Makefile	2011-08-13 16:19:15.507677662 +0100
+@@ -123,7 +123,7 @@
+ doc/%.html: TAG = HTML
+ doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
+ 	$(Q)$(TEXIDEP)
+-	$(M)texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init --output $@ $<
++	$(M)texi2html -monolithic $<
+ 
+ doc/%.pod: TAG = POD
+ doc/%.pod: doc/%.texi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ffmpeg-11-add-sys_videodev2_h.diff	Sun Aug 14 15:35:27 2011 +0000
@@ -0,0 +1,14 @@
+
+Solaris names the include file sys/videodev2.h
+
+--- ffmpeg-0.8.2/configure.orig	2011-08-13 17:32:19.002653025 +0200
++++ ffmpeg-0.8.2/configure	2011-08-13 17:47:31.193139160 +0200
+@@ -1474,7 +1474,7 @@
+ sndio_indev_deps="sndio_h"
+ sndio_outdev_deps="sndio_h"
+ v4l_indev_deps="linux_videodev_h"
+-v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
++v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h sys_videodev2_h"
+ vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
+ vfwcap_indev_extralibs="-lavicap32"
+ x11_grab_device_indev_deps="x11grab XShmCreateImage"