-#
-# TODO:
-# - pack svn snapshot. it has amd64 and sparc asm-accels
-# and can be used with mplayer.
-#
+%define snap 20091118
+%define snaph 2245
+%define rel 1
Summary: H264 encoder library
-Summary(pl): Biblioteka koduj±ca H264
+Summary(pl.UTF-8): Biblioteka kodująca H264
Name: libx264
-%define _snap 20051013
Version: 0.1.2
-Release: 1
-License: GPL v2
+Release: 1.%{snap}_%{snaph}.%{rel}
+License: GPL v2+
Group: Libraries
-# unofficial, debianized/libtoolized packaging;
-# no official releases, only svn://svn.videolan.org/x264/trunk x264
-Source0: http://www.acarlab.com/misc-dnlds/%{name}-%{version}.tar.gz
-# Source0-md5: 3bbaa669b3661d33030378f4919be576
-Patch0: %{name}-nasm.patch
-Patch1: %{name}-link.patch
-URL: http://developers.videolan.org/x264.html
-BuildRequires: autoconf >= 2.53
-BuildRequires: automake
-BuildRequires: libtool
-%ifarch %{ix86}
-BuildRequires: nasm
+# unofficial, debianized/libtoolized packaging:
+#Source0: http://www.acarlab.com/misc-dnlds/%{name}-%{version}.tar.gz
+# but it's too old, so use snapshots...
+Source0: ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-%{snap}-%{snaph}.tar.bz2
+# Source0-md5: 2aba19167fa145785a76e1525fad5627
+Patch0: %{name}-alpha.patch
+Patch1: %{name}-syms.patch
+URL: http://www.videolan.org/developers/x264.html
+BuildRequires: gettext-devel
+BuildRequires: pkgconfig
+%ifarch %{ix86} %{x8664}
+BuildRequires: yasm >= 0.6.0
%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# encoder/macroblock.c breaks strict-aliasing rules
+%define specflags -fno-strict-aliasing
+
%description
libx264 library for encoding H264 video format.
-%description -l pl
+%description -l pl.UTF-8
Biblioteka libx264 do kodowania w formacie obrazu H264.
%package devel
Summary: Header files for x264 library
-Summary(pl): Pliki nag³ówkowe biblioteki x264
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki x264
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Header files for x264 library.
-%description devel -l pl
-Pliki nag³ówkowe biblioteki x264.
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki x264.
%package static
Summary: Static x264 library
-Summary(pl): Statyczna biblioteka x264
+Summary(pl.UTF-8): Statyczna biblioteka x264
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%description static
Static x264 library.
-%description static -l pl
+%description static -l pl.UTF-8
Statyczna biblioteka x264.
%prep
-%setup -q
+%setup -q -n x264-snapshot-%{snap}-%{snaph}
%patch0 -p1
%patch1 -p1
+sed -i 's:-O4::g' configure
%build
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure
+CC="%{__cc}" \
+./configure \
+ --prefix=%{_prefix} \
+ --exec-prefix=%{_prefix} \
+ --bindir=%{_bindir} \
+ --includedir=%{_includedir} \
+ --libdir=%{_libdir} \
+ --extra-cflags="%{rpmcflags}" \
+ --enable-pic \
+ --enable-shared
+
%{__make}
%install
%files
%defattr(644,root,root,755)
-%doc AUTHORS TODO
+%doc AUTHORS
%attr(755,root,root) %{_bindir}/x264
-%attr(755,root,root) %{_libdir}/libx264.so.*.*.*
+%attr(755,root,root) %{_libdir}/libx264.so.[0-9][0-9]
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libx264.so
-%{_libdir}/libx264.la
%{_includedir}/x264.h
+%{_pkgconfigdir}/x264.pc
%files static
%defattr(644,root,root,755)