%bcond_without autoreqdep # don't care about package name deps generated by rpm
%bcond_without imlib2 # don't build imlib2 vhook module
#
-%define _snap 2008-10-24
+%define _snap 2009-02-25
%define snap %(echo %{_snap} | tr -d -)
%define rel 1
Summary: Realtime audio/video encoder and streaming server
Group: Applications/Multimedia
#Source0: http://dl.sourceforge.net/ffmpeg/%{name}-%{version}-pre1.tar.gz
Source0: http://ffmpeg.mplayerhq.hu/%{name}-export-snapshot.tar.bz2
-# Source0-md5: de89ea80da716879e0b85945d89b529a
+# Source0-md5: a7649aa1c597ba9bd0e92e42e1a56494
Source1: ffserver.init
Source2: ffserver.sysconfig
Source3: ffserver.conf
-Patch0: %{name}-img_convert_symbol.patch
-Patch1: %{name}-x264.patch
+Patch0: %{name}-x264.patch
URL: http://ffmpeg.mplayerhq.hu/
BuildRequires: SDL-devel
%if %{with amr}
BuildRequires: libdc1394-devel
BuildRequires: libgsm-devel
BuildRequires: libraw1394-devel
+BuildRequires: speex-devel
BuildRequires: libtheora-devel >= 1.0-0.beta3
BuildRequires: libtool >= 2:1.4d-3
BuildRequires: libvorbis-devel
%prep
%setup -q -n %{name}-export-%{_snap}
%patch0 -p1
-%patch1 -p1
-# package the grep result for mplayer, the result formatted as mplayer/configure
-cat <<EOF > ffmpeg-config
+# package the grep result for mplayer, the result formatted as ./mplayer/configure
+cat <<EOF > ffmpeg-avconfig
#! /bin/sh
_libavdecoders_all="`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
_libavencoders_all="`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`"
_libavmuxers_all="`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
_libavprotocols_all="`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`"
EOF
-cat <<'EOF' >> ffmpeg-config
+cat <<'EOF' >> ffmpeg-avconfig
case "$1" in
--decoders)
--enable-libgsm \
--enable-libmp3lame \
--enable-libschroedinger \
+ --enable-libspeex \
--enable-libtheora \
--enable-libvorbis \
--enable-libx264 \
--enable-libamr-wb
%endif
+# force oldscaler build
+sed -i -e 's|#define.*CONFIG_OLDSCALER.*0|#define CONFIG_OLDSCALER 1|g' config.h
+
%{__make}
%install
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-install config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
-install libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
+cp -a config.h $RPM_BUILD_ROOT%{_includedir}/ffmpeg
+cp -a libavutil/intreadwrite.h $RPM_BUILD_ROOT%{_includedir}/libavutil
+cp -a libavutil/bswap.h $RPM_BUILD_ROOT%{_includedir}/libavutil
+cp -a libavutil/common.h $RPM_BUILD_ROOT%{_includedir}/libavutil
+cp -a libavutil/mem.h $RPM_BUILD_ROOT%{_includedir}/libavutil
+for a in libavutil/*/bswap.h; do
+ install -D $a $RPM_BUILD_ROOT%{_includedir}/$a
+done
+cp -a libavformat/riff.h $RPM_BUILD_ROOT%{_includedir}/libavformat
+cp -a libavformat/avio.h $RPM_BUILD_ROOT%{_includedir}/libavformat
+
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ffserver
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ffserver
install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/ffserver.conf
# install as ffmpeg-avconfig to avoid with possible programs looking for
# ffmpeg-config and expecting --libs output from it which is not implemented
# simple to do (by querying pkgconfig), but why?
-install ffmpeg-config $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
+install ffmpeg-avconfig $RPM_BUILD_ROOT%{_bindir}/ffmpeg-avconfig
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc Changelog README doc/*.html doc/TODO
%attr(755,root,root) %{_bindir}/ffmpeg
+%dir %{_datadir}/ffmpeg
+%{_datadir}/ffmpeg/*.ffpreset
%{_mandir}/man1/ffmpeg.1*
%files libs