%define name xvidcore
%define version 1.2.1
%define release 4%{?_dist_release}

Summary: Free reimplementation of the OpenDivX video codec
Name: %{name}
Version: %{version}
Release: %{release}
Source: http://downloads.xvid.org/downloads/%{name}-%{version}.tar.bz2
License: XVID (GPL with specific restrictions)
URL: http://www.xvid.org/
Group: System Environment/Libraries

#Requires: 
%ifarch %{ix86}
BuildRequires: nasm
%endif
%ifarch x86_64
BuildRequires: yasm
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
Free reimplementation of the OpenDivX video codec. You can play OpenDivX
and DivX4 videos with it, as well as encode compatible files.

%package devel
Summary: Development files for the XviD video codec
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
This package contains header files, static library and API
documentation for the XviD video codec.

%prep
%setup -q -n %{name}

%build
cd build/generic

%configure 
make %{?_smp_mflags} 

%install
rm -rf %{buildroot}
cd build/generic
%makeinstall
rm $RPM_BUILD_ROOT%{_libdir}/libxvidcore.a
cd $RPM_BUILD_ROOT%{_libdir}
chmod 755 libxvidcore.so*
/sbin/ldconfig -n .
ln -s libxvidcore.so.? libxvidcore.so

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc LICENSE README AUTHORS ChangeLog TODO
%{_libdir}/libxvidcore.so.*

%files devel
%defattr(-,root,root,-)
%doc CodingStyle examples/
%{_includedir}/xvid.h
%{_libdir}/libxvidcore.so

%changelog
* Sun Mar 21 2010 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.1-4
- change release to sync with self-build-xvidcore

* Fri Jun 26 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.2.1-3
- change release to sync with self-build-xvidcore

* Tue May 26 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.2.1-2
- change release to sync with self-build-xvidcore

* Sun Jan 11 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.2.1-1
- new upstream release
- dropped xvidcore-1.1.3_bitstream.patch

* Sun Nov 02 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.1.3-3
- spec in utf8

* Sun May 18 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.1.3-2
- release +1 to sync with self-build-xvidcore

* Fri Apr 11 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.1.3-1vl4
- build with new versioning policy
- apply xvidcore-1.1.3_bitstream.patch

* Tue Feb 19 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.1.3-0vl1
- initial build for Vine Linux 4.2

### end of file
